473,695 Members | 2,703 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

huge amounts of pure Python code broken by Python 2.5?

Jean-Paul Calderone <ex*****@divmod .comwrote:
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
Feb 6 '07 #1
13 2153
Steven Bethard wrote:
Jean-Paul Calderone <ex*****@divmod .comwrote:
>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
Feb 6 '07 #2
On Feb 6, 8:40 am, Steven Bethard <steven.beth... @gmail.comwrote :
Jean-Paul Calderone <exar...@divmod .comwrote:
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

Feb 6 '07 #3
"John Roth" <Jo*******@jhro thjr.comescribi ó en el mensaje
news:11******** *************@k 78g2000cwa.goog legroups.com...
On Feb 6, 8:40 am, Steven Bethard <steven.beth... @gmail.comwrote :
>Jean-Paul Calderone <exar...@divmod .comwrote:
> 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
Feb 6 '07 #4
Steven Bethard wrote:
Jean-Paul Calderone <ex*****@divmod .comwrote:
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 UnicodeDecodeEr ror exception,
new in 2.5
(a patch to sgmllib._conver t_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
Feb 6 '07 #5

JohnMySQLdb isn't fully supported for Python 2.5 yet, and there's no
Johntested Windows executable available, although there's an untested
Johnversion 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
Feb 6 '07 #6
On Feb 6, 4:40 pm, Steven Bethard <steven.beth... @gmail.comwrote :
Jean-Paul Calderone <exar...@divmod .comwrote:
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

Feb 7 '07 #7
sk**@pobox.com wrote:
JohnMySQLdb isn't fully supported for Python 2.5 yet, and there's no
Johntested Windows executable available, although there's an untested
Johnversion 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

#############My SQL-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_GetDic t(module))) goto error;
if (PyDict_SetItem String(dict, "version_in fo",
! PyRun_String(ve rsion_info, Py_eval_input,
dict, dict)))
goto error;
if (PyDict_SetItem String(dict, "__version_ _",
! PyString_FromSt ring(__version_ _)))
goto error;
if (PyDict_SetItem String(dict, "connection ",
(PyObject *)&_mysql_Conne ctionObject_Typ e))
--- 2804,2814 ----

if (!(dict = PyModule_GetDic t(module))) goto error;
if (PyDict_SetItem String(dict, "version_in fo",
! PyRun_String(QU OTE(version_inf o), Py_eval_input,
dict, dict)))
goto error;
if (PyDict_SetItem String(dict, "__version_ _",
! PyString_FromSt ring(QUOTE(__ve rsion__))))
goto error;
if (PyDict_SetItem String(dict, "connection ",
(PyObject *)&_mysql_Conne ctionObject_Typ e))
diff -r -c MySQL-python-1.2.1_p2\site.c fg \tmp\MySQL-python-1.2.1_p2\site.c fg
*** MySQL-python-1.2.1_p2\site.c fg Sun Apr 02 18:16:50 2006
--- \tmp\MySQL-python-1.2.1_p2\site.c fg 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_rele ase
! include_dirs: \tmp\mysql-5.0.33\include
! libraries: mysqlclient
! zlib
! wsock32
! advapi32
! #msvcrt
! #libcmt
#extra_compile_ args:
! extra_objects: /NODEFAULTLIB:MS VCRT

#############My SQL-python-1.2.2b2
diff -r -c MySQL-python-1.2.2b2\site.cf g \tmp\MySQL-python-1.2.2b2\site.cf g
*** MySQL-python-1.2.2b2\site.cf g Wed Apr 05 02:47:02 2006
--- \tmp\MySQL-python-1.2.2b2\site.cf g 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_rele ase
! include_dirs: \tmp\mysql-5.0.33\include
! libraries: mysqlclient
! zlib
! wsock32
! advapi32
! #msvcrt
! #libcmt
#extra_compile_ args:
! extra_objects: /NODEFAULTLIB:MS VCRT
--
Robin Becker

Feb 7 '07 #8
On Feb 6, 11:07 am, Jean-Paul Calderone <exar...@divmod .comwrote:
On Tue, 06 Feb 2007 08:40:40 -0700, Steven Bethard <steven.beth... @gmail.comwrote :
Jean-Paul Calderone <exar...@divmod .comwrote:
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

Feb 9 '07 #9
On Feb 9, 10:29 am, "Klaas" <mike.kl...@gma il.comwrote:
On Feb 6, 11:07 am, Jean-Paul Calderone <exar...@divmod .comwrote:
On Tue, 06 Feb 2007 08:40:40 -0700, Steven Bethard <steven.beth... @gmail.comwrote :
>Jean-Paul Calderone <exar...@divmod .comwrote:
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

Feb 9 '07 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
2060
by: Matt Shomphe | last post by:
Are there any guidelines for packaging a pure python module? Specifically, say I have a set of 10 functions, all of varying behaviors (no unifying theme to bind them together into clear subsets), that I would like to make available to others. What is the best structure for the distributed module? A single file called "functions.py" that people can put in "site-packages"? A subdirectory called "MyFunctions" with an "__init__.py" and the...
15
2206
by: Christos TZOTZIOY Georgiou | last post by:
Has anyone built PIL (1.1.4 or 1.1.5) for Python 2.4? If yes, please let me know, since I can't test a couple of my apps using PIL with 2.4 . You can even reply by email (yes, I dare use true email in newsgroup postings, but then, I'm postmaster and welcome spam :) TIA -- TZOTZIOY, I speak England very best, "Tssss!" --Brad Pitt as Achilles in unprecedented Ancient Greek
8
4514
by: Ted Miller | last post by:
Hi folks, I'm looking at moving a large base of C++ code to .Net under tight time constraints. The code runs in mission-critical environments, and I am extremely concerned about the loader lock problem and the potential for deadlocks. After pouring over the available information, and trying a few experiments, I am still left with a few questions and issues I hope someone out there can shed some light on.
0
330
by: Kurt B. Kaiser | last post by:
Patch / Bug Summary ___________________ Patches : 380 open (-36) / 3658 closed (+65) / 4038 total (+29) Bugs : 965 open ( -9) / 6555 closed (+35) / 7520 total (+26) RFE : 272 open ( +4) / 253 closed ( +2) / 525 total ( +6) New / Reopened Patches ______________________
8
4276
by: blaine | last post by:
Hey guys, For my Network Security class we are designing a project that will, among other things, implement a Diffie Hellman secret key exchange. The rest of the class is doing Java, while myself and a classmate are using Python (as proof of concept). I am having problems though with crunching huge numbers required for calculations. As an alternative I can use Java - but I'd rather have a pure python implementation. The problem is that...
16
2037
by: pereges | last post by:
ok so i have written a program in C where I am dealing with huge data(millions and lots of iterations involved) and for some reason the screen tends to freeze and I get no output every time I execute it. However, I have tried to reduce the amount of data and the program runs fine. What could possibly be done to resolve this ?
9
13215
by: NvrBst | last post by:
Whats the best way to count the lines? I'm using the following code at the moment: public long GetNumberOfLines(string fileName) { int buffSize = 65536; int streamSize = 65536; long numOfLines = 0; byte bArr = new byte;
26
1745
by: Alexzive | last post by:
Hello there :) , I am a python newbie and need to run following code for a task in an external simulation programm called "Abaqus" which makes use of python to access the mesh (ensamble of nodes with xy coordinates) of a certain geometrical model. Code: Select all
0
8619
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8555
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9112
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8971
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8824
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8817
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6484
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4336
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2994
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.