]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core.git/commitdiff
package_deb.bbclass: replace 'codecs.open()' with 'open()'
authorTrevor Gamblin <tgamblin@baylibre.com>
Mon, 26 Jan 2026 17:25:47 +0000 (12:25 -0500)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 29 Jan 2026 10:26:54 +0000 (10:26 +0000)
With newer Python versions, codecs.open() is deprecated:

https://docs.python.org/3/library/codecs.html#codecs.open

Replace it with the preferred call to open().

Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
meta/classes-global/package_deb.bbclass

index 1f10b15a00c6630eda54f236444500fb2df02946..38c9d16c503926bebecb1ce86f33eea086debb23 100644 (file)
@@ -64,7 +64,6 @@ def deb_write_pkg(pkg, d):
     import textwrap
     import subprocess
     import collections
-    import codecs
 
     outdir = d.getVar('PKGWRITEDIRDEB')
     pkgdest = d.getVar('PKGDEST')
@@ -107,7 +106,7 @@ def deb_write_pkg(pkg, d):
         bb.utils.mkdirhier(controldir)
         os.chmod(controldir, 0o755)
 
-        ctrlfile = codecs.open(os.path.join(controldir, 'control'), 'w', 'utf-8')
+        ctrlfile = open(os.path.join(controldir, 'control'), mode='w', encoding='utf-8')
 
         fields = []
         pe = d.getVar('PKGE')