Skip to content

Add a failing test for Unicode conversion #1467

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 8 commits into from
Jun 11, 2021
Merged

Conversation

pkese
Copy link
Contributor

@pkese pkese commented Jun 8, 2021

What does this implement/fix? Explain your changes.

A failing test for #1466

Does this close any currently open issues?

No, just analyzes failure case.

Any other comments?

See #1466

Checklist

Check all those that are applicable and complete.

  • Make sure to include one or more tests for your change
  • If an enhancement PR, please create docs and at best an example
  • Add yourself to AUTHORS
  • Updated the CHANGELOG

@dnfadmin
Copy link

dnfadmin commented Jun 8, 2021

CLA assistant check
All CLA requirements met.

@pkese pkese mentioned this pull request Jun 8, 2021
@lostmsu
Copy link
Member

lostmsu commented Jun 9, 2021

@filmor requested some minor tweaks

char* codePoints = (char*)PyBytes_AsString(p.DangerousGetAddress());
var bytesPtr = p.DangerousGetAddress();
int bytesLength = (int)Runtime.PyBytes_Size(bytesPtr);
char* codePoints = (char*)PyBytes_AsString(bytesPtr);
Copy link
Member

Choose a reason for hiding this comment

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

NIT: better add overload for PyBytes_AsString that takes BorrowedReference. This would remove unnecessary call to DangerousGetAddress above.

@filmor
Copy link
Member

filmor commented Jun 11, 2021

@lostmsu Can you reproduce the segfault on Python 3.9?

@lostmsu
Copy link
Member

lostmsu commented Jun 11, 2021

@filmor it did not fail on rerun. I think we can merge this in, and investigate if it will reappear.

@lostmsu lostmsu merged commit 12027ad into pythonnet:master Jun 11, 2021
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.

4 participants