FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Cannot add utf8 path to repository · Issue #331 · gitpython-developers/GitPython · GitHub

Repository navigation

Cannot add utf8 path to repository  #331

Closed

Description

Running the code below on a Linux machine with PythonGit 1.0.1 fails, but works with PythonGit 0.3.2 RC1

Python version: 2.7.10

Output when using PythonGit 1.0.1:
1.0.1
Traceback (most recent call last):
File "corpustools/test/test_git.py", line 11, in
r.index.add(['ø.txt'])
File "/usr/local/lib/python2.7/dist-packages/git/index/base.py", line 780, in add
self.write(ignore_extension_data=not write_extension_data)
File "/usr/local/lib/python2.7/dist-packages/git/index/base.py", line 213, in write
self._serialize(stream, ignore_extension_data)
File "/usr/local/lib/python2.7/dist-packages/git/index/base.py", line 180, in _serialize
write_cache(entries, stream, extension_data)
File "/usr/local/lib/python2.7/dist-packages/git/index/fun.py", line 132, in write_cache
write(path.encode(defenc))
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 0: ordinal not in range(128)

Output when using PythonGit 0.3.2 RC1
0.3.2 RC1

This is the version that is installed by the distribution (Kubuntu 15.10)

# -*- coding:utf-8 -*-
import git
import testfixtures

print git.__version__

tempdir = testfixtures.TempDirectory(ignore=['.git'])
tempdir.makedir('orig/smj/ficti/sub')
tempdir.write('orig/smj/ficti/sub/ø.txt', 'content of ø')

r = git.Repo.init(tempdir.path)
r.index.add(['orig'])
r.index.commit('Added orig and prestable')

tempdir.cleanup()

Activity

  1. added this to the v1.0.2 - Fixes milestone on Jul 29, 2015
  2. Byron commented on Jul 30, 2015

    Member

    You can watch the development stream on youtube.

    GitPython #18 [issue 331 - adding strings with utf-8 characters in python 2]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions


      Back | FazBrowse Home | New Git URL