-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Update Windows CI tests to run on Python 3.12 #12562
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
Update Windows CI tests to run on Python 3.12 #12562
Conversation
Not sure if there is a "tests" news entry categiry, and if there is if it should be that or "trivial". |
Exciting, there appears to be a Windows Python 3.12 specific failure, I will try and take a look this weekend. |
Okay, I've found the issue, although getting tests to run locally on Windows is painful, and I still get more failures than in CI, but I always have. The following test fails on Python 3.12 (I have tested 3.12.2 and 3.12.1) but not earlier versions of Python: The exception comes from this call when there is a colon in the name: pip/src/pip/_internal/utils/misc.py Line 358 in 7881c53
The end of the exception looks like this:
I created a minimal reproducer: Python 3.11:
Python 3.12:
So, I'm not sure what to do with this? Do I attempt to write a workaround in pip to handle renaming files on Windows with colons in them? Do I mark the test xfail in pip? Do I write a bug to CPython:? |
I'd raise a bug with CPython. It's not a pip issue, as is demonstrated by the fact that your reproducer doesn't need pip. It's possibly a Windows filename limitation (colons usually delimit drive letters or NTFS stream components) but if that's the case, why did it work in 3.11. The error "The parameter is incorrect" is a Windows error, which also suggests a Windows-level problem. Maybe Regardless, we probably need to work around this in pip. If my suspicion is right, and it's the colons in the filename that are the issue, then as the test is explicitly looking at behaviour when there are colons in the name, I don't think we should simply ignore it. We either support the scenario being tested (in which case, we find a fix on Windows) or we don't (in which case the test shouldn't even be there). |
This appears to be the causing CPython issue python/cpython#88745 and commit python/cpython@cda1bd3 It appears prior to Python 3.12 It seems a simple workaround could be in the util.misc.renames function to detect if on Windows and ignore everything after the |
The Windows documentation here points out that colon is a reserved character. And this document covers the use of colons when naming a stream within a file (streams are an very rarely used feature of NTFS where a file can have multiple named contents, similar to the old MacOS data and resource forks). The entry point specification stops just short of saying that All of which is to say that I don't think the test is valid (specifically the part that creates a console script called The part of the test that creates normal entry points |
Okay, updated. Also I checked, and this used to be an xfail until ~two months ago: https://github.com/pypa/pip/pull/12493/files#diff-1a2d44e11ea700f3acffd1fc567470ee975b4ba7dcf421925087ebe652cdf7ba cc @sbidoul if you have any opinions on this. |
2dfdc47
to
876cfe3
Compare
I'm fine with removing that test. For completeness here is where it was marked xfail: #11871 (comment) |
My understanding is that Windows tests are slow, so the compromise is to run the tests on the newest and oldest versions that pip supports.
It seems the Windows tests were never updated to Python 3.12, this update that and adds a comment justifying this so when new versions of Python are added and removed from the CI hopefully the updater will notice this and update Windows as well.