Skip to content

Conversation

@systemcrash
Copy link

DeprecationWarning: codecs.open() is deprecated. Use open() instead.

DeprecationWarning: codecs.open() is deprecated. Use open() instead.

Signed-off-by: Paul Donald <newtwen+github@gmail.com>
@jimklimov
Copy link
Member

Thanks, this seems like it should work with pythons we care about in legacy OS practice (2.6+ and 3.x), but I'll let the multiplatform CI say if this change is OK ir needs if/else try/except etc. sort of handling.

@jimklimov jimklimov added packaging python portability We want NUT to build and run everywhere possible labels Jan 13, 2026
@jimklimov jimklimov added this to the 2.8.5 milestone Jan 13, 2026
@jimklimov jimklimov changed the title scripts: fix deprecation warning Python helper scripts: fix deprecation warning Jan 13, 2026
@jimklimov jimklimov added CI Entries related to continuous integration infrastructure (here CI = tools + scripts + recipes) augeas Configuration file parser (reader, writer) multi-tool for scripting, etc. labels Jan 13, 2026
@jimklimov
Copy link
Member

So... more code is needed to make sure which python version we are running on (or just try/except for missing class properties or method signatures):

03:58:43  Regenerating Augeas ups.conf lens with 'python'...
03:58:43  Traceback (most recent call last):
03:58:43    File "./gen-nutupsconf-aug.py.in", line 82, in <module>
03:58:43      fd = open(filename, encoding='utf-8')
03:58:43  TypeError: 'encoding' is an invalid keyword argument for this function
03:58:43  + exit
script returned exit code 1

@jimklimov jimklimov marked this pull request as draft January 15, 2026 01:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

augeas Configuration file parser (reader, writer) multi-tool for scripting, etc. CI Entries related to continuous integration infrastructure (here CI = tools + scripts + recipes) packaging portability We want NUT to build and run everywhere possible python

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants