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

gh-91922: Fix sqlite connection on nonstardard locales and paths #92926

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

serhiy-storchaka
Copy link
Member

@serhiy-storchaka serhiy-storchaka commented May 18, 2022

  • Fix function sqlite.connect() and the sqlite.Connection constructor
    on non-UTF-8 locales.
  • Fix support of bytes paths non-decodable with the current FS encoding.

Closes #91922

* Fix function sqlite.connect() and the sqlite.Connection constructor
  on non-UTF-8 locales.
* Fix support of bytes paths non-decodable with the current FS encoding.
@erlend-aasland
Copy link
Contributor

@erlend-aasland erlend-aasland commented May 18, 2022

Thanks, I'll review it tomorrow! From a quick glance, it seems like the main change is the PyOS_FSPath conversion, right?

@serhiy-storchaka
Copy link
Member Author

@serhiy-storchaka serhiy-storchaka commented May 19, 2022

No, the main change is calling PySys_Audit() before encoding the database path to char *.

PyOS_FSPath() is used instead of PyUnicode_FSConverter() in the module-level function to avoid unneeded encoding at that stage. In is not necessary change now (I thought it was necessary at the beginning of work on this issue).

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.

3 participants