Skip to content
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

Fail on errors? #43

Open
thijzert opened this issue Oct 3, 2011 · 2 comments
Open

Fail on errors? #43

thijzert opened this issue Oct 3, 2011 · 2 comments

Comments

@thijzert
Copy link

thijzert commented Oct 3, 2011

If an FTP error arrises, shouldn't the post-receive hook have an error exit status as well?
This would prevent half-uploaded wobsites that seem fine repository-wise.

@ezyang
Copy link
Owner

ezyang commented Oct 3, 2011

Yes. I'm a little confused why Python isn't zero exit status'ing on an exception.

@thijzert
Copy link
Author

thijzert commented Oct 3, 2011

I keep getting this error:

remote: Traceback (most recent call last):
remote:   File "/share/home/thijs/Documents/Programs/zzNIH/git-ftp/git-ftp.py", line 357, in <module>
remote:     main()
remote:   File "/share/home/thijs/Documents/Programs/zzNIH/git-ftp/git-ftp.py", line 107, in main
remote:     upload_diff(repo, oldtree, tree, ftp, base)
remote:   File "/share/home/thijs/Documents/Programs/zzNIH/git-ftp/git-ftp.py", line 278, in upload_diff
remote:     node = tree[file]
remote:   File "/usr/local/lib/python2.7/dist-packages/GitPython-0.3.2.RC1-py2.7.egg/git/objects/tree.py", line 237, in __getitem__
remote:     return self.__div__(item)
remote:   File "/usr/local/lib/python2.7/dist-packages/GitPython-0.3.2.RC1-py2.7.egg/git/objects/tree.py", line 172, in __div__
remote:     item = tree[token]
remote:   File "/usr/local/lib/python2.7/dist-packages/GitPython-0.3.2.RC1-py2.7.egg/git/objects/tree.py", line 237, in __getitem__
remote:     return self.__div__(item)
remote:   File "/usr/local/lib/python2.7/dist-packages/GitPython-0.3.2.RC1-py2.7.egg/git/objects/tree.py", line 186, in __div__
remote:     for info in self._cache:
remote:   File "/usr/local/lib/python2.7/dist-packages/gitdb-0.5.4-py2.7-linux-x86_64.egg/gitdb/util.py", line 238, in __getattr__
remote:     self._set_cache_(attr)
remote:   File "/usr/local/lib/python2.7/dist-packages/GitPython-0.3.2.RC1-py2.7.egg/git/objects/tree.py", line 145, in _set_cache_
remote:     self._cache = tree_entries_from_data(ostream.read())
remote:   File "/usr/local/lib/python2.7/dist-packages/GitPython-0.3.2.RC1-py2.7.egg/git/objects/fun.py", line 73, in tree_entries_from_data
remote:     name_enc = name.decode("utf-8")
remote:   File "/usr/lib/python2.7/encodings/utf_8.py", line 16, in decode
remote:     return codecs.utf_8_decode(input, errors, True)
remote: UnicodeDecodeError: 'utf8' codec can't decode byte 0xe9 in position 28: invalid continuation byte
To ../.Wobsite-remote.git
   3e136fb..4c6ffe9  master -> master

It's caused by an invalid filename somewhere in my tree.
Digging through the code reveals lots of try..except blocks, which would prevent an error exit status. However, as the stack trace is printed to the screen, it would appear that the failure correctly reaches "ground level". One would therefore expect this to be reflected in the exit status.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants