bpo-32002: Refactor C locale coercion tests#4369
Conversation
|
OK, I've factored out the default case to its own subtest. @embray, would you mind trying this patch out on Cygwin and seeing how it breaks? I'm thinking the right order to do things will be to get #4334 merged for Android, rebase this test case change on top of that one, and then figure out a reasonable way to make the expected behaviour in the default locale automatically adjust itself (without making the test case tautological). |
Sorry, something went wrong.
xdegaye
left a comment
There was a problem hiding this comment.
The tests are successfull on Android when the following changes are made.
Sorry, something went wrong.
|
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase And if you don't make the requested changes, you will be put in the comfy chair! |
Sorry, something went wrong.
|
I also think that this is one of those cases where seemingly tautological test cases may still be worth running, due to non-trivial interactions between the interpreter, the environment, libc, libintl, etc... |
Sorry, something went wrong.
|
I'm actually starting to wonder if we should put together a configure check that reports back the result of:
That way we could query |
Sorry, something went wrong.
|
This test still fails on Cygwin because it assumes that by default the locale will be "C" and that coercion will happen (which results in the In #4361 I just skipped the cases didn't explicitly set one of the LC_ vars to |
Sorry, something went wrong.
|
@ncoghlan I think the configure-time check is a good idea. It could still be disabled when cross-compiling, in which case a fallback is needed. But it might be useful to have as a first pass, especially for use by the test suite. |
Sorry, something went wrong.
|
On problem I have noticed, at least on Cygwin, is that |
Sorry, something went wrong.
I think we should limit the use of configure for setting the platform type instead and hard code the specific expectations for a platform in For example Android had an entry in the |
Sorry, something went wrong.
@embray what are the test results if you replace |
Sorry, something went wrong.
|
@xdegaye That fails all the same on Cygwin. The difference between Cygwin and Android here are different. On Cygwin the meaning of the In other words, |
Sorry, something went wrong.
Exactly which locale requests will end up giving you the "C" locale is actually platform dependent. A blank locale and "POSIX" will translate to "C" on most Linux distros, but may not do so on other platforms, so this adjusts the way the tests are structured accordingly. This may also prove sufficient to fix a current test failure on Cygwin (hence the issue reference)
90b8bb5 to
05abe72
Compare
December 9, 2017 08:41
|
@xdegaye @embray I'm going to merge this once the current CI run finishes (so I can build a patch for https://bugs.python.org/issue30672 on top of it), but I'll leave the tracker issue as "pending" until you've confirmed that this works as intended on Cygwin and Android |
Sorry, something went wrong.
|
Although it would help not to overwrite the Android fixes when rebasing the patch :) So change of plan: I'll hold off on merging until you've both given the thumbs up. If it looks good, @xdegaye can merge it, otherwise I'll deal with it after I get back from NZ. |
Sorry, something went wrong.
|
The test_c_locale_coercion.log file is the output of running
|
Sorry, something went wrong.
|
My phone is essentially my only computer until January, but I believe
@xdegaye should have permission to push to my PR branch as a CPython
maintainer.
|
Sorry, something went wrong.
|
I still get the following failures on Cygwin: But +1 to going ahead and merging, if you want, as this is significantly cleaned up, and I can look into addressing the final Cygwin-related bits on top of this. |
Sorry, something went wrong.
|
Merged! Thanks for the reviews and updates, folks :) |
Sorry, something went wrong.
Exactly which locale requests will end up giving
you the "C" locale is actually platform dependent.
A blank locale and "POSIX" will translate to "C"
on most Linux distros, but may not do so on other
platforms, so this adjusts the way the tests are
structured accordingly.
This may also prove sufficient to fix a current
test failure on Cygwin (hence the issue reference)
https://bugs.python.org/issue32002