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

[CHG] Make the parser python 3 compatible #9

Merged
merged 3 commits into from
Sep 26, 2018
Merged

Conversation

RobinetDenisAcsone
Copy link
Contributor

No description provided.

@coveralls
Copy link

coveralls commented Sep 21, 2018

Coverage Status

Coverage increased (+0.01%) to 94.588% when pulling cee2abb on python3_compatible_drt into 9258d9c on master.

coda/parser.py Outdated
@@ -90,7 +90,7 @@ def parse(self, value):
"""
if not self.is_valid_coda(value):
raise ValueError('The given value is not a valid coda content')
recordlist = unicode(value, 'windows-1252', 'strict').split('\n')
recordlist = value.decode('windows-1252', 'strict').split('\n')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in python2 str is bytes and unicode is unicode
in python 3 str is unicode and bytes is bytes

since we are decoding here, the value param must be bytes (str in python 2), so you need to open the files in 'rb' mode (in tests and in parse_file)

coda/parser.py Outdated Show resolved Hide resolved
@sbidoul
Copy link
Member

sbidoul commented Sep 21, 2018

Looks good. Just add

[bdist_wheel]
universal = 1

in setup.cfg.

@lmignon can you review, merge and release?

@lmignon lmignon merged commit 3faffd5 into master Sep 26, 2018
@lmignon lmignon deleted the python3_compatible_drt branch September 26, 2018 14:10
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

Successfully merging this pull request may close these issues.

None yet

4 participants