Skip to content

Conversation

@StanFromIreland
Copy link
Member

@StanFromIreland StanFromIreland commented Mar 10, 2025

@StanFromIreland
Copy link
Member Author

Maybe @abalkin should be removed from the CODEOWNERS and marked (inactive) in the devguide experts page? What do you think @pganssle , he has not been active for quite a few years.

@encukou
Copy link
Member

encukou commented Mar 11, 2025

I don't think the behaviour is guaranteed. Can you find it some standard?

IMO, it would be better to expand the note about what varies across platforms -- “The full set of format codes”, “handling of unsupported format specifiers”... and also handling of ambiguous/wrong inputs.

(Even if all platforms currently agree, I don't think we should commit to their behaviour. As musl shows, there can always appear a new platform that considers it fair game to reinterpret whatever's not specified in C or POSIX.)

@pganssle
Copy link
Member

Maybe @abalkin should be removed from the CODEOWNERS and marked (inactive) in the devguide experts page? What do you think @pganssle , he has not been active for quite a few years.

He can choose to do that if he wants, I think the only thing it is hurting is his inbox 😅

WRT the change, I needed a close look to understand what this meant, which makes me think that this is not a very clear statement. It seems like what you are trying to say is something about how ambiguous format specs are parsed, correct? For example, if a code can match one digit or two, and matching two digits will fail to parse but matching one digit will succeed, it chooses one?

What if you use %H%M with 111? Does it parse to 11, 1? 1, 11? Fail? How about 131? 071?

I don't think the behaviour is guaranteed. Can you find it some standard?

IMO, it would be better to expand the note about what varies across platforms -- “The full set of format codes”, “handling of unsupported format specifiers”... and also handling of ambiguous/wrong inputs.

I agree in principle. I think if we document this behavior, we should add tests and then maybe add language like, "The behavior when parsing ambiguous strings is platform dependent. On all currently supported platforms, ". We can add a comment to the test to change the documentation if the test starts failing on a supported platform because of their implementation of strptime. (Assuming that this is not already clearly specified in the POSIX standard).

@StanFromIreland
Copy link
Member Author

Maybe the wording from the GNU docs would be better?

The user has to make sure, though, that the input can be parsed in a unambiguous way. The string "1999112" can be parsed using the format "%Y%m%d" as 1999-1-12, 1999-11-2, or even 19991-1-2. It is necessary to add appropriate separators to reliably get results.

@encukou
Copy link
Member

encukou commented Feb 5, 2026

I don't think GNU docs have a compatible license, so we should use different wording.

Co-authored-by: Petr Viktorin <encukou@gmail.com>
Copy link
Member

@encukou encukou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@encukou encukou merged commit 2e3e76e into python:main Feb 12, 2026
33 checks passed
@github-project-automation github-project-automation bot moved this from Todo to Done in Docs PRs Feb 12, 2026
@encukou encukou added needs backport to 3.13 bugs and security fixes needs backport to 3.14 bugs and security fixes labels Feb 12, 2026
@miss-islington-app
Copy link

Thanks @StanFromIreland for the PR, and @encukou for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13.
🐍🍒⛏🤖

@miss-islington-app
Copy link

Thanks @StanFromIreland for the PR, and @encukou for merging it 🌮🎉.. I'm working now to backport this PR to: 3.14.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Feb 12, 2026
…e` (pythonGH-131049)

(cherry picked from commit 2e3e76e)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Feb 12, 2026
…e` (pythonGH-131049)

(cherry picked from commit 2e3e76e)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
@bedevere-app
Copy link

bedevere-app bot commented Feb 12, 2026

GH-144734 is a backport of this pull request to the 3.13 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.13 bugs and security fixes label Feb 12, 2026
@bedevere-app
Copy link

bedevere-app bot commented Feb 12, 2026

GH-144735 is a backport of this pull request to the 3.14 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.14 bugs and security fixes label Feb 12, 2026
encukou pushed a commit that referenced this pull request Feb 12, 2026
…me` (GH-131049) (GH-144735)

(cherry picked from commit 2e3e76e)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
encukou added a commit that referenced this pull request Feb 12, 2026
…me` (GH-131049) (GH-144734)

(cherry picked from commit 2e3e76e)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
@StanFromIreland StanFromIreland deleted the directive-splitting branch February 12, 2026 12:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Documentation in the Doc dir skip news

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants