New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix cross-platform encoding issues. #428

Merged
merged 1 commit into from Apr 8, 2015

Conversation

Projects
None yet
2 participants
@waylan
Member

waylan commented Apr 7, 2015

By using io.open and explicitly defining the encoding on the call to
open every time, we should get consistant behavior across platforms
as open will not rely on each individual system's local settings
to determine what encoding to use. Note that io.open is an alias
to the built-in open function in Python 3. In Python 2.6+ it is a
Python 3 compatable implementation which works in Python 2. In the
future when all support for Python 2 is dropped, simply delete the
import statements with no additional changes to the code.

I expect this will fix both #239 and #352.

Fix cross-platform encodeing issues.
By using io.open and explicitly defining the encoding on the call to
open every time, we should get consistant behavior across platforms
as open will not rely on each individual system's local settings
to determine what encoding to use. Note that io.open is an alias
to the built-in open function in Python 3. In Python 2.6+ it is a
Python 3 compatable implementation which works in Python 2. In the
future when all support for Python 2 is dropped, simply delete the
import statements with no additional changes to the code.

I expect this will fix both #239 and #352.
@d0ugal

This comment has been minimized.

Member

d0ugal commented Apr 8, 2015

Neat! This makes lots of sense to me. I'll wait a little bit to see if anyone comments on it helping, or not, but otherwise I'm happy to merge it anyway.

@d0ugal d0ugal added this to the 0.12.0 milestone Apr 8, 2015

@d0ugal d0ugal added the Bug label Apr 8, 2015

d0ugal added a commit that referenced this pull request Apr 8, 2015

Merge pull request #428 from waylan/encoding
Fix cross-platform encoding issues.

@d0ugal d0ugal merged commit 74d3191 into mkdocs:master Apr 8, 2015

3 checks passed

continuous-integration/appveyor AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls Coverage increased (+0.02%) to 81.87%
Details
@d0ugal

This comment has been minimized.

Member

d0ugal commented Apr 8, 2015

I'm testing in a Windows VM and this seems to help, or at least, not cause further issues.

@waylan waylan deleted the waylan:encoding branch Jun 2, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment