Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix unicode in PR title or description
PR title or description containing characters like áéíóúæç throws a UnicodeEncodeError. Python 2 default encoding is the ASCII encoding and raises a UnicodeEncodeError exception converting a Unicode string into the ASCII encoding if a code point (byte value) is greater than 127. The built-in open() is not consistent from Python 2 to 3. In Python 2 open() uses the ASCII encoding for opening a file in text mode to read/write contents while in Python 3 is platform-dependent encoding (whatever locale.getpreferredencoding() returns) or a specific encoding can be given as a parameter. Using io.open() instead of the built-in open() will handle correctly ASCII and Unicode strings when opening file to read/write contents and also ensures consistency from Python 2 to 3 (actually io.open() is the built-in open() in Python 3). Fix #276
- Loading branch information