Skip to content

Comparison of character and integer #91595

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

Closed
sweetStreet opened this issue Apr 16, 2022 · 3 comments
Closed

Comparison of character and integer #91595

sweetStreet opened this issue Apr 16, 2022 · 3 comments
Assignees
Labels
type-bug An unexpected behavior, bug, or error

Comments

@sweetStreet
Copy link
Contributor

Bug report
"ch == 0x7F" seems to be incorrect, use "ord(ch) == 0x7F" instead

elif ch < ' ' or ch == 0x7F:

Your environment

  • CPython versions tested on: 3.7.10
  • Operating system and architecture: Linux x86-64
@sweetStreet sweetStreet added the type-bug An unexpected behavior, bug, or error label Apr 16, 2022
@ezio-melotti
Copy link
Member

ezio-melotti commented Apr 16, 2022

Thanks for the report! I created GH-91597.

@ezio-melotti
Copy link
Member

I see you already created GH-91596, I closed mine :)

miss-islington pushed a commit to miss-islington/cpython that referenced this issue Apr 16, 2022
…ord() (pythonGH-91596)

* fix the comparison of character and integer by using ord()

* 📜🤖 Added by blurb_it.

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
(cherry picked from commit 9300b6d)

Co-authored-by: Yu Liu <[email protected]>
ezio-melotti pushed a commit that referenced this issue Apr 16, 2022
…91596)

* fix the comparison of character and integer by using ord()

* 📜🤖 Added by blurb_it.

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
miss-islington added a commit that referenced this issue Apr 16, 2022
…H-91596)

* fix the comparison of character and integer by using ord()

* 📜🤖 Added by blurb_it.

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
(cherry picked from commit 9300b6d)

Co-authored-by: Yu Liu <[email protected]>
miss-islington added a commit that referenced this issue Apr 16, 2022
…H-91596)

* fix the comparison of character and integer by using ord()

* 📜🤖 Added by blurb_it.

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
(cherry picked from commit 9300b6d)

Co-authored-by: Yu Liu <[email protected]>
@ezio-melotti ezio-melotti self-assigned this Apr 16, 2022
@ezio-melotti
Copy link
Member

This is now fixed in 3.11/3.10/3.9. Thanks for the report and the PR!

hello-adam pushed a commit to hello-adam/cpython that referenced this issue Jun 2, 2022
…ord() (pythonGH-91596)

* fix the comparison of character and integer by using ord()

* 📜🤖 Added by blurb_it.

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
(cherry picked from commit 9300b6d)

Co-authored-by: Yu Liu <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

3 participants
@sweetStreet @ezio-melotti and others