commit c2d4e7bafda2bf89061b4da7237a551b46eb5ffa
parent afd5612ae9dbea69612ba711fa6497b2da8954e0
Author: Christoph Lohmann <20h@r-36.net>
Date: Sat, 15 Aug 2026 10:58:38 +0200
Fix click and codec.open deprecation.
Diffstat:
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/wiki b/wiki
@@ -1,8 +1,6 @@
#!/usr/bin/python
# coding=utf-8
#
-# See LICENSE.
-#
# Copy me if you can.
# by 20h
#
@@ -35,14 +33,14 @@ class git(object):
""" I/O helper functions. """
def getfile(self, fi):
- fd = codecs.open(fi, mode="r", encoding="utf-8")
+ fd = open(fi, mode="r", encoding="utf-8")
text = fd.read()
fd.close()
return text
def putfile(self, fi, content):
#content = content.decode("utf-8")
- fd = codecs.open(fi, mode="w+", encoding="utf-8")
+ fd = open(fi, mode="w+", encoding="utf-8")
fd.write(content)
fd.close()
return None
@@ -211,7 +209,7 @@ class git(object):
def editor(content):
try:
- data = click.edit(content, require_save=True, extension='.md')
+ data = click.edit(content, require_save=False, extension='.md')
except click.UsageError:
return (1, content)
if data == None: