else:
out, dummy, ret = self._git_inout('rev-parse', ['--show-toplevel'],
capture_stderr=True)
- self._path = os.path.abspath(out.strip())
+ self._path = os.path.abspath(out.decode().strip())
def __init__(self, path):
self._path = os.path.abspath(path)
capture_stderr=True)
cdup = out.strip().decode(sys.getfilesystemencoding())
if ret:
- raise GitRepositoryError("No Git repository at '%s': '%s'" % (self.path, out))
- self._bare = False if out.strip() != 'true' else True
+ raise GitRepositoryError("No Git repository at '%s': '%s'" % (self.path, out.decode().strip()))
+ self._bare = False if out.decode().strip() != 'true' else True
self._check_dirs()
if not cwd:
cwd = self.path
ret = 0
- stdout = ''
- stderr = ''
+ stdout = b''
+ stderr = b''
try:
for outdata in self.__git_inout(command, args, input, extra_env,
cwd, capture_stderr,
"""
if not cwd:
cwd = self.path
- stderr = ''
+ stderr = b''
try:
for outdata in self.__git_inout(command, args, stdin, extra_env,
cwd, capture_stderr, True):
if w_ind > len(stdin):
rm_polled_fd(popen.stdin, in_fds)
# Read in chunks of 4k
- stdout = popen.stdout.read(4096) if popen.stdout in ready[0] else ''
- stderr = popen.stderr.read(4096) if popen.stderr in ready[0] else ''
+ stdout = popen.stdout.read(4096) if popen.stdout in ready[0] else b''
+ stderr = popen.stderr.read(4096) if popen.stderr in ready[0] else b''
if popen.stdout in ready[0] and not stdout:
rm_polled_fd(popen.stdout, out_fds)
if popen.stderr in ready[0] and not stderr:
remotes = {}
for rem in stdout.splitlines():
- name, url_urltype = rem.remote.decode().strip().split('\t', 1)
+ name, url_urltype = rem.decode().strip().split('\t', 1)
url, urltype = url_urltype.rsplit(' ', 1)
urltype = urltype.strip('()')
if not name in remotes:
>>> pq_branch_match('foo/bar/1.0/pq', 'foo/%(br)s/%(ver)s/pq').groupdict()
{'ver': '1.0', 'br': 'bar'}
"""
- pq_re = '^%s$' % re.sub('%\(([a-z_\-]+)\)s', r'(?P<\1>\S+)', pq_fmt_str)
+ pq_re = '^%s$' % re.sub('%\(([a-z_\-]+)\)s', r'(?P<\1>\\S+)', pq_fmt_str)
return re.match(pq_re, branch)