-
Notifications
You must be signed in to change notification settings - Fork 94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Gitcc not compatible with python 3.4 ? #59
Comments
I got the very same problem here, using Windows 7 and Python 3.5 and git-cc 01a35a3a Traceback (most recent call last):
File "c:\program files (x86)\python35-32\lib\site-packages\git_cc\rebase.py", line 65, in doCommit
commit(cs)
File "c:\program files (x86)\python35-32\lib\site-packages\git_cc\rebase.py", line 148, in commit
cs.commit()
File "c:\program files (x86)\python35-32\lib\site-packages\git_cc\rebase.py", line 194, in commit
git_exec(['commit', '-m', comment.encode(ENCODING)], env=env)
File "c:\program files (x86)\python35-32\lib\site-packages\git_cc\common.py", line 77, in git_exec
return popen('git', cmd, GIT_DIR, encoding='UTF-8', **args)
File "c:\program files (x86)\python35-32\lib\site-packages\git_cc\common.py", line 86, in popen
debug('> ' + ' '.join(map(f, cmd)))
File "c:\program files (x86)\python35-32\lib\site-packages\git_cc\common.py", line 85, in <lambda>
f = lambda a: a if not a.count(' ') else '"%s"' % a
TypeError: a bytes-like object is required, not 'str'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Program Files (x86)\Python35-32\Scripts\gitcc-script.py", line 9, in <module>
load_entry_point('git-cc==1.0.1.dev0', 'console_scripts', 'gitcc')()
File "c:\program files (x86)\python35-32\lib\site-packages\git_cc\gitcc.py", line 25, in main
return invoke(cmd, args)
File "c:\program files (x86)\python35-32\lib\site-packages\git_cc\gitcc.py", line 50, in invoke
cmd.main(*args)
File "c:\program files (x86)\python35-32\lib\site-packages\git_cc\rebase.py", line 54, in main
doStash(lambda: doCommit(cs), stash)
File "c:\program files (x86)\python35-32\lib\site-packages\git_cc\common.py", line 68, in doStash
f()
File "c:\program files (x86)\python35-32\lib\site-packages\git_cc\rebase.py", line 54, in <lambda>
doStash(lambda: doCommit(cs), stash)
File "c:\program files (x86)\python35-32\lib\site-packages\git_cc\rebase.py", line 71, in doCommit
git_exec(['branch', '-f', CC_TAG])
File "c:\program files (x86)\python35-32\lib\site-packages\git_cc\common.py", line 77, in git_exec
return popen('git', cmd, GIT_DIR, encoding='UTF-8', **args)
File "c:\program files (x86)\python35-32\lib\site-packages\git_cc\common.py", line 92, in popen
raise Exception(decodeString(encoding, stderr + stdout))
Exception: fatal: Not a valid object name: 'master'. I suppose we suffer from a text-versus-binary-data issue; the argument should be a string but somehow it is "only" a byte array. |
Apparently, the problem is the call to git_exec(['commit', '-m', comment.encode(ENCODING)], env=env) In python3 this method of git_exec(['commit', '-m', comment], env=env) |
I've tried (badly) to make git-cc compatible with both 2.x and 3.x. I'm afraid my python knowledge was never very good. If removing the encoding works I'm happy to take it out. Another suggestion is to "decode" the bytes for the debugging in common.py which is where the current error seems to be. I should mention/warn you that I haven't used git-cc in years so I can't really test it. Sorry I can't be more help. :( |
While running gitcc rebase I get the below. When used python 2.7 all worked fine. As I didn't find somewhere that the project is python 2 specific I open this ticket. Let me know if it's not suppose to work on python 3.
The text was updated successfully, but these errors were encountered: