Fix unicode/bytes handling for python-3
This commit is contained in:
parent
74a3c9a0ca
commit
50703f1cef
|
@ -180,7 +180,7 @@ def file_scheme(pl, segment_info):
|
|||
return None
|
||||
match = SCHEME_RE.match(name)
|
||||
if match:
|
||||
return unicode(match.group(0))
|
||||
return match.group(0).decode('ascii')
|
||||
|
||||
|
||||
@requires_segment_info
|
||||
|
|
|
@ -525,7 +525,7 @@ class _Buffer(object):
|
|||
import os
|
||||
if type(name) is not bytes:
|
||||
name = name.encode('utf-8')
|
||||
if ':/' in name:
|
||||
if b':/' in name:
|
||||
self._name = name
|
||||
else:
|
||||
self._name = os.path.abspath(name)
|
||||
|
|
Loading…
Reference in New Issue