← Back to team overview

dulwich-users team mailing list archive

Re: Python 3 compatibility

 

Hi Lele,

On Thu, Dec 03, 2015 at 11:38:36AM +0100, Lele Gaifax wrote:
> I'd like to contribute some time to the Python 3 compatibility effort.
Just to clarify - Dulwich supports Python 3, except for the C modules.

> I spent a couple of hours adapting the C submodules to the Py3 API, and the
> result is visible in my https://github.com/lelit/dulwich/tree/py3-c-modules
> branch [*].
Cool, thanks!

> I took the (naive) initial approach of treating all strings as bytes, that I
> guess is the right thing to do with the blobs of content, but possibly wrong
> when dealing with pathnames.

> As expected, this brought out several issues, mainly related to the stricter
> distinction between bytes and (unicode) strings under Python 3:
> 
>     Ran 1048 tests in 31.677s
> 
>     FAILED (failures=57, errors=20, skipped=132)
> 
> Some of the issues are within the unit tests, other are at a deeper level.
> 
> I know that the topic has been already faced on this ML: since it has been
> over a year ago, I would like to recollect the consensum on how this should
> proceed. In particular, I need to better understand how pathnames should be
> handled.
pathnames should be bytestrings, as Git itself also treats paths as
merely bytestrings. It does not have a mandated encoding.

This is the same as we already do for pure Python.

> [*] I also pushed a tiny fix in my master branch that applies to Py2 as well
Can you propose that to Dulwich' master as a separate pull request?

Cheers,

Jelmer


Follow ups

References