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

Handle bytes in the attrs_before parameter for pyodbc.connect() #1290

Merged
merged 1 commit into from
Oct 13, 2023

Conversation

keitherskine
Copy link
Collaborator

An attempt to fix the segfault issue #1289 .

It looks like the code to handle byte values in the attrs_before parameter was lost in the v5 upgrade. I've copied the original code back in. The only difference is I've replaced the call to PyBytes_AS_STRING with the stable ABI compliant call to PyBytes_AsString.

@mkleehammer / @v-chojas / @gordthompson , I haven't been able to properly test this though, so do please check what I've done.

It looks like the code to handle byte values in the attrs_before parameter was lost in the v5 upgrade.  Adding it back in.
@mkleehammer
Copy link
Owner

@keitherskine Thanks for this. I believe when I was porting I was thinking everything should be text and I should take out bytes.

BTW, after this is merged, I should probably add an error to say "type XXX is not supported". If that existed before, people would have seen "type bytes is not supported" and would have sped up the process of troubleshooting.

@mkleehammer mkleehammer merged commit 19beb9a into mkleehammer:master Oct 13, 2023
8 checks passed
@mkleehammer
Copy link
Owner

Ha. The new error message I added would not have helped in this case. One of the checks below is for a sequence, which bytes are. Thanks again.

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.

2 participants