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

fix(python): prevent conflation of unit.io tests directory with python io module #6889

Merged

Conversation

alexander-beedie
Copy link
Collaborator

@alexander-beedie alexander-beedie commented Feb 15, 2023

If tests are run relative to unit, the io directory can mask the io module (because it has an unnecessary __init__), leading to the following fatal Python error:

Fatal Python error: Py_Initialize: can't initialize sys standard streams

Removing the __init__ allows for proper resolution of the builtin io module (and doesn't impact running the tests).


(Note: this shows up most readily when attempting to debug tests from PyCharm)

…uses errors if tests run relative to "unit" root)
@github-actions github-actions bot added fix Bug fix python Related to Python Polars labels Feb 15, 2023
@alexander-beedie alexander-beedie changed the title fix(python): prevent conflation of unit.io tests directory with io module fix(python): prevent conflation of unit.io tests directory with python io module Feb 15, 2023
@alexander-beedie alexander-beedie added the test Related to the test suite label Feb 15, 2023
@ritchie46 ritchie46 merged commit 6efda87 into pola-rs:master Feb 15, 2023
@alexander-beedie alexander-beedie deleted the test-dirs-are-not-modules branch February 15, 2023 09:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix Bug fix python Related to Python Polars test Related to the test suite
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants