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

Unable to upload files named by multibyte characters #59

Open
japboy opened this issue Apr 16, 2012 · 2 comments
Open

Unable to upload files named by multibyte characters #59

japboy opened this issue Apr 16, 2012 · 2 comments

Comments

@japboy
Copy link

japboy commented Apr 16, 2012

My repository has a file named in Japanese こんにちは.txt and I got an error while git-ftp was trying to upload the file via FTP:

$ git push origin
Counting objects: 5, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 331 bytes, done.
Total 3 (delta 1), reused 0 (delta 0)
remote: INFO: Using .git/ftpdata
remote: INFO: Base directory is /htdocs/ftp
remote: INFO: Uploading Hello.txt
remote: Traceback (most recent call last):
remote:   File "/usr/local/bin/git-ftp", line 364, in <module>
remote:     main()
remote:   File "/usr/local/bin/git-ftp", line 114, in main
remote:     upload_diff(repo, oldtree, tree, ftp, base)
remote:   File "/usr/local/bin/git-ftp", line 285, in upload_diff
remote:     node = tree[file]
remote:   File "/usr/local/python/lib/python2.7/site-packages/git/objects/tree.py", line 237, in __getitem__
remote:     return self.__div__(item)
remote:   File "/usr/local/python/lib/python2.7/site-packages/git/objects/tree.py", line 190, in __div__
remote:     raise KeyError( msg % file )
remote: KeyError: 'Blob or Tree named \'"\\\\343\\\\201\\\\223\\\\343\\\\202\\\\223\\\\343\\\\201\\\\253\\\\343\\\\201\\\\241\\\\343\\\\201\\\\257.txt"\' not found'
To [email protected]:git/sandbox.git
   e867eb3..21b1e92  master -> master

I hope this will be fixed. Thanks in advance.

@ezyang
Copy link
Owner

ezyang commented Apr 17, 2012

This sounds like a tricky bug to diagnose; there are lots of places where the failure has happened. It might take a while for me to find a fix.

@peteruhnak
Copy link
Contributor

GitPython uses UTF-8 for paths, maybe we can enforce it:
… status, file = line.split("\t", 1) file = unicode(file, 'UTF-8') …

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

3 participants