Open Thor77 opened 9 years ago
+1
+1
+1
+1
+1
If someone takes it upon themselves to upgrade this software, they should definitely update this thread. I know I'd be willing to lend a hand if someone got the project underway.
@forresthopkinsa opened pull request 84 with a few elementary steps undertaken. Mostly I just updated the setup.py to pull in up to date requirements and ran 2to3 over the project.
There's still some work to do, though as it stands it works in the project I use it for.
I'll also note, that until this project is updated properly, I've created gittle3 and pushed it to PyPI. So if your project needs gittle with Py3 support, try pip install gittle3.
I will happily demote that fork when this project is updated.
I've tried to test it, but I ran to an error: TypeError: a bytes-like object is required, not 'str'
Code:
from gittle import Gittle
repo_path = '/tmp/1gittle_bare'
repo_url = 'git://github.com/FriendCode/gittle.git'
repo = Gittle.clone(repo_url, repo_path)
Error
Traceback (most recent call last):
File "test.py", line 6, in <module>
repo = Gittle.clone(repo_url, repo_path)
File "/usr/local/lib/python3.5/dist-packages/gittle/gittle.py", line 457, in clone
local_repo = cls.init(local_path)
File "/usr/local/lib/python3.5/dist-packages/gittle/gittle.py", line 312, in init
repo = constructor(path)
File "/usr/local/lib/python3.5/dist-packages/dulwich/repo.py", line 885, in init
cls._init_maybe_bare(controldir, False)
File "/usr/local/lib/python3.5/dist-packages/dulwich/repo.py", line 869, in _init_maybe_bare
ret.refs.set_symbolic_ref("HEAD", "refs/heads/master")
File "/usr/local/lib/python3.5/dist-packages/dulwich/refs.py", line 545, in set_symbolic_ref
f.write(SYMREF + other + '\n')
TypeError: a bytes-like object is required, not 'str'
@VeeeneX
Does it still throw that error when cloning from a local repo? The error doesn't quite make sense; it seems to be that something went wrong in the Gittle-Dulwich interface, because Gittle.clone certainly does require a string... Right?
But try changing the arguments and see if it still throws it.
On Wed, Aug 17, 2016, 3:59 PM VeeeneX notifications@github.com wrote:
I've tried to test it, but I ran to an error: TypeError: a bytes-like object is required, not 'str'
Code:
from gittle import Gittle
repo_path = '/tmp/1gittle_bare' repo_url = 'git://github.com/FriendCode/gittle.git'
repo = Gittle.clone(repo_url, repo_path)
Error
Traceback (most recent call last): File "test.py", line 6, in
repo = Gittle.clone(repo_url, repo_path) File "/usr/local/lib/python3.5/dist-packages/gittle/gittle.py", line 457, in clone local_repo = cls.init(local_path) File "/usr/local/lib/python3.5/dist-packages/gittle/gittle.py", line 312, in init repo = constructor(path) File "/usr/local/lib/python3.5/dist-packages/dulwich/repo.py", line 885, in init cls._init_maybe_bare(controldir, False) File "/usr/local/lib/python3.5/dist-packages/dulwich/repo.py", line 869, in _init_maybe_bare ret.refs.set_symbolic_ref("HEAD", "refs/heads/master") File "/usr/local/lib/python3.5/dist-packages/dulwich/refs.py", line 545, in set_symbolic_ref f.write(SYMREF + other + '\n') TypeError: a bytes-like object is required, not 'str' — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/FriendCode/gittle/issues/63#issuecomment-240574923, or mute the thread https://github.com/notifications/unsubscribe-auth/AEOlAcXxksBCfCvP4ek4QCFS4EEluwhBks5qg5JWgaJpZM4DzOkf .
@forresthopkinsa Problem is with dependency gittle3 uses old Dulwich 0.9.7, which has 'wb' flag for opening files for python2
Dulwich is expecting bytes for most arguments, including ref names. This is
because Git is encoding-agnostic. Gittle is passing in a
On Thu, Aug 18, 2016 at 08:38:38AM -0700, Forrest Hopkins wrote:
@VeeeneX
Does it still throw that error when cloning from a local repo? The error doesn't quite make sense; it seems to be that something went wrong in the Gittle-Dulwich interface, because Gittle.clone certainly does require a string... Right?
But try changing the arguments and see if it still throws it.
On Wed, Aug 17, 2016, 3:59 PM VeeeneX notifications@github.com wrote:
I've tried to test it, but I ran to an error: TypeError: a bytes-like object is required, not 'str'
Code:
from gittle import Gittle
repo_path = '/tmp/1gittle_bare' repo_url = 'git://github.com/FriendCode/gittle.git'
repo = Gittle.clone(repo_url, repo_path)
Error
Traceback (most recent call last): File "test.py", line 6, in
repo = Gittle.clone(repo_url, repo_path) File "/usr/local/lib/python3.5/dist-packages/gittle/gittle.py", line 457, in clone local_repo = cls.init(local_path) File "/usr/local/lib/python3.5/dist-packages/gittle/gittle.py", line 312, in init repo = constructor(path) File "/usr/local/lib/python3.5/dist-packages/dulwich/repo.py", line 885, in init cls._init_maybe_bare(controldir, False) File "/usr/local/lib/python3.5/dist-packages/dulwich/repo.py", line 869, in _init_maybe_bare ret.refs.set_symbolic_ref("HEAD", "refs/heads/master") File "/usr/local/lib/python3.5/dist-packages/dulwich/refs.py", line 545, in set_symbolic_ref f.write(SYMREF + other + '\n') TypeError: a bytes-like object is required, not 'str' — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/FriendCode/gittle/issues/63#issuecomment-240574923, or mute the thread https://github.com/notifications/unsubscribe-auth/AEOlAcXxksBCfCvP4ek4QCFS4EEluwhBks5qg5JWgaJpZM4DzOkf .
You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/FriendCode/gittle/issues/63#issuecomment-240763505
Ah, that makes sense. Thanks guys
On Thu, Aug 18, 2016, 9:06 AM Jelmer Vernooij notifications@github.com wrote:
Dulwich is expecting bytes for most arguments, including ref names. This is because Git is encoding-agnostic. Gittle is passing in a
object, which in Python2 was a bytestring, but is a unicode string in Python 3. On Thu, Aug 18, 2016 at 08:38:38AM -0700, Forrest Hopkins wrote:
@VeeeneX
Does it still throw that error when cloning from a local repo? The error doesn't quite make sense; it seems to be that something went wrong in the Gittle-Dulwich interface, because Gittle.clone certainly does require a string... Right?
But try changing the arguments and see if it still throws it.
On Wed, Aug 17, 2016, 3:59 PM VeeeneX notifications@github.com wrote:
I've tried to test it, but I ran to an error: TypeError: a bytes-like object is required, not 'str'
Code:
from gittle import Gittle
repo_path = '/tmp/1gittle_bare' repo_url = 'git://github.com/FriendCode/gittle.git'
repo = Gittle.clone(repo_url, repo_path)
Error
Traceback (most recent call last): File "test.py", line 6, in
repo = Gittle.clone(repo_url, repo_path) File "/usr/local/lib/python3.5/dist-packages/gittle/gittle.py", line 457, in clone local_repo = cls.init(local_path) File "/usr/local/lib/python3.5/dist-packages/gittle/gittle.py", line 312, in init repo = constructor(path) File "/usr/local/lib/python3.5/dist-packages/dulwich/repo.py", line 885, in init cls._init_maybe_bare(controldir, False) File "/usr/local/lib/python3.5/dist-packages/dulwich/repo.py", line 869, in _init_maybe_bare ret.refs.set_symbolic_ref("HEAD", "refs/heads/master") File "/usr/local/lib/python3.5/dist-packages/dulwich/refs.py", line 545, in set_symbolic_ref f.write(SYMREF + other + '\n') TypeError: a bytes-like object is required, not 'str' — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub <https://github.com/FriendCode/gittle/issues/63#issuecomment-240574923 , or mute the thread < https://github.com/notifications/unsubscribe-auth/AEOlAcXxksBCfCvP4ek4QCFS4EEluwhBks5qg5JWgaJpZM4DzOkf
.
You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/FriendCode/gittle/issues/63#issuecomment-240763505
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/FriendCode/gittle/issues/63#issuecomment-240772279, or mute the thread https://github.com/notifications/unsubscribe-auth/AEOlAcmAx8456WtEhc-7g4mfin4p1sF_ks5qhILngaJpZM4DzOkf .
So, is there some workaround?
Specify a bytestring rather than a normal string in the Dulwich interface? Is that it?
On Thu, Aug 18, 2016, 9:25 AM VeeeneX notifications@github.com wrote:
So, is there some workaround?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/FriendCode/gittle/issues/63#issuecomment-240778034, or mute the thread https://github.com/notifications/unsubscribe-auth/AEOlAVRHaOUAPsngVEh1E-35TmBnxEwiks5qhIdpgaJpZM4DzOkf .
Yep, specifying a bytestring should be sufficient.
I welcome and would happily merge a PR to add Python3 support.
Great, will start working on that, if noone else wants to take it 👍
@Thor77 The last commit, based on @powellc 's PR, is the result of a 2to3 and some configuration. Start from there.
Gittle doesn't work at all with Python3, it would be very nice to get it working because its the best-looking git-libary for python i found so far.