RE: Python 2.3 compatibility?

"Bauer, Georg" <[email protected]> Mon, 19 Jan 2004 11:22:22 +0100
Newsgroups gmane.comp.pythin.pyds.devel
Message-ID <[email protected]>
Hi!

> Thinking of doing that. 0.7.0 works just fine on the Windows 
> PC, without
> backup/restore. Just carrying the .PyDS directory intact 
> should work, I
> suppose?

Exactly! Actually data files even survive architecture changing: I directly
moved an installation from my OS X machine to a Linux box some month ago and
didn't need to change anything. And those two machines have different
endianess!

> Apologies. That was after I built 0.6.1 on Linux to see if it is a
> problem with PyDS 0.7.0 itself. The corresponding error messages for
> 0.7.0:
> 
>             PyDS.Tool._ToolNamespace['upstream']._restore(restore)
>           File 
> "/usr/lib/python2.3/site-packages/PyDS/UpstreamTool.py",
>         line 307, in _restore
>             if tool:
>           File "/usr/lib/python2.3/site-packages/PyDS/NuggetsTool.py",
>         line 261, in __getattr__
>             else: raise KeyError(name)
>         KeyError: '__nonzero__'

Yep, that's one of those weirdos. In lin 306 in UpstreamTool.py, the
variable tool is filled with an instance of StandardTool by a
getToolByNamespace call. The "if tool" line in Python 2.2 checks the fact
wether it's None or not-None. In 2.3 this was expanded and boolean checking
with class instances (even classic classes) seems allways to go through a
__nonzero__ method. That's not defined in class StandardTool and so this
problem happens. This thing (checking for boolean values with the value
either a None or a class instance) is done more often in the code, so this
might pose more problems. You could go around this by adding a __nonzero__
method that just returns 1 in Tool.py in the class StandardTool, but that's
not guaranteed to solve all problems like that.

This is all guessing on my side, as I currently don't have a python 2.3
running.

> This is slightly worrying; Fedora Core 2 will be out in April if it
> keeps its schedule, soon a lot of people will be running 2.3. Guess
> 'install everything in a local directory' remains an option..

Don't know about Fedora, but Debian (what is what I am using) happily
installs several python versions one beside the other. So my PyDS packages
will still work with Sarge, as Python 2.2 is still around - Debian only
changes the default meaning of the "python" command to point to the primary
release, but all other releases are still available. I have machines running
with Python 1.5, 2.0, 2.1 and 2.2 installed. Yep, that's sometimes weird,
but needed: at work I still run several production systems which rely on
Python 1.5!

> The Windows packager of PyDS has a package of PyDS compiled against
> Py2.3, I'm not going to touch the working PyDS install on my 

Yes, I know, but I am not that happy about that. I know that Windows and
MacOS X packages already use Python 2.3, but as it currently is, Python 2.3
for PyDS isn't fully tested and not approved by me, as I am _sure_ that
there are problems in the code. So if you use 2.3, and find bugs, I won't be
able to reliably fix them. I will include patches you send in my direction,
of course (as long as they don't break compatibility with Python 2.2, of
course).

When Debian Sarge is released (no guesses at when that will be the case, but
it might be march or april, I don't talk about the year though ;-) ), I will
most surely upgrade one of my machines and that will be the start of
"official" blessing of Python 2.3 for PyDS. But I am known for being a very
slow adopter of new releases ...

bye, Georg