From 8c59b575a2c631b8741627d950c8ebdf20c996a0 Mon Sep 17 00:00:00 2001 From: Jonathan Neidel Date: Tue, 10 Feb 2026 20:33:20 +0100 Subject: [PATCH] Fix codecs.open deprecation warning DeprecationWarning: codecs.open() is deprecated. Use open() instead. --- filetags/__init__.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/filetags/__init__.py b/filetags/__init__.py index f37bd52..2e291de 100755 --- a/filetags/__init__.py +++ b/filetags/__init__.py @@ -52,7 +52,6 @@ from tkinter import ttk ## for --gui safe_import('operator') # for sorting dicts safe_import('difflib') # for good enough matching words safe_import('readline') # for raw_input() reading from stdin -safe_import('codecs') # for handling Unicode content in .tagfiles safe_import('math') # (integer) calculations safe_import('clint') # for config file handling safe_import('itertools') # for calculating permutations of tagtrees @@ -2024,7 +2023,7 @@ def parse_controlled_vocabulary(filename): included_files.append(os.path.realpath(filename)) tags = [] - with codecs.open(filename, encoding='utf-8') as filehandle: + with open(filename, encoding='utf-8') as filehandle: logging.debug('parse_controlled_vocabulary: reading controlled vocabulary in [%s]' % filename) global controlled_vocabulary_filename