aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWaylan Limberg <waylan@gmail.com>2012-11-08 12:10:59 -0500
committerWaylan Limberg <waylan@gmail.com>2012-11-08 12:10:59 -0500
commit578a5118152d47564fc8e79b6bb7a7293f7123bd (patch)
tree35d0545f635453e047e7baced49ea0d6af5cc779
parentf2d5aa83bbbd7cb260ea78dd8dfb4e2d4db4f7f7 (diff)
downloadmarkdown-578a5118152d47564fc8e79b6bb7a7293f7123bd.tar.gz
markdown-578a5118152d47564fc8e79b6bb7a7293f7123bd.tar.bz2
markdown-578a5118152d47564fc8e79b6bb7a7293f7123bd.zip
Updated fix for #158 for Python <2.7
Apparently, the `errors` keyword to encode was added in Python 2.7. In previous versions, it was just a positional argument. This should now work in all support versions. Thanks to @Gamma3000 for assistance in working through this issue.
-rw-r--r--markdown/__init__.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/markdown/__init__.py b/markdown/__init__.py
index 1b71295..75c179b 100644
--- a/markdown/__init__.py
+++ b/markdown/__init__.py
@@ -380,7 +380,7 @@ class Markdown:
# Don't close here. User may want to write more.
else:
# Encode manually and write bytes to stdout.
- html = html.encode(encoding, errors="xmlcharrefreplace")
+ html = html.encode(encoding, "xmlcharrefreplace")
try:
# Write bytes directly to buffer (Python 3).
sys.stdout.buffer.write(html)