mirror of
https://github.com/mail-in-a-box/mailinabox.git
synced 2025-06-26 22:00:54 +00:00
Fixed PLW1514 (unspecified-encoding): open
in text mode without explicit encoding
argument
This commit is contained in:
parent
66f140a8cf
commit
498e92dc95
@ -148,7 +148,7 @@ def get_mail_users_ex(env, with_archived=False):
|
|||||||
percent = ''
|
percent = ''
|
||||||
try:
|
try:
|
||||||
dirsize_file = os.path.join(env['STORAGE_ROOT'], 'mail/mailboxes/{}/{}/maildirsize'.format(domain, user))
|
dirsize_file = os.path.join(env['STORAGE_ROOT'], 'mail/mailboxes/{}/{}/maildirsize'.format(domain, user))
|
||||||
with open(dirsize_file, 'r') as f:
|
with open(dirsize_file, 'r', encoding="utf-8") as f:
|
||||||
box_quota = int(f.readline().split('S')[0])
|
box_quota = int(f.readline().split('S')[0])
|
||||||
for line in f.readlines():
|
for line in f.readlines():
|
||||||
(size, count) = line.split(' ')
|
(size, count) = line.split(' ')
|
||||||
|
@ -124,7 +124,7 @@ def generate_documentation():
|
|||||||
""")
|
""")
|
||||||
|
|
||||||
parser = Source.parser()
|
parser = Source.parser()
|
||||||
with open("setup/start.sh", "r") as start_file:
|
with open("setup/start.sh", "r", encoding="utf-8") as start_file:
|
||||||
for line in start_file:
|
for line in start_file:
|
||||||
try:
|
try:
|
||||||
fn = parser.parse_string(line).filename()
|
fn = parser.parse_string(line).filename()
|
||||||
@ -401,7 +401,7 @@ class BashScript(Grammar):
|
|||||||
@staticmethod
|
@staticmethod
|
||||||
def parse(fn):
|
def parse(fn):
|
||||||
if fn in ("setup/functions.sh", "/etc/mailinabox.conf"): return ""
|
if fn in ("setup/functions.sh", "/etc/mailinabox.conf"): return ""
|
||||||
with open(fn, "r") as f:
|
with open(fn, "r", encoding="utf-8") as f:
|
||||||
string = f.read()
|
string = f.read()
|
||||||
|
|
||||||
# tokenize
|
# tokenize
|
||||||
|
Loading…
Reference in New Issue
Block a user