Thread: [SQLObject] porting to python 3
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: Daniel F. <fet...@go...> - 2009-01-27 00:27:53
|
I've started to play with 2to3 and sqlobject 0.10.4. I haven't really converted anything yet, just noted that the following 2 issues need to be changed before a conversion can be successful (both are trivial): RefactoringTool: ### In file col.py ### RefactoringTool: Line 357: could not convert: raise '@@: figure out the exception for a delete' RefactoringTool: Python 3 does not support string exceptions RefactoringTool: Line 978: could not convert: raise "Enum type is not supported" RefactoringTool: Python 3 does not support string exceptions I'd say a simple Exception( '@@: figure out the exception for a delete' ) and Exception( 'Enum type is not supported' ) fix will be good enough. I'll report on any further progress I make on porting sqlobject to python 3. Cheers, Daniel -- Psss, psss, put it down! - http://www.cafepress.com/putitdown |
From: Oleg B. <ph...@ph...> - 2009-01-27 09:21:38
|
On Mon, Jan 26, 2009 at 04:27:47PM -0800, Daniel Fetchinson wrote: > I've started to play with 2to3 and sqlobject 0.10.4. I haven't really > converted anything yet, just noted that the following 2 issues need to > be changed before a conversion can be successful (both are trivial): > > RefactoringTool: ### In file col.py ### > RefactoringTool: Line 357: could not convert: raise '@@: figure out > the exception for a delete' > RefactoringTool: Python 3 does not support string exceptions > RefactoringTool: Line 978: could not convert: raise "Enum type is not supported" > RefactoringTool: Python 3 does not support string exceptions > > I'd say a simple Exception( '@@: figure out the exception for a delete' ) and > Exception( 'Enum type is not supported' ) fix will be good enough. > > I'll report on any further progress I make on porting sqlobject to python 3. Thank you!. That's easy to fix. Harder is to get Python DB API drivers - what DB API drivers are compiled for Py3k? sqlite? Even harder would be to convert SO to unicode-only. Oleg. -- Oleg Broytmann http://phd.pp.ru/ ph...@ph... Programmers don't die, they just GOSUB without RETURN. |
From: Daniel F. <fet...@go...> - 2009-01-27 09:28:24
|
>> I've started to play with 2to3 and sqlobject 0.10.4. I haven't really >> converted anything yet, just noted that the following 2 issues need to >> be changed before a conversion can be successful (both are trivial): >> >> RefactoringTool: ### In file col.py ### >> RefactoringTool: Line 357: could not convert: raise '@@: figure out >> the exception for a delete' >> RefactoringTool: Python 3 does not support string exceptions >> RefactoringTool: Line 978: could not convert: raise "Enum type is not >> supported" >> RefactoringTool: Python 3 does not support string exceptions >> >> I'd say a simple Exception( '@@: figure out the exception for a delete' ) >> and >> Exception( 'Enum type is not supported' ) fix will be good enough. >> >> I'll report on any further progress I make on porting sqlobject to python >> 3. > > Thank you!. That's easy to fix. Harder is to get Python DB API drivers > - what DB API drivers are compiled for Py3k? sqlite? Even harder would be > to convert SO to unicode-only. Martin van Loewis ported postgresql to python 3 and of course the python 3 distribution comes with sqlite. That's already two, actually the two that I ever would want to use :) So I'll go ahead and play with 2to3 more. I haven't thought about the unicode-only issue though. Cheers, Daniel -- Psss, psss, put it down! - http://www.cafepress.com/putitdown |
From: Oleg B. <ph...@ph...> - 2009-01-27 09:32:01
|
On Tue, Jan 27, 2009 at 01:28:18AM -0800, Daniel Fetchinson wrote: > Martin van Loewis ported postgresql to python 3 Which one? There are 3 or 4 DB API drivers for Pg; SO uses psycopg. Oleg. -- Oleg Broytmann http://phd.pp.ru/ ph...@ph... Programmers don't die, they just GOSUB without RETURN. |
From: Daniel F. <fet...@go...> - 2009-01-27 17:18:59
|
>> Martin van Loewis ported postgresql to python 3 > > Which one? There are 3 or 4 DB API drivers for Pg; SO uses psycopg. Yes, that one, see here: http://mail.python.org/pipermail/python-porting/2008-December/000004.html So I think it would be absolutely useful to think about porting SO, there are already 2 db API drivers available. Cheers, Daniel -- Psss, psss, put it down! - http://www.cafepress.com/putitdown |
From: Oleg B. <ph...@ph...> - 2009-01-27 17:32:08
|
On Tue, Jan 27, 2009 at 09:18:51AM -0800, Daniel Fetchinson wrote: > >> Martin van Loewis ported postgresql to python 3 > > > > Which one? There are 3 or 4 DB API drivers for Pg; SO uses psycopg. > > Yes, that one, see here: > > http://mail.python.org/pipermail/python-porting/2008-December/000004.html > > So I think it would be absolutely useful to think about porting SO, > there are already 2 db API drivers available. IWBN to find a better developer. I never was a good developer, I was a maintainer at best. And now I have even less time. Anybody wants to displace me? I am still an SO user, and I am still going to be a developer, just not a major one. Oleg. -- Oleg Broytmann http://phd.pp.ru/ ph...@ph... Programmers don't die, they just GOSUB without RETURN. |
From: Daniel F. <fet...@go...> - 2009-01-27 17:45:59
|
>> >> Martin van Loewis ported postgresql to python 3 >> > >> > Which one? There are 3 or 4 DB API drivers for Pg; SO uses psycopg. >> >> Yes, that one, see here: >> >> http://mail.python.org/pipermail/python-porting/2008-December/000004.html >> >> So I think it would be absolutely useful to think about porting SO, >> there are already 2 db API drivers available. > > IWBN to find a better developer. I never was a good developer, I was > a maintainer at best. And now I have even less time. > Anybody wants to displace me? I am still an SO user, and I am still > going to be a developer, just not a major one. I can't take on maintenance of SO unfortunately, but I'll try porting it and will happily submit any resulting patches. Also, are there major features that need to go into SO still? I mean wouldn't a bugfix, minor fix, maintenance mode be enough? It's a mature product already I suppose. It's better to dedicate time/effort to bugfixes and maintenance than implementing new features which are buggy due to lack of time of the developers. Cheers, Daniel -- Psss, psss, put it down! - http://www.cafepress.com/putitdown |
From: Oleg B. <ph...@ph...> - 2009-01-27 17:49:42
|
On Tue, Jan 27, 2009 at 09:45:54AM -0800, Daniel Fetchinson wrote: > I can't take on maintenance of SO unfortunately, but I'll try porting > it and will happily submit any resulting patches. You are welcome! > Also, are there major features that need to go into SO still? I mean > wouldn't a bugfix, minor fix, maintenance mode be enough? Even this is better than nothing! About new features: I will translate my TODO and post here for a discussion. Oleg. -- Oleg Broytmann http://phd.pp.ru/ ph...@ph... Programmers don't die, they just GOSUB without RETURN. |
From: Oleg B. <ph...@ph...> - 2009-09-30 15:56:40
|
On Mon, Jan 26, 2009 at 04:27:47PM -0800, Daniel Fetchinson wrote: > RefactoringTool: ### In file col.py ### > RefactoringTool: Line 357: could not convert: raise '@@: figure out > the exception for a delete' > RefactoringTool: Python 3 does not support string exceptions > RefactoringTool: Line 978: could not convert: raise "Enum type is not supported" > RefactoringTool: Python 3 does not support string exceptions Finally I fixed them in the trunk. Will be in version 0.12 soon. > I'd say a simple Exception( '@@: figure out the exception for a delete' ) and > Exception( 'Enum type is not supported' ) fix will be good enough. I made the first one RuntimeError and the second one TypeError. > I'll report on any further progress I make on porting sqlobject to python 3. Any progress? Oleg. -- Oleg Broytman http://phd.pp.ru/ ph...@ph... Programmers don't die, they just GOSUB without RETURN. |
From: Daniel F. <fet...@go...> - 2009-10-14 20:40:45
|
>> RefactoringTool: ### In file col.py ### >> RefactoringTool: Line 357: could not convert: raise '@@: figure out >> the exception for a delete' >> RefactoringTool: Python 3 does not support string exceptions >> RefactoringTool: Line 978: could not convert: raise "Enum type is not >> supported" >> RefactoringTool: Python 3 does not support string exceptions > > Finally I fixed them in the trunk. Will be in version 0.12 soon. Great! Does this mean that 0.12 aims to 2to3-able? >> I'd say a simple Exception( '@@: figure out the exception for a delete' ) >> and Exception( 'Enum type is not supported' ) fix will be good enough. > > I made the first one RuntimeError and the second one TypeError. +1 >> I'll report on any further progress I make on porting sqlobject to python >> 3. > > Any progress? Well, I didn't really do anything else than running the 2to3 script whose output I copied in the original post... Cheers, Daniel -- Psss, psss, put it down! - http://www.cafepress.com/putitdown |
From: Oleg B. <ph...@ph...> - 2009-10-14 21:06:08
|
On Wed, Oct 14, 2009 at 10:40:39PM +0200, Daniel Fetchinson wrote: > Great! Does this mean that 0.12 aims to 2to3-able? I don't know, I didn't switch even to 2.7 yet. Please report any problem. Oleg. -- Oleg Broytman http://phd.pp.ru/ ph...@ph... Programmers don't die, they just GOSUB without RETURN. |
From: Daniel F. <fet...@go...> - 2009-10-18 09:14:51
|
>> Great! Does this mean that 0.12 aims to 2to3-able? > > I don't know, I didn't switch even to 2.7 yet. Please report any > problem. I'm using 2to3 from trunk with python 2.6.1 and sqlobject 0.12b2 is 2to3-able. Lots of files need modification of course but apparently 2to3 could take care of all of them. I haven't run the test suite though, but this in itself is already promising. Cheers, Daniel -- Psss, psss, put it down! - http://www.cafepress.com/putitdown |
From: Oleg B. <ph...@ph...> - 2009-10-18 17:32:19
|
On Sun, Oct 18, 2009 at 11:14:40AM +0200, Daniel Fetchinson wrote: > I'm using 2to3 from trunk with python 2.6.1 and sqlobject 0.12b2 is > 2to3-able. Lots of files need modification of course but apparently > 2to3 could take care of all of them. I haven't run the test suite > though, but this in itself is already promising. Thank you for the report! Oleg. -- Oleg Broytman http://phd.pp.ru/ ph...@ph... Programmers don't die, they just GOSUB without RETURN. |