Skip to content

Invalid syntax in python 3.2 #477

@jamazerto

Description

@jamazerto

Hi, I use python 3.2.3 on a raspberry pi with raspbian wheezy (so unfortunately I can not easily upgrade to a more recent version of python).
When I try to import git I get

>>> import git
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.2/dist-packages/git/__init__.py", line 35, in <module>
    from git.config import GitConfigParser
  File "/usr/local/lib/python3.2/dist-packages/git/config.py", line 21, in <module>
    from git.util import LockFile
  File "/usr/local/lib/python3.2/dist-packages/git/util.py", line 368
    return u'<git.Actor "%s <%s>">' % (self.name, self.email)

Probably something to do with python 3.2 not supporting the u'my_string' syntax.

Activity

added this to the v2.0.6 - Bugfixes milestone on Jun 20, 2016
Byron

Byron commented on Jun 20, 2016

@Byron
Member

That's a tough one, as GitPython uses it all over it's test-suite as well. As we provide support for python 2.6 only on a best-effort basis, this would be the point where I wouldn't know how to make that work at all.

Maybe a punctual fix could help already ... and as the spot is nicely testable, it should be relatively easy as well.

barry-scott

barry-scott commented on Aug 1, 2016

@barry-scott
Contributor

nvie, You really need to get on to python 3.3 as the oldest usable python 3.
All before 3.3 have serious issues.

Byron, I suggest that you refuse to support 3.2.

nvie

nvie commented on Aug 1, 2016

@nvie
Contributor

Agreed, I'd even go so far as to say: only formally support 3.5, and let 3.3 and 3.4 be supported in a best-effort way only. (Just like we did with Python 2.6.)

barry-scott

barry-scott commented on Aug 1, 2016

@barry-scott
Contributor

@nvie Oh I meant to address my comment to @jamazerto .

I have found that with my projects, pysvn, PyCXX etc that 3.3 and up has been easy to support.
All the big ticket changes happened at 3.3. Stuff added to 3.4 and 3.5 are good incremental improvements, but I don't recall fundamentals changing since 3.3. The nice to haves like pathlib and os.scandir I do not think matter to GitPython (and can be emulated or backported it needed).

jamazerto

jamazerto commented on Aug 1, 2016

@jamazerto
Author

Well I tried to use this on a raspbian wheezy so it comes with python 3.2 and I could install this project with pip without problems (if I recall correctly) but if supporting 3.2 is to complicated (and I understand it would be) than just say you don't support python 3.2 anymore and I would consider this to be resolved.
I will use a more recent version of raspbian with a more recent version of python.

Byron

Byron commented on Aug 2, 2016

@Byron
Member

Actually I found something that could help here - I will push the fix right away.

Byron

Byron commented on Aug 2, 2016

@Byron
Member

Oh, I read a bit further just to realize that this flag doesn't actually add support of the u'' unicode literals, but will turn all string literals into unicode indiscriminately. As such, it is useless as a quick-fix at least.

ankostis

ankostis commented on Oct 11, 2016

@ankostis
Contributor

(I'm sorry @barry-scott) I also suggest not to fix this - python-3.2 is so outdated that it should not be a valid target for any library - particularly the u"" problem is a known hassle impossible very ugly to overcome when writting PY2/3 compatible code.

barry-scott

barry-scott commented on Oct 11, 2016

@barry-scott
Contributor

@Byron do you want to just close this wont-fix?

Byron

Byron commented on Oct 16, 2016

@Byron
Member

Happily !

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

        Participants

        @Byron@nvie@ankostis@jamazerto@barry-scott

        Issue actions

          Invalid syntax in python 3.2 · Issue #477 · gitpython-developers/GitPython