mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-12-20 09:02:40 +01:00
src/registry.py: Fix encoding issue with Python 3.
This commit is contained in:
parent
e89dcf867a
commit
0b7e4e5ce5
@ -155,7 +155,7 @@ def isValidRegistryName(name):
|
|||||||
return len(name.split()) == 1 and not name.startswith('_')
|
return len(name.split()) == 1 and not name.startswith('_')
|
||||||
|
|
||||||
def escape(name):
|
def escape(name):
|
||||||
name = encoder(name)[0]
|
name = encoder(name)[0].decode()
|
||||||
name = name.replace(':', '\\:')
|
name = name.replace(':', '\\:')
|
||||||
name = name.replace('.', '\\.')
|
name = name.replace('.', '\\.')
|
||||||
return name
|
return name
|
||||||
@ -163,7 +163,7 @@ def escape(name):
|
|||||||
def unescape(name):
|
def unescape(name):
|
||||||
name = name.replace('\\.', '.')
|
name = name.replace('\\.', '.')
|
||||||
name = name.replace('\\:', ':')
|
name = name.replace('\\:', ':')
|
||||||
name = decoder(name)[0]
|
name = decoder(name.encode())[0]
|
||||||
return name
|
return name
|
||||||
|
|
||||||
_splitRe = re.compile(r'(?<!\\)\.')
|
_splitRe = re.compile(r'(?<!\\)\.')
|
||||||
|
Loading…
Reference in New Issue
Block a user