Fix unicode/bytes handling for python-3

This commit is contained in:
ZyX 2014-08-04 00:07:30 +04:00
parent 74a3c9a0ca
commit 50703f1cef
2 changed files with 2 additions and 2 deletions

View File

@ -180,7 +180,7 @@ def file_scheme(pl, segment_info):
return None return None
match = SCHEME_RE.match(name) match = SCHEME_RE.match(name)
if match: if match:
return unicode(match.group(0)) return match.group(0).decode('ascii')
@requires_segment_info @requires_segment_info

View File

@ -525,7 +525,7 @@ class _Buffer(object):
import os import os
if type(name) is not bytes: if type(name) is not bytes:
name = name.encode('utf-8') name = name.encode('utf-8')
if ':/' in name: if b':/' in name:
self._name = name self._name = name
else: else:
self._name = os.path.abspath(name) self._name = os.path.abspath(name)