From: Peter Eisentraut Date: Fri, 6 Mar 2026 09:31:35 +0000 (+0100) Subject: Fix Python deprecation warning X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=16686a853f1b0f479fbe716acecb3a264e70c824;p=thirdparty%2Fpostgresql.git Fix Python deprecation warning Starting with Python 3.14, contrib/unaccent/generate_unaccent_rules.py complains DeprecationWarning: codecs.open() is deprecated. Use open() instead. This makes that change. This works for all Python 3.x versions. Reviewed-by: Chao Li Discussion: https://www.postgresql.org/message-id/flat/2a668979-ed92-49a3-abf9-a3ec2d460ec2%40eisentraut.org --- diff --git a/contrib/unaccent/generate_unaccent_rules.py b/contrib/unaccent/generate_unaccent_rules.py index 40822d0c176..827fa6766df 100644 --- a/contrib/unaccent/generate_unaccent_rules.py +++ b/contrib/unaccent/generate_unaccent_rules.py @@ -236,7 +236,7 @@ def main(args): charactersSet = set() # read file UnicodeData.txt - with codecs.open( + with open( args.unicodeDataFilePath, mode='r', encoding='UTF-8', ) as unicodeDataFile: # read everything we need into memory