]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard: replace deprecated codecs.open with open 68329/head
authorKefu Chai <k.chai@proxmox.com>
Sat, 11 Apr 2026 11:22:46 +0000 (19:22 +0800)
committerKefu Chai <k.chai@proxmox.com>
Sat, 11 Apr 2026 11:22:46 +0000 (19:22 +0800)
codecs.open() was deprecated since Python 3.14, see
https://docs.python.org/3/library/codecs.html#codecs.open.
Let's use the builtin open() as recommended by the official
document.

Signed-off-by: Kefu Chai <tchaikov@gmail.com>
Signed-off-by: Kefu Chai <k.chai@proxmox.com>
src/pybind/mgr/dashboard/ci/check_grafana_dashboards.py

index 95e1c3ffe0307d53bb5921b1141abf0617bb32b4..b28a7d8295d37bf342a926ad4ec6925b3b79ccca 100644 (file)
@@ -13,7 +13,6 @@ e.g.
     python ci/<script> frontend/src/app /ceph/monitoring/ceph-mixin/dashboards_out
 """
 import argparse
-import codecs
 import copy
 import json
 import os
@@ -29,7 +28,7 @@ class TemplateParser(HTMLParser):
         self.parsed_data = []
 
     def parse(self):
-        with codecs.open(self.file, encoding='UTF-8') as f:
+        with open(self.file, encoding='UTF-8') as f:
             self.feed(f.read())
 
     def handle_starttag(self, tag, attrs):