mirror of
https://github.com/Mailu/Mailu.git
synced 2025-01-26 03:52:50 +02:00
Error handling for idna encoding
This commit is contained in:
parent
5dbf430241
commit
10034526a1
@ -27,7 +27,10 @@ class IdnaDomain(db.TypeDecorator):
|
||||
impl = db.String(80)
|
||||
|
||||
def process_bind_param(self, value, dialect):
|
||||
return idna.encode(value).decode("ascii").lower()
|
||||
try:
|
||||
return idna.encode(value).decode("ascii").lower()
|
||||
except ValueError:
|
||||
pass
|
||||
|
||||
def process_result_value(self, value, dialect):
|
||||
return idna.decode(value)
|
||||
|
1
towncrier/newsfragments/1087.bugfix
Normal file
1
towncrier/newsfragments/1087.bugfix
Normal file
@ -0,0 +1 @@
|
||||
Error handling in idna encoding
|
Loading…
x
Reference in New Issue
Block a user