Skip to content
Snippets Groups Projects
Commit f1477e6e authored by Radko Krkoš's avatar Radko Krkoš
Browse files

DB schema: Fix IDNA Unicode decode in conversion script

* The idna library used leaves the Unicode codepoint validation
  to the Unicode implementation and does not catch the exceptions
  from therein. So, catch these explicitly.
parent b3ccbdff
No related branches found
No related tags found
No related merge requests found
......@@ -8,7 +8,7 @@ CREATE FUNCTION idnadecode(domain text) RETURNS text AS $$
import idna
try:
return idna.decode(domain)
except idna.core.IDNAError:
except (idna.core.IDNAError, UnicodeError):
return domain
$$ LANGUAGE plpython3u;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment