Skip to content
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

Config Parser default encoding should be utf-8 #11

Closed
return42 opened this issue Jan 20, 2016 · 2 comments
Closed

Config Parser default encoding should be utf-8 #11

return42 opened this issue Jan 20, 2016 · 2 comments

Comments

@return42
Copy link
Contributor

With non ascii characters in config-files.ini (e.g. in comments) we get a UnicodeDecodeError: 'ascii' codec can't decode byte ..... this is because the default encoding of the configparser is ascii. My suggestion is to change the default encoding to utf-8.

This would be done by setting "utf-8" in line 90 in konfig/__init__.py. Change from:

        if isinstance(filename, basestring):
            self.filename = filename
            self.read(filename)

to:

        if isinstance(filename, basestring):
            self.filename = filename
            self.read(filename, "utf-8")

It's a small change with huge effect outside of the ascii-world ;-)

tarekziade added a commit that referenced this issue Jan 3, 2017
@tarekziade
Copy link
Contributor

@return42 I can't reproduce the issue. Can you look at the test I have added ? Thx

@return42
Copy link
Contributor Author

@tarekziade thats wired, I can't reproduce neither ... so I close this issue / sorry for the noise.

FWIW, I try to make the sync-server components python3 compliant. Today I forked konf:

May you are interested, then take a look at my 'six' branch. Yes, konf seems already py3 compliant, but there are some improvements to build and test.

Do you know about any efforts to make the sync-server suite py3 compliant?

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants