Skip to content

Commit 201bec3

Browse files
committed
Force unicode on verison string
1 parent 756e6e7 commit 201bec3

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

readthedocs/projects/version_handling.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,9 @@ def version_windows(versions, major=1, minor=1, point=1):
108108

109109
def parse_version_failsafe(version_string):
110110
try:
111-
return Version(unicodedata.normalize('NFKD', version_string).encode('ascii', 'ignore'))
111+
return Version(
112+
unicodedata.normalize('NFKD', unicode(version_string)).encode('ascii', 'ignore')
113+
)
112114
except (UnicodeError, InvalidVersion):
113115
return None
114116

0 commit comments

Comments
 (0)