Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > huge amounts of pure Python code broken by Python 2.5?

Reply
Thread Tools

huge amounts of pure Python code broken by Python 2.5?

 
 
Steven Bethard
Guest
Posts: n/a
 
      02-06-2007
Jean-Paul Calderone <> wrote:
> Huge amounts of my pure Python code was broken by Python 2.5.


Interesting. Could you give a few illustrations of this? (I didn't run
into the same problem at all, so I'm curious.)

Steve
 
Reply With Quote
 
 
 
 
Larry Bates
Guest
Posts: n/a
 
      02-06-2007
Steven Bethard wrote:
> Jean-Paul Calderone <> wrote:
>> Huge amounts of my pure Python code was broken by Python 2.5.

>
> Interesting. Could you give a few illustrations of this? (I didn't run
> into the same problem at all, so I'm curious.)
>
> Steve



I can't think of any of my code that got broken and it fixed a
broken SSL problem (on Windows) that I was fighting.

-Larry
 
Reply With Quote
 
 
 
 
John Roth
Guest
Posts: n/a
 
      02-06-2007
On Feb 6, 8:40 am, Steven Bethard <steven.beth...@gmail.com> wrote:
> Jean-Paul Calderone <exar...@divmod.com> wrote:
>
> > Huge amounts of my pure Python code was broken by Python 2.5.

>
> Interesting. Could you give a few illustrations of this? (I didn't run
> into the same problem at all, so I'm curious.)
>
> Steve



At a guess, the most likely thing to break code in job lots in 2.5 was
the change in default coding from latin-1 (or whatever the
installation has the default set to) to ascii.

This would have a tendency to break most modules that depended on the
default source coding. Fortunately, the fix is (not quite trivially)
easy - just scan the library and put the right coding comment in the
front.

John Roth

 
Reply With Quote
 
Gabriel Genellina
Guest
Posts: n/a
 
      02-06-2007
"John Roth" <> escribió en el mensaje
news: ups.com...
> On Feb 6, 8:40 am, Steven Bethard <steven.beth...@gmail.com> wrote:
>> Jean-Paul Calderone <exar...@divmod.com> wrote:
>>
>> > Huge amounts of my pure Python code was broken by Python 2.5.

>>
>> Interesting. Could you give a few illustrations of this? (I didn't run
>> into the same problem at all, so I'm curious.)
>>

>
> At a guess, the most likely thing to break code in job lots in 2.5 was
> the change in default coding from latin-1 (or whatever the
> installation has the default set to) to ascii.


And that has given a warning since 2.3...

--
Gabriel Genellina


 
Reply With Quote
 
John Nagle
Guest
Posts: n/a
 
      02-06-2007
Steven Bethard wrote:
> Jean-Paul Calderone <> wrote:
> > Huge amounts of my pure Python code was broken by Python 2.5.

>
> Interesting. Could you give a few illustrations of this? (I didn't run
> into the same problem at all, so I'm curious.)
>
> Steve


I'd like to know, too. I have the same code running in 2.4 and 2.5,
and I've had the following problems:

1. Bug [ 1651995 ] sgmllib _convert_ref UnicodeDecodeError exception,
new in 2.5
(a patch to sgmllib._convert_ref appears to have broken something)
(This might be the switch from Latin-1 to ascii as default, now that
I think about it.)

2. MySQLdb isn't fully supported for Python 2.5 yet, and there's no tested
Windows executable available, although there's an untested version from
a World of Warcraft guild available.

3. M2Crypto has versioning issues between Python, SWIG, gcc, and OpenSSL,
and getting everything to play together can be difficult. This is
a packaging issue; major Linux distros aren't shipping a compatible set of
components.

But my own pure Python code is working fine in both version of Python,
and on both Windows and Linux.

John Nagle
 
Reply With Quote
 
skip@pobox.com
Guest
Posts: n/a
 
      02-06-2007

John> MySQLdb isn't fully supported for Python 2.5 yet, and there's no
John> tested Windows executable available, although there's an untested
John> version from a World of Warcraft guild available.

As Andy Dustman has pointed out a number of times, he doesn't do Windows.
Someone in the MySQLdb community who does use Windows is going to have to
fill that void.

Skip
 
Reply With Quote
 
Michele Simionato
Guest
Posts: n/a
 
      02-07-2007
On Feb 6, 4:40 pm, Steven Bethard <steven.beth...@gmail.com> wrote:
> Jean-Paul Calderone <exar...@divmod.com> wrote:
>
> > Huge amounts of my pure Python code was broken by Python 2.5.

>
> Interesting. Could you give a few illustrations of this? (I didn't run
> into the same problem at all, so I'm curious.)
>
> Steve


I have seen breakage in Zope, due to the switch from old-style
exceptions to new-style
exceptions.

Michele Simionato

 
Reply With Quote
 
Robin Becker
Guest
Posts: n/a
 
      02-07-2007
wrote:
> John> MySQLdb isn't fully supported for Python 2.5 yet, and there's no
> John> tested Windows executable available, although there's an untested
> John> version from a World of Warcraft guild available.
>
> As Andy Dustman has pointed out a number of times, he doesn't do Windows.
> Someone in the MySQLdb community who does use Windows is going to have to
> fill that void.

.......

well I have managed to build both extant versions (MySQL-python-1.2.1_p2 &
MySQL-python-1.2.2b2) from source with the aid of Mr Dustman's comments in the
site.cfg files and a very minor hack to the earlier version. I had to have the
sources for Mysql available as well, but that probably comes with the territory.
It seems the very latest version won't play well with earlier MySQL so I used
MySQL-python-1.2.1_p2 as we are still using some 4.0.27 databases.

Given that I used a particular version of MySQL, 5.0.33, to build against I'm
not certain that my builds are useful for everyone. I copy here the differences
I had to make to the source to get stuff to build and run against stock win32
Python-2.5

#############MySQL-python-1.2.1_p2
diff -r -c MySQL-python-1.2.1_p2\_mysql.c \tmp\MySQL-python-1.2.1_p2\_mysql.c
*** MySQL-python-1.2.1_p2\_mysql.c Wed Apr 05 18:55:44 2006
--- \tmp\MySQL-python-1.2.1_p2\_mysql.c Fri Jan 26 14:01:49 2007
***************
*** 2767,2772 ****
--- 2767,2775 ----
return e;
}

+ #define QUOTE(X) _QUOTE(X)
+ #define _QUOTE(X) #X
+
static char _mysql___doc__[] =
"an adaptation of the MySQL C API (mostly)\n\
\n\
***************
*** 2801,2811 ****

if (!(dict = PyModule_GetDict(module))) goto error;
if (PyDict_SetItemString(dict, "version_info",
! PyRun_String(version_info, Py_eval_input,
dict, dict)))
goto error;
if (PyDict_SetItemString(dict, "__version__",
! PyString_FromString(__version__)))
goto error;
if (PyDict_SetItemString(dict, "connection",
(PyObject *)&_mysql_ConnectionObject_Type))
--- 2804,2814 ----

if (!(dict = PyModule_GetDict(module))) goto error;
if (PyDict_SetItemString(dict, "version_info",
! PyRun_String(QUOTE(version_info), Py_eval_input,
dict, dict)))
goto error;
if (PyDict_SetItemString(dict, "__version__",
! PyString_FromString(QUOTE(__version__))))
goto error;
if (PyDict_SetItemString(dict, "connection",
(PyObject *)&_mysql_ConnectionObject_Type))
diff -r -c MySQL-python-1.2.1_p2\site.cfg \tmp\MySQL-python-1.2.1_p2\site.cfg
*** MySQL-python-1.2.1_p2\site.cfg Sun Apr 02 18:16:50 2006
--- \tmp\MySQL-python-1.2.1_p2\site.cfg Fri Jan 26 13:48:32 2007
***************
*** 16,28 ****

[compiler]
#mysql_root: /usr/local/mysql
! #library_dirs: %(mysql_root)s/lib
! #include_dirs: %(mysql_root)s/include
! #libraries: mysqlclient
! # zlib
! # msvcrt
! # libcmt
! # wsock32
! # advapi32
#extra_compile_args:
! #extra_objects:
--- 16,28 ----

[compiler]
#mysql_root: /usr/local/mysql
! library_dirs: \tmp\mysql-5.0.33\lib_release
! include_dirs: \tmp\mysql-5.0.33\include
! libraries: mysqlclient
! zlib
! wsock32
! advapi32
! #msvcrt
! #libcmt
#extra_compile_args:
! extra_objects: /NODEFAULTLIB:MSVCRT

#############MySQL-python-1.2.2b2
diff -r -c MySQL-python-1.2.2b2\site.cfg \tmp\MySQL-python-1.2.2b2\site.cfg
*** MySQL-python-1.2.2b2\site.cfg Wed Apr 05 02:47:02 2006
--- \tmp\MySQL-python-1.2.2b2\site.cfg Wed Jan 17 15:17:59 2007
***************
*** 16,28 ****

[compiler]
#mysql_root: /usr/local/mysql
! #library_dirs: %(mysql_root)s/lib
! #include_dirs: %(mysql_root)s/include
! #libraries: mysqlclient
! # zlib
! # msvcrt
! # libcmt
! # wsock32
! # advapi32
#extra_compile_args:
! #extra_objects:
--- 16,28 ----

[compiler]
#mysql_root: /usr/local/mysql
! library_dirs: \tmp\mysql-5.0.33\lib_release
! include_dirs: \tmp\mysql-5.0.33\include
! libraries: mysqlclient
! zlib
! wsock32
! advapi32
! #msvcrt
! #libcmt
#extra_compile_args:
! extra_objects: /NODEFAULTLIB:MSVCRT


--
Robin Becker

 
Reply With Quote
 
Klaas
Guest
Posts: n/a
 
      02-09-2007
On Feb 6, 11:07 am, Jean-Paul Calderone <exar...@divmod.com> wrote:
> On Tue, 06 Feb 2007 08:40:40 -0700, Steven Bethard <steven.beth...@gmail.com> wrote:
> >Jean-Paul Calderone <exar...@divmod.com> wrote:
> > > Huge amounts of my pure Python code was broken by Python 2.5.

>
> >Interesting. Could you give a few illustrations of this? (I didn't run
> >into the same problem at all, so I'm curious.)

>
> There are about half a dozen examples linked from here:
>
> http://twistedmatrix.com/trac/ticket/1867
>
> Check out the closed ticket linked from there or the changesets for more
> detail.


The changes listed dont' seem particularly huge considering the size,
complexity, and boundary-pushingness of Twisted, coupled with the
magnitude of the 2.5 release.

-Mike

 
Reply With Quote
 
kernel1983
Guest
Posts: n/a
 
      02-09-2007
On Feb 9, 10:29 am, "Klaas" <mike.kl...@gmail.com> wrote:
> On Feb 6, 11:07 am, Jean-Paul Calderone <exar...@divmod.com> wrote:
>
> > On Tue, 06 Feb 2007 08:40:40 -0700, Steven Bethard <steven.beth...@gmail.com> wrote:
> > >Jean-Paul Calderone <exar...@divmod.com> wrote:
> > > > Huge amounts of my pure Python code was broken by Python 2.5.

>
> > >Interesting. Could you give a few illustrations of this? (I didn't run
> > >into the same problem at all, so I'm curious.)

>
> > There are about half a dozen examples linked from here:

>
> > http://twistedmatrix.com/trac/ticket/1867

>
> > Check out the closed ticket linked from there or the changesets for more
> > detail.

>
> The changes listed dont' seem particularly huge considering the size,
> complexity, and boundary-pushingness of Twisted, coupled with the
> magnitude of the 2.5 release.
>
> -Mike


Just keep using python2.4

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Memory error due to the huge/huge input file size tejsupra@gmail.com Python 3 11-20-2008 07:21 PM
Pure space directly inside div ignored, but pure space directlyinside span honored liketofindoutwhy@gmail.com HTML 4 03-29-2008 06:06 PM
Multiple interpreters retaining huge amounts of memory Bronner, Gregory Python 13 02-08-2008 07:40 AM
Pure functions still pure after definition Todd Aspeotis C++ 3 05-30-2005 03:53 AM
defaults for horz/vert scroll-amounts for new page John A Grandy ASP .Net 0 10-16-2003 04:53 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57