Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Python 3 compatibility #19
Comments
added a commit
that referenced
this issue
Jan 17, 2015
|
Fixed some easy issues. The most obvious items left are:
|
added a commit
that referenced
this issue
Jan 17, 2015
|
Replaced xrange, file, long, and cPickle as well. The iniparse library is a real pain including all StringIO, basestring, and the u prefix. Concerning the blueman code, we only have some usages of cmp (which is easy to replace), |
|
I have in my python3 branch fixes for The |
|
Nice. Concerning the u prefix, apart from the iniparse lib we only use it in apps/blueman-sendto. It's probably unnecessary as we don't use it anywhere else, but I'm not sure. |
|
Oh, I see, your branch is python 3 only, right? Since e.g. io.StringIO does not exist in python 2.7 I think. |
|
It should be compatible with 2 and 3, io module was added in 2.6. I am using this branch right now. However I like to test it a bit more before I send it off to master. Also Python3 does not allow |
|
You're right, io.StringIO works with 2.7 as well. |
|
Send a pull request for testing as things ended up being a bit large. |
|
Not looked at this but I am seeing maximum recursion.. Below repeats indefinitely. _________
Destroy (/usr/lib64/python3.3/site-packages/blueman/main/Device.py:98)
invalidating device None
Exception RuntimeError: 'maximum recursion depth exceeded while calling a Python object' in <bound method Device.__del__ of <Device object at 0x7fa5d7fe8d20 (blueman+main+Device+Device at 0x22e3ae0)>> ignored
_________
__del__ (/usr/lib64/python3.3/site-packages/blueman/main/Device.py:60)
deleting device None
_________
Destroy (/usr/lib64/python3.3/site-packages/blueman/main/Device.py:98)
invalidating device None
Exception RuntimeError: 'maximum recursion depth exceeded while calling a Python object' in <bound method Device.__del__ of <Device object at 0x7fa5d7fe8d20 (blueman+main+Device+Device at 0x22e3ae0)>> ignored
_________
__del__ (/usr/lib64/python3.3/site-packages/blueman/main/Device.py:60)
deleting device None
_________
Destroy (/usr/lib64/python3.3/site-packages/blueman/main/Device.py:98)
invalidating device None
Exception RuntimeError: 'maximum recursion depth exceeded while calling a Python object' in <bound method Device.__del__ of <Device object at 0x7fa5d7fe8d20 (blueman+main+Device+Device at 0x22e3ae0)>> ignored
_________ |
|
Looks like the recusion actually happens on line 120 when
Another exception I got looks like we potentially have a problem with any method call for the Cython module with char * arguments due to str vs. bytes.
We could either look at all usages or change the definitions in some way. The |
referenced
this issue
Mar 5, 2015
cschramm
modified the milestones:
2.0,
2.1
Mar 5, 2015
|
Any other known issues than the unicode type and cython str vs. bytes? |
|
It is one of those things that when you fix one thing three others show up I now added all the future imports in python2.7 and am working through all the problems now. I pushed these commits just now to my futurize if you are curious |
|
It is alive, #215 |
cschramm
closed this
Apr 12, 2015
Plaque-fcc
commented
Apr 12, 2015
|
Recursion? I got these on nearby devices discovery: Destroy They loop infinitely. It's there for a while, I later could report where it comes from, but And thanks in advance! |
|
@Plaque-fcc Probably the result of a previous error as in #19 (comment). Any exceptions in the output before that happens? |
|
@Plaque-fcc, I can not reproduce this with python 2.7 here on Gentoo. So you'll need to be more descriptive on the steps to reproduce. |
|
@Plaque-fcc, Do try https://github.com/infirit/blueman/tree/string_type (two commits) @cschramm, the new function string_type is a bit hacky but instead of sprinkling |
Plaque-fcc
commented
Apr 13, 2015
|
No, it feeds all the screen with this looping. ;D Actually, I'm back to git bisect on it. No steps to reproduce this, On Sun, 12 Apr 2015 23:45:35 -0700
|
|
@Plaque-fcc Don't run bisect as it is quite useless in this case. Plus I know which one you will end up with, it is 82b84ee. Try my commits in the string_type branch in my fork and see if that sort the problem out. |
Plaque-fcc
commented
Apr 13, 2015
No, I found that on e486d77 it And no, building from your repo/string_type doesn't prevent it from On Mon, 13 Apr 2015 05:23:46 -0700
|
@infirit I guess that means @Plaque-fcc You could redirect the output to less or a file or whatever to see what happens before the loop. |
|
@Plaque-fcc please apply the below debug patch and paste(bin) the output. @cschramm, yes which is weird because I only ever saw edit: I would expect some Exception to be thrown so I am confused diff --git a/blueman/main/Device.py b/blueman/main/Device.py
index dd45740..ad298ef 100644
--- a/blueman/main/Device.py
+++ b/blueman/main/Device.py
@@ -30,6 +30,10 @@ class Device(GObject.GObject):
self.Fake = True
self.Temp = False
+ dprint("***DEBUG***")
+ dprint(type(instance))
+ dprint(repr(instance))
+ dprint("***DEBUG END***")
if isinstance(instance, BluezDevice):
self.Device = instance
else: |
Plaque-fcc
commented
Apr 13, 2015
On top of infirit's branch: $ git diff
On Mon, 13 Apr 2015 08:20:47 -0700
|
I do as it is enlightening It is weird that this is a problem for you but not for me. But it is clear things go wrong when we see a |
|
Then it's probably BlueZ 4 vs. BlueZ 5. There shouldn't be any FakeDevice instances around when you have BlueZ 5. |
Plaque-fcc
commented
Apr 13, 2015
|
Ubuntu 14.10 x86, latest packages.
$ dpkg-query --show --showformat='${package} ${version} ${status} \n' bluez
bluez 4.101-0ubuntu20 install ok installed
|
|
@Plaque-fcc, please test #253 |
WhyNotHugo
commented
Apr 13, 2015
Hasn't bluez 4 been deprecated for some time now? I recall the move to bluez5 being over half a year ago. |
|
It is but BlueZ 5 breaks lots of things so they have been putting it off. AFAIK 15.04 will come with BlueZ 5. |
|
Yes, the Ubuntu guys are working on it, but honestly, it is 15.04 now. I have no idea how that shall make it into the release... Anyway, blueman currently supports both major versions, so issues with BlueZ 4 have to be dealt with. We'll drop that for 2.1 once 2.0 is finished. |
Plaque-fcc
commented
Apr 14, 2015
|
Yaaayy! Works!! ^_^ Than you! On Mon, 13 Apr 2015 09:27:07 -0700
|
|
Perfect, pushed the fix to master. Thanks for the report @Plaque-fcc. |
Plaque-fcc
commented
Apr 15, 2015
|
Always ready! And thanks for your immediate fix!
|
cschramm commentedNov 7, 2013
Currently the code should be compatible with
2.6 and2.7.Goal is to also make it compatible with
3.2+3.3+