8000 "TypeError: decode() takes no keyword arguments" on Python 2.6 · Issue #457 · gitpython-developers/GitPython · GitHub
[go: up one dir, main page]

Skip to content
"TypeError: decode() takes no keyword arguments" on Python 2.6 #457
Closed
@andy-maier

Description

@andy-maier

The change in commit 79c99c0 specifies the errors argument of decode() as a keyword argument. Support for keyword arguments in decode() was added only in Python 2.7. This causes this code to raise:

TypeError: decode() takes no keyword arguments

on Python 2.6.

This occurs for example on line 2297 of this Travis run.

Specifying the errors argument in the decode() invocations in git/objects/commit.py as a positional argument resolves this. For example, line 504 is currently:

parse_actor_and_date(author_line.decode(self.encoding, errors='replace'))

and should be, to resolve this:

parse_actor_and_date(author_line.decode(self.encoding, 'replace'))

This applies to the three places that were changed by commit 79c99c0.
I verified that the proposed change works on Python 2.6, 2.7, 3.4, 3.5.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0