Skip to content

[PyMySQL] Sync ER constants with PyMySQL 1.2.4 - #16753

Merged
srittau merged 2 commits into
python:mainfrom
workollab:fix/pymysql-sync-er-constants-with-1-2-4
Nov 11, 2026
Merged

srittau merged 2 commits into
python:mainfrom
workollab:fix/pymysql-sync-er-constants-with-1-2-4

Conversation

@workollab

Copy link
Copy Markdown
Contributor

Stubtest for PyMySQL reported three mismatches in pymysql.constants.ER. This PR fixes them in stubs/PyMySQL/pymysql/constants/ER.pyi:

  • Remove ERROR_LAST, which no longer exists at runtime.
  • Add MUST_CHANGE_PASSWORD = 1820.
  • Add MUST_CHANGE_PASSWORD_LOGIN = 1862.

I grepped the PyMySQL stubs and nothing else references ER.ERROR_LAST. CR_ERROR_LAST in CR.pyi is a different constant and I left it alone. Ruff passes on the changed file, and tests/stubtest_third_party.py PyMySQL passed in my run.

@github-actions

This comment has been minimized.

@srittau srittau left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Needs a version bump.

@workollab

Copy link
Copy Markdown
Contributor Author

Bumped the version to ~=1.2.4, since the new constants only exist from PyMySQL 1.2.4.

@github-actions

Copy link
Copy Markdown
Contributor

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

@srittau
srittau merged commit 7f0dcd5 into python:main Nov 11, 2026
74 checks passed
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