Fix some test cases and bugs found on py3 bmsmilter install.

This commit is contained in:
Stuart D. Gathman
2021-01-09 21:49:13 -05:00
parent 7df236127b
commit e7592c6a96
4 changed files with 52 additions and 8 deletions
+4 -4
View File
@@ -358,9 +358,9 @@ class Base(object):
if e == 'bytes':
#self.envfrom_bytes = self.envfrom
return self.envfrom(*b)
s = (v.decode(encoding='utf-8',errors=e) for v in b)
s = [v.decode(encoding='utf-8',errors=e) for v in b]
except UnicodeDecodeError: s = b
return self.envfrom(fld,*s)
return self.envfrom(s[0],*s[1:])
## Called when the SMTP client says MAIL FROM. Called by the
# <a href="milter_api/xxfi_envfrom.html">
# xxfi_envfrom</a> callback.
@@ -383,9 +383,9 @@ class Base(object):
if e == 'bytes':
#self.envrcpt_bytes = self.envrcpt
return self.envrcpt(*b)
s = (v.decode(encoding='utf-8',errors=e) for v in b)
s = [v.decode(encoding='utf-8',errors=e) for v in b]
except UnicodeDecodeError: s = b
return self.envrcpt(fld,*s)
return self.envrcpt(s[0],*s[1:])
## Called when the SMTP client says RCPT TO. Called by the
# <a href="milter_api/xxfi_envrcpt.html">
# xxfi_envrcpt</a> callback.
+1
View File
@@ -16,6 +16,7 @@ try:
f = DB()
f.open(fname,mode)
return f
except ModuleNotFoundError: raise
except:
import anydbm as dbm
dbmopen = dbm.open