Visitar URL original
[2.7] bpo-39084: Construct string.letters in the correct order when resetting locale by Manishearth · Pull Request #17650 · python/cpython · GitHub
The Wayback Machine - https://web.archive.org/web/20221206014717/https://github.com/python/cpython/pull/17650
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

[2.7] bpo-39084: Construct string.letters in the correct order when resetting locale #17650

Closed
wants to merge 1 commit into from

Conversation

Manishearth
Copy link

@Manishearth Manishearth commented Dec 18, 2019 •

…ng locale

We are constructing `string.letters` by iterating through all ASCII
letters, looking for `isalpha`, but that will place uppercase letters
first. This change makes the code construct the string in the correct
order (using the same buffer to avoid reiterating).
@the-knights-who-say-ni
Copy link

the-knights-who-say-ni commented Dec 18, 2019

Hello, and thanks for your contribution!

I'm a bot set up to make sure that the project can legally accept this contribution by verifying everyone involved has signed the PSF contributor agreement (CLA).

CLA Missing

Our records indicate the following people have not signed the CLA:

@Manishearth

For legal reasons we need all the people listed to sign the CLA before we can look at your contribution. Please follow the steps outlined in the CPython devguide to rectify this issue.

If you have recently signed the CLA, please wait at least one business day
before our records are updated.

You can check yourself to see if the CLA has been received.

Thanks again for the contribution, we look forward to reviewing it!

@Manishearth
Copy link
Author

Manishearth commented Dec 18, 2019

(I've already signed the CLA online, but it hasn't been updated)

@Manishearth Manishearth changed the title bpo-39084: Construct string.letters in the correct order when resetting locale [2.7] bpo-39084: Construct string.letters in the correct order when resetting locale Dec 18, 2019
@zware
Copy link
Member

zware commented Dec 18, 2019

Sorry, but I'm closing this for the same reasons as the issue:

  • this is a 2.x-only issue
  • it's been this way for 22 years apparently without causing issues until now (I can find no other reports on bugs.python.org)
  • it's actually documented that this happens
  • there's probably some code somewhere that would be broken by "fixing" this, and there would be no opportunity to fix it back because
  • Python 2.7 only has 2 weeks to live

You've followed our PR guidelines very well, though; thanks for that and I hope your next contribution has a better end than this one!

@zware zware closed this Dec 18, 2019
@Manishearth
Copy link
Author

Manishearth commented Dec 18, 2019

it's actually documented that this happens

It's not documented that string.letters will reverse, only that it will be recalculated

there's probably some code somewhere that would be broken by "fixing" this, and there would be no opportunity to fix it back because

I'd be very surprised if this happened given that this is kinda unpredictable, setlocale() can be called at weird times.

Python 2.7 only has 2 weeks to live

That's fair. My view is that it's not dead yet and we should get any fixes possible in before that so that the final version has them -- after all, even if it's EOL it's going to take a while for it to completely go away. But I get that that makes fixes like these very low priority.

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.

None yet

4 participants