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

fails for some reasons with unicode problems #34

Open
childnode opened this issue Sep 22, 2016 · 5 comments
Open

fails for some reasons with unicode problems #34

childnode opened this issue Sep 22, 2016 · 5 comments

Comments

@childnode
Copy link

ℹ️ current gitup dev@f7a060af

        Fetching originTraceback (most recent call last):
  File "/usr/local/bin/gitup", line 11, in <module>
    load_entry_point('gitup==0.4.dev0', 'console_scripts', 'gitup')()
  File "build/bdist.linux-x86_64/egg/gitup/script.py", line 137, in run
  File "build/bdist.linux-x86_64/egg/gitup/script.py", line 129, in main
  File "build/bdist.linux-x86_64/egg/gitup/update.py", line 254, in update_directories
  File "build/bdist.linux-x86_64/egg/gitup/update.py", line 240, in _dispatch
  File "build/bdist.linux-x86_64/egg/gitup/update.py", line 175, in _update_repository
  File "build/bdist.linux-x86_64/egg/gitup/update.py", line 78, in _fetch_remotes
  File "/usr/local/lib/python2.7/dist-packages/GitPython-2.0.8-py2.7.egg/git/remote.py", line 743, in fetch
    res = self._get_fetch_info_from_stderr(proc, progress)
  File "/usr/local/lib/python2.7/dist-packages/GitPython-2.0.8-py2.7.egg/git/remote.py", line 640, in _get_fetch_info_from_stderr
    finalize_process(proc, stderr=stderr_text)
  File "/usr/local/lib/python2.7/dist-packages/GitPython-2.0.8-py2.7.egg/git/util.py", line 155, in finalize_process
    proc.wait(**kwargs)
  File "/usr/local/lib/python2.7/dist-packages/GitPython-2.0.8-py2.7.egg/git/cmd.py", line 322, in wait
    stderr = force_bytes(stderr)
  File "/usr/lib/python2.7/dist-packages/gitdb/utils/encoding.py", line 16, in force_bytes
    return data.encode(encoding)
UnicodeEncodeError: 'ascii' codec can't encode character u'\xfc' in position 224: ordinal not in range(128)

perhaps related / answered by http://stackoverflow.com/questions/5760936

I'm not that in with python ;/

also I can't see any branch with umlauts
but indeed, there are many branches in the affected repo using git-flow scheme like feature/TICKET-882_Some_Short_Description, all of them or none matching with git branch -avv | grep "[^a-Z0-9\.\/_\-]"
Messages may indeed contain umlauts, but that should not be a problem anyway

@childnode
Copy link
Author

P.S: saw: repo was in state:

  • uncommitted but already staged change
  • git pull --ff-only returned ```Die Datenbank des Repositories wird für eine optimale Performance im
    Hintergrund komprimiert.
    Siehe "git help gc" für manuelles Aufräumen.
    error: Die letzte Ausführung von "gc run" enthielt die folgenden Meldungen.
    Bitte beheben Sie das Hauptproblem und löschen Sie .git/gc.log.
    Ein automatischer Cleanup wird nicht ausgeführt, bis diese Datei entfernt
    wurde.

warning: Es gibt zu viele unerreichbare lose Objekte; führen Sie 'git prune' aus, um diese zu löschen.```

@richardmodis
Copy link

I have the same issue (version: 0.5.dev0):

Traceback (most recent call last):
  File "/usr/local/bin/gitup", line 9, in <module>
    load_entry_point('gitup==0.5.dev0', 'console_scripts', 'gitup')()
  File "build/bdist.linux-x86_64/egg/gitup/script.py", line 137, in run
  File "build/bdist.linux-x86_64/egg/gitup/script.py", line 129, in main
  File "build/bdist.linux-x86_64/egg/gitup/update.py", line 254, in update_directories
  File "build/bdist.linux-x86_64/egg/gitup/update.py", line 240, in _dispatch
  File "build/bdist.linux-x86_64/egg/gitup/update.py", line 178, in _update_repository
  File "/usr/local/lib/python2.7/dist-packages/GitPython-2.1.5-py2.7.egg/git/repo/base.py", line 245, in heads
    return Head.list_items(self)
  File "/usr/local/lib/python2.7/dist-packages/GitPython-2.1.5-py2.7.egg/git/util.py", line 932, in list_items
    out_list.extend(cls.iter_items(repo, *args, **kwargs))
  File "/usr/local/lib/python2.7/dist-packages/GitPython-2.1.5-py2.7.egg/git/refs/symbolic.py", line 599, in _iter_items
    for path in sorted(rela_paths):
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc5 in position 44: ordinal not in range(128)

@glachancecmaisonneuve
Copy link

setting PYTHONIOENCODING (set PYTHONIOENCODING=utf8 for windows, export PYTHONIOENCODING=utf8 for linux) should fix the problem for both of you.

@childnode
Copy link
Author

childnode commented Feb 13, 2018

@glachancecmaisonneuve thanks for pointing out .. will try it on next fail ;)

regarding homebrew, I assume that might be set in general by the script beeing created? https://github.com/Homebrew/homebrew-core/blob/master/Formula/gitup.rb#L45

btw. seems to be related but fixed in the meantime: #25

@ogok
Copy link

ogok commented Oct 20, 2020

I have the same issue (version 0.5.1_3)

Traceback (most recent call last):
File "/usr/local/bin/gitup", line 33, in
sys.exit(load_entry_point('gitup==0.5.1', 'console_scripts', 'gitup')())
File "/usr/local/Cellar/gitup/0.5.1_3/libexec/lib/python3.9/site-packages/gitup/cli.py", line 146, in run
main()
File "/usr/local/Cellar/gitup/0.5.1_3/libexec/lib/python3.9/site-packages/gitup/cli.py", line 138, in main
update_directories(args.directories_to_update, args)
File "/usr/local/Cellar/gitup/0.5.1_3/libexec/lib/python3.9/site-packages/gitup/update.py", line 305, in update_directories
_dispatch(path, _update_repository, args)
File "/usr/local/Cellar/gitup/0.5.1_3/libexec/lib/python3.9/site-packages/gitup/update.py", line 283, in _dispatch
callback(Repo(path), name, args)
File "/usr/local/Cellar/gitup/0.5.1_3/libexec/lib/python3.9/site-packages/gitup/update.py", line 189, in _update_repository
_fetch_remotes(remotes, args.prune)
File "/usr/local/Cellar/gitup/0.5.1_3/libexec/lib/python3.9/site-packages/gitup/update.py", line 81, in _fetch_remotes
results = remote.fetch(progress=_ProgressMonitor(), prune=prune)
File "/usr/local/Cellar/gitup/0.5.1_3/libexec/lib/python3.9/site-packages/git/remote.py", line 789, in fetch
res = self._get_fetch_info_from_stderr(proc, progress)
File "/usr/local/Cellar/gitup/0.5.1_3/libexec/lib/python3.9/site-packages/git/remote.py", line 675, in _get_fetch_info_from_stderr
proc.wait(stderr=stderr_text)
File "/usr/local/Cellar/gitup/0.5.1_3/libexec/lib/python3.9/site-packages/git/cmd.py", line 402, in wait
stderr = force_bytes(stderr)
File "/usr/local/Cellar/gitup/0.5.1_3/libexec/lib/python3.9/site-packages/gitdb/utils/encoding.py", line 16, in force_bytes
return data.encode(encoding)
UnicodeEncodeError: 'ascii' codec can't encode character '\xe7' in position 228134: ordinal not in range(128)

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

4 participants