]> git.ipfire.org Git - thirdparty/sqlalchemy/alembic.git/commit
Specify `"locale"` encoding when reading configuration file
authorKevin Kirsche <kevin.kirsche@one.verizon.com>
Fri, 11 Aug 2023 14:06:36 +0000 (10:06 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Wed, 16 Aug 2023 15:54:36 +0000 (11:54 -0400)
commit63be91641dde3fba6db408c2f41824637801d284
treec9d8b645c3cd030434466ca8d4f27231d2d7e923
parent23f2b362c542823829b9e5dc511dfae5efa69e8f
Specify `"locale"` encoding when reading configuration file

Added ``encoding="locale"`` setting to the use of Python's
``ConfigParser.read()``, so that a warning is not generated when using the
recently added Python feature ``PYTHONWARNDEFAULTENCODING`` specified in
:pep:`597`. The encoding is passed as the ``"locale"`` string under Python
3.10 and greater, which indicates that the system-level locale should be
used, as was the case already here.  Pull request courtesy Kevin Kirsche.

Fixes: #1273
Closes: #1274
Pull-request: https://github.com/sqlalchemy/alembic/pull/1274
Pull-request-sha: d0abd33845754827b8ce69ba1360989c7c57fdb6

Change-Id: I75c1237ba8bd2e38890d0e5e4a578a6ca0b24883
alembic/config.py
alembic/util/compat.py
docs/build/unreleased/1273.rst [new file with mode: 0644]