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 failing test on Windows with Python 3.11.9+ #148

Merged
merged 2 commits into from
Nov 12, 2024
Merged

Fix failing test on Windows with Python 3.11.9+ #148

merged 2 commits into from
Nov 12, 2024

Conversation

marcelm
Copy link
Owner

@marcelm marcelm commented Nov 11, 2024

Python 3.10 is fine, but 3.11 breaks the tests. This made creating the wheels for v1.2.3 fail.

@rhpvorderman
Copy link
Collaborator

rhpvorderman commented Nov 11, 2024

1.2.2 Was released but a month ago and the wheel building presumably went fine (I saw no error messages in the e-mail). I wonder what could cause this.

EDIT: The diff is not giving me any clues. This is weird. Also why would it be specific to python 3.11?

@marcelm
Copy link
Owner Author

marcelm commented Nov 11, 2024

Some testing in a virtual machine gives the result that the tests pass with Python 3.11.8, but fail with Python 3.11.9. The Python 3.11 version changed when I updated cibuildwheel.

@rhpvorderman
Copy link
Collaborator

Could it be this change? https://github.com/python/cpython/pull/116989/files

It is the only thing I find in the changelog (https://docs.python.org/release/3.11.9/whatsnew/changelog.html#python-3-11-9) that seems related.

@rhpvorderman
Copy link
Collaborator

Alternatively, I wonder if replacing cat with python -c 'import sys; file = sys.argv[1]; f=open(file, "rt"); text = f.read(); f.close(); sys.stdout.write(text) would solve the issue. That should work with all operating systems equally.

In particular, test on Python 3.11
This should fix a bug with reading from stdin on Windows under Python
3.11.9+
@marcelm
Copy link
Owner Author

marcelm commented Nov 11, 2024

Or maybe this one? python/cpython#95782

In any case, the problem is in _detect_format_from_content, where seekable() is true for stdin on Windows but doesn’t actually work. Not sure what the actual problem is, but preferring peek() makes the issue go away.

@marcelm marcelm changed the title Tests fail on Windows under Python 3.11 Fix failing test on Windows under Python 3.11.9+ Nov 11, 2024
@marcelm marcelm changed the title Fix failing test on Windows under Python 3.11.9+ Fix failing test on Windows with Python 3.11.9+ Nov 11, 2024
@rhpvorderman
Copy link
Collaborator

rhpvorderman commented Nov 12, 2024

Good find! These windows-specific issues are always very tedious to solve. I am glad you found the solution relatively quickly.

@rhpvorderman rhpvorderman merged commit 093fe21 into main Nov 12, 2024
25 checks passed
@marcelm
Copy link
Owner Author

marcelm commented Nov 12, 2024

Version 1.2.3 is now released.

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