Skip to content

bpo-37571: Add 'b' to prevent the TypeError exception. #14721

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

Merged
merged 2 commits into from
Jul 14, 2019

Conversation

mangrisano
Copy link
Contributor

@mangrisano mangrisano commented Jul 12, 2019

In Python3 is not be able to assign a str to a c_char_p, so the 'b' is essential to prevent the TypeError exception.

https://bugs.python.org/issue37571

Copy link
Contributor

@aeros aeros left a comment

Choose a reason for hiding this comment

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

I confirmed that the TypeError occurs when attempting to assign a string to the value of an object instantiated from c_char_p:

image

Co-Authored-By: Kyle Stanley <aeros167@gmail.com>
@mangrisano
Copy link
Contributor Author

You're right. Thanks a lot for reviewing this.

@mangrisano
Copy link
Contributor Author

/cc @abalkin @amauryfa @meadori

@zooba zooba merged commit 6b92958 into python:master Jul 14, 2019
@miss-islington
Copy link
Contributor

Thanks @mangrisano for the PR, and @zooba for merging it 🌮🎉.. I'm working now to backport this PR to: 3.7, 3.8.
🐍🍒⛏🤖 I'm not a witch! I'm not a witch!

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jul 14, 2019
Co-Authored-By: Kyle Stanley <aeros167@gmail.com>
(cherry picked from commit 6b92958)

Co-authored-by: Michele Angrisano <michele.angrisano@gmail.com>
@bedevere-bot
Copy link

GH-14762 is a backport of this pull request to the 3.8 branch.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jul 14, 2019
Co-Authored-By: Kyle Stanley <aeros167@gmail.com>
(cherry picked from commit 6b92958)

Co-authored-by: Michele Angrisano <michele.angrisano@gmail.com>
@bedevere-bot
Copy link

GH-14763 is a backport of this pull request to the 3.7 branch.

miss-islington added a commit that referenced this pull request Jul 14, 2019
Co-Authored-By: Kyle Stanley <aeros167@gmail.com>
(cherry picked from commit 6b92958)

Co-authored-by: Michele Angrisano <michele.angrisano@gmail.com>
miss-islington added a commit that referenced this pull request Jul 14, 2019
Co-Authored-By: Kyle Stanley <aeros167@gmail.com>
(cherry picked from commit 6b92958)

Co-authored-by: Michele Angrisano <michele.angrisano@gmail.com>
@mangrisano mangrisano deleted the fix-issue-37571 branch July 14, 2019 09:09
lisroach pushed a commit to lisroach/cpython that referenced this pull request Sep 10, 2019
Co-Authored-By: Kyle Stanley <aeros167@gmail.com>
DinoV pushed a commit to DinoV/cpython that referenced this pull request Jan 14, 2020
Co-Authored-By: Kyle Stanley <aeros167@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation in the Doc dir skip news
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants