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

Fix an invalid string to bytes comparison in Python 3 #498

Merged
merged 1 commit into from Jun 4, 2017

Conversation

rowillia
Copy link
Contributor

@rowillia rowillia commented May 27, 2017

In Python 3 this branch would never evaluate to False due to comparing a string to bytes.

This was flagged by running some unit tests with the -bb flag, so I've added
-bb to run with the babel unit tests in Python3.5

Here's some docs on the -bb flag:
https://docs.python.org/3.5/library/warnings.html#default-warning-filters
https://docs.python.org/3/howto/pyporting.html#use-continuous-integration-to-stay-compatible

@codecov-io
Copy link

codecov-io commented May 27, 2017

Codecov Report

Merging #498 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #498   +/-   ##
=======================================
  Coverage   90.25%   90.25%           
=======================================
  Files          24       24           
  Lines        4004     4004           
=======================================
  Hits         3614     3614           
  Misses        390      390
Impacted Files Coverage Δ
babel/localtime/_unix.py 32.05% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 644dbc2...be718f3. Read the comment docs.

In Python 3 this branch would never evaluate to `True` due to comparing a string to bytes.

This was flagged by running some unit tests with the `-bb` flag, so I've added
`-bb` to run with the babel unit tests in Python3.5

Here's some docs on the `-bb` flag:
https://docs.python.org/3.5/library/warnings.html#default-warning-filters
https://docs.python.org/3/howto/pyporting.html#use-continuous-integration-to-stay-compatible
@rowillia
Copy link
Contributor Author

rowillia commented Jun 4, 2017

Ping @akx ! Anything else I can do here? It's a pretty straight forward fix and I'd love to get this in (this issue prevents us from, for example, running our unit tests with the -bb flag on with an unpatched version of babel)

@akx
Copy link
Member

akx commented Jun 4, 2017

Ah, sorry! This kinda flew under my radar.

Patch looks good, as does the stricter flags for CI :)

Thank you!

@akx akx merged commit 0c75f29 into python-babel:master Jun 4, 2017
benselme added a commit to benselme/babel that referenced this pull request Jun 25, 2017
Some changes introduced in python-babel#498 apparently made travis
fail on newer pull requests.
benselme added a commit to benselme/babel that referenced this pull request Jun 25, 2017
Some changes introduced in python-babel#498 apparently made travis
fail on newer pull requests.
benselme added a commit to benselme/babel that referenced this pull request Jun 25, 2017
Some changes introduced in python-babel#498 apparently made travis
fail on newer pull requests.
benselme added a commit to benselme/babel that referenced this pull request Jun 25, 2017
Some changes introduced in python-babel#498 apparently made travis
fail on newer pull requests.
benselme added a commit to benselme/babel that referenced this pull request Jun 25, 2017
Some changes introduced in python-babel#498 apparently made travis
fail on newer pull requests.
benselme added a commit to benselme/babel that referenced this pull request Jun 25, 2017
Some changes introduced in python-babel#498 apparently made travis
fail on newer pull requests.
@rowillia
Copy link
Contributor Author

@akx Would it be possible to cut a release with this fix in it?

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

Successfully merging this pull request may close these issues.

None yet

4 participants