Closed ghost closed 5 years ago
To be clear: This pull request is not directly intended for merging (due to the Deprecation warnings introduced in the 3rd commit) but giving you the patches for easier inspection.
Any news on this?
Thanks for this PR! I've updated the fixes in it and released it to PyPI as 0.14.
@jamadden Thanks for taking care of this.
The following snippet fails with an UnicodeEncodeError on Python 2.7:
The error is
The internet(tm) suggested that when using
pattern.format(str)
bothstr
andpattern
have to have the same encoding. In the above examplepattern
is ASCII where asstr
is the above UTF-8 string. The solution is to make them both UTF-8.Python 3 does not seem to have this problem (probably due to the unicode change of str in Python 3).
Workaround: Add
to your Sphinx
conf.py
(Note theu
infront of the string which marks it as UTF-8).The commits Attached three commits
f.write()
insphinxcontrib-programoutput/src/sphinxcontrib/programoutput/tests/__init__.py
, line 99). However, this triggersDeprecationWarning: 'U' mode is deprecated
on Python 3.6 (and maybe other 3.x).Feel free to use them as you wish.