Alexander Fischer | 28 Sep 2009 21:48
Picon
Favicon

Support for python3

Hello,

i am currently writing a plugin for an irc bot, but this bot is written in python3. Will there be any support
for python3 in the near/middle future? The 2to3 script throws errors alot of errors :(

cu alex

p.s. imdbpy is pretty cool :) Used it for a kde plasmoid.

------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
Davide Alberani | 29 Sep 2009 12:58
Picon
Gravatar

Re: Support for python3

On Sep 28, Alexander Fischer <alexanderfischer@...> wrote:

> i am currently writing a plugin for an irc bot, but this bot is
> written in python3.

Woah!  So ahead of the times! ;-)  3.0 or 3.1?

> Will there be any support for python3 in the near/middle future? The
> 2to3 script throws errors alot of errors :(

Not so far, since I was always scared about the need to maintain
two separated versions.
Obviously it's my desire to support Python 3, and I'll look again
at the output of 2to3 (I did some tests about a year ago - it was
not THAT bad, if I remember correctly).

If you want to help, you're welcomed.  Basically I need an
explanation of what it's required to port IMDbPY to Python 3 and - even
more important - how the side-by-side development of the two
branches will continue (dropping Python 2.X is out of question).

This kind of discussions should take place in the imdbpy-devel
mailing list; please subscribe if you want to help:
  http://lists.sourceforge.net/lists/listinfo/imdbpy-devel

> p.s. imdbpy is pretty cool :) Used it for a kde plasmoid.

Happy to hear it. :-)
Can it be downloaded from somewhere?  I'd like to add it to the
list of IMDbPY-based programs.
(Continue reading)

Alexander Fischer | 29 Sep 2009 15:18

Fwd: Re: [Imdbpy-help] Support for python3

Forwarded message from imdbpy-users to continue this thread in imdby-devel

> On Sep 28, Alexander Fischer <alexanderfischer@...> wrote:
>
>> i am currently writing a plugin for an irc bot, but this bot is
>> written in python3.
>Woah!  So ahead of the times! ;-)  3.0 or 3.1?
>
>> Will there be any support for python3 in the near/middle future? The
>> 2to3 script throws errors alot of errors :(
>Not so far, since I was always scared about the need to maintain
> two separated versions.
> Obviously it's my desire to support Python 3, and I'll look again
> at the output of 2to3 (I did some tests about a year ago - it was
> not THAT bad, if I remember correctly).
>If you want to help, you're welcomed.  Basically I need an
> explanation of what it's required to port IMDbPY to Python 3 and - even
> more important - how the side-by-side development of the two
> branches will continue (dropping Python 2.X is out of question).
>This kind of discussions should take place in the imdbpy-devel
> mailing list; please subscribe if you want to help:
>    http://lists.sourceforge.net/lists/listinfo/imdbpy-devel
>
>> p.s. imdbpy is pretty cool :) Used it for a kde plasmoid.
>Happy to hear it. :-)
> Can it be downloaded from somewhere?  I'd like to add it to the
> list of IMDbPY-based programs.
>Bye!
>

(Continue reading)

Davide Alberani | 29 Sep 2009 18:25
Picon
Gravatar

Re: Fwd: Re: [Imdbpy-help] Support for python3

On Sep 29, Alexander Fischer
<alexanderfischer@...> wrote:

> So, i am interested in 3.1 because 3.0 series is no more maintained.

Makes sense.

> A possible solution for the problem with maintaining 2 versions
> (which would really suck) of IMDbpy would be perhaps to bring the
> python2 version in a state, where the 2to3 script runs fine?

I suppose this is the way to go.

> I'll take a lot at the source at the weekend,

If you're brave enough. :-)
Not all the code is in a decent state, unfortunately.

> I currently don't know all changed in detail.

I can foresee some problems:
- for some good reasons we defined our own __contains__, __getitem__
  and has_key methods, in the imdb.utils._Container class, which more
  or less emulates a dictionary.
  If 2to3 replaces has_key calls with the 'x in d' syntax, we can
  face some problems (our has_key/__getitem__ and __contains__ methods
  work on different sets of data).
- we heavily depend on third-party packages: BeautifulSoup (included
  in IMDbPY), lxml, SQLObject and/or SQLAlchemy.
  I fear that none of these is Python3-ready, but I may be wrong.
(Continue reading)

H. Turgut Uyar | 30 Sep 2009 12:52
Picon
Favicon

Re: Fwd: Re: [Imdbpy-help] Support for python3

On 09/29/2009 07:25 PM, Davide Alberani wrote:
> - we heavily depend on third-party packages: BeautifulSoup (included
>   in IMDbPY), lxml, SQLObject and/or SQLAlchemy.

lxml can be compiled using Python 3 and can be imported but I got an
error message during compilation and can't say how reliable it is.

BeautifulSoup 3.x can be imported after running 2to3 on it. The
documentation says it works, but I didn't have the time to check. It
switched from SGMLParser to HTMLParser and that did not play well with
the IMDbPY parsers, IIRC.

SQLAlchemy and SQLObject do not seem to be compatible with Python 3
though I remember reading somewhere that the next version of SQLAlchemy
would be.

--

-- 
H. Turgut Uyar <uyar@...> [PGP KeyID: 0xEAF45FB8]
http://www3.itu.edu.tr/~uyar/

------------------------------------------------------------------------------
Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9&#45;12, 2009. Register now&#33;
http://p.sf.net/sfu/devconf
Davide Alberani | 30 Sep 2009 20:24
Picon
Gravatar

Re: Fwd: Re: [Imdbpy-help] Support for python3

On Sep 30, "H. Turgut Uyar" <uyar@...> wrote:

> lxml can be compiled using Python 3 and can be imported but I got
> an error message during compilation and can't say how reliable it is.
> 
> BeautifulSoup 3.x can be imported after running 2to3 on it.

Wonderful!  Thanks for the tests.

> The documentation says it works, but I didn't have the time to
> check. It switched from SGMLParser to HTMLParser and that did not
> play well with the IMDbPY parsers, IIRC.

True, but maybe the problems are hidden by BeautifulSoup itself.

> SQLAlchemy and SQLObject do not seem to be compatible with Python
> 3 though I remember reading somewhere that the next version of
> SQLAlchemy would be.

Yes - I guess SQLObject will not survive the switch to 3.0.

I hope I can do some tests within a week or so.

Thanks!
--

-- 
Davide Alberani <davide.alberani@...> [GPG KeyID: 0x465BFD47]
http://erlug.linux.it/~da/

------------------------------------------------------------------------------
Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
(Continue reading)

Davide Alberani | 30 Sep 2009 22:23
Picon
Gravatar

Re: Fwd: Re: [Imdbpy-help] Support for python3

On Sep 30, Davide Alberani <davide.alberani@...> wrote:

> > The documentation says it works, but I didn't have the time to
> > check. It switched from SGMLParser to HTMLParser and that did not
> > play well with the IMDbPY parsers, IIRC.
> 
> True, but maybe the problems are hidden by BeautifulSoup itself.

No, I see your point - this will probably create some problem.
By the way, even the ConfigParser is gone, in Python 3.x, so
there are some modules that need to be replaced. :-/

--

-- 
Davide Alberani <davide.alberani@...> [GPG KeyID: 0x465BFD47]
http://erlug.linux.it/~da/

------------------------------------------------------------------------------
Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9&#45;12, 2009. Register now&#33;
http://p.sf.net/sfu/devconf
Davide Alberani | 1 Oct 2009 18:00
Picon
Gravatar

Re: Fwd: Re: [Imdbpy-help] Support for python3

On Sep 30, Davide Alberani <davide.alberani@...> wrote:

> No, I see your point - this will probably create some problem.

>From a very fast test, I can say that ConfigParser is not a
problem, being present as the configparser module; the urllib.FancyURLopener
class was moved to urllib.request.FancyURLopener and its 'read' method
doesn't take the 'size' parameter anymore.

There are some issues with bytes/strings (unicodes) here and there
but nothing too relevant (or better: they must be fixed, right now I
have only worked around the various problems to make it work).

I can confirm that lxml compiles and works.

There's hope, but it's not an easy task.

--

-- 
Davide Alberani <davide.alberani@...> [GPG KeyID: 0x465BFD47]
http://erlug.linux.it/~da/

------------------------------------------------------------------------------
Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9&#45;12, 2009. Register now&#33;
http://p.sf.net/sfu/devconf
Alexander Fischer | 29 Sep 2009 17:50
Picon
Favicon

Re: Fwd: Re: [Imdbpy-help] Support for python3

Am 29.09.2009, 15:18 Uhr, schrieb Alexander Fischer  
<alexanderfischer@...>:

> Forwarded message from imdbpy-users to continue this thread in  
> imdby-devel
>
>> On Sep 28, Alexander Fischer <alexanderfischer@...> wrote:
>>
>>> i am currently writing a plugin for an irc bot, but this bot is
>>> written in python3.
>> Woah!  So ahead of the times! ;-)  3.0 or 3.1?
>>
>>> Will there be any support for python3 in the near/middle future? The
>>> 2to3 script throws errors alot of errors :(
>> Not so far, since I was always scared about the need to maintain
>> two separated versions.
>> Obviously it's my desire to support Python 3, and I'll look again
>> at the output of 2to3 (I did some tests about a year ago - it was
>> not THAT bad, if I remember correctly).
>> If you want to help, you're welcomed.  Basically I need an
>> explanation of what it's required to port IMDbPY to Python 3 and - even
>> more important - how the side-by-side development of the two
>> branches will continue (dropping Python 2.X is out of question).
>> This kind of discussions should take place in the imdbpy-devel
>> mailing list; please subscribe if you want to help:
>>    http://lists.sourceforge.net/lists/listinfo/imdbpy-devel
>>
>>> p.s. imdbpy is pretty cool :) Used it for a kde plasmoid.
>> Happy to hear it. :-)
>> Can it be downloaded from somewhere?  I'd like to add it to the
(Continue reading)

H. Turgut Uyar | 30 Sep 2009 12:55
Picon
Favicon

Re: Fwd: Re: [Imdbpy-help] Support for python3

On 09/29/2009 06:50 PM, Alexander Fischer wrote:
> I hope this is all, what setuptools do. There is no python3 version of  
> setuptools yet.
> 

If you need it, the Distribute project is a drop-in replacement for
setuptools and recently started supporting Python 3:

http://pypi.python.org/pypi/distribute

--

-- 
H. Turgut Uyar <uyar@...> [PGP KeyID: 0xEAF45FB8]
http://www3.itu.edu.tr/~uyar/

------------------------------------------------------------------------------
Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9&#45;12, 2009. Register now&#33;
http://p.sf.net/sfu/devconf

Gmane