By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,965 Members | 1,631 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,965 IT Pros & Developers. It's quick & easy.

Diffrences: Python 2.3 and Python 2.4

P: 94
Hi there,

I have an application written in Python 2.3, wxPython 2.4 , C++, OpenGL
OS: Fedora Core 3

Now I need to upgrade it using Python 2.4 and wxPython 2.6 OS: Fedora Core 6
There was a few minor faults and it was easy to fix
But now I get this Segmentation fault error message

What is the diffrences between Python 2.3 and Python 2.4?
What is the diffrences between wxPython 2.4 and wxPython 2.6?
Jan 5 '07 #1
Share this Question
Share on Google+
19 Replies


bartonc
Expert 5K+
P: 6,596
Hi there,

I have an application written in Python 2.3, wxPython 2.4 , C++, OpenGL
OS: Fedora Core 3

Now I need to upgrade it using Python 2.4 and wxPython 2.6 OS: Fedora Core 6
There was a few minor faults and it was easy to fix
But now I get this Segmentation fault error message

What is the diffrences between Python 2.3 and Python 2.4?
What is the diffrences between wxPython 2.4 and wxPython 2.6?
The big problems seem to come when attempting to import modules that were compiled with earlier versions of the core include and header files into a newer version of python. On Widows, we get a very clear message that say something like "that was compiled with an earlier version of python". I've also read that compiled modules should be built with THE SAME compiler as python was built with, but, again, this issue is seldom seen on Windows because the production version of python is built with VC++. So if you have source code you can compile troublesome modules with current include and header files. If not look for current binaries (I have this problem with python-MySQLd).
As for wx, I didn't start using it until V2.6 and skipped the part of the release notes that talked about backward compatability. I do know that there are some issues, however. Of course, wx is now in version 2.8 as of December, 2006.
Jan 6 '07 #2

P: 94
The big problems seem to come when attempting to import modules that were compiled with earlier versions of the core include and header files into a newer version of python. On Widows, we get a very clear message that say something like "that was compiled with an earlier version of python". I've also read that compiled modules should be built with THE SAME compiler as python was built with, but, again, this issue is seldom seen on Windows because the production version of python is built with VC++. So if you have source code you can compile troublesome modules with current include and header files. If not look for current binaries (I have this problem with python-MySQLd).
As for wx, I didn't start using it until V2.6 and skipped the part of the release notes that talked about backward compatability. I do know that there are some issues, however. Of course, wx is now in version 2.8 as of December, 2006.
I am going to check it out. But wxPython is only a GUI toolkit. Off course I am used to working on Windows from home as well. So far I havent test this program's compatibility on windows, thank you for your input
Jan 10 '07 #3

bartonc
Expert 5K+
P: 6,596
I am going to check it out. But wxPython is only a GUI toolkit. Off course I am used to working on Windows from home as well. So far I havent test this program's compatibility on windows, thank you for your input
You are welcome for the input. I have gotten to know wxPython quite well over the past 6 months (the most common widgets and all the methods of EVT_* class objects), so if you have questions there, I can probably guide you.
Jan 10 '07 #4

P: 94
You are welcome for the input. I have gotten to know wxPython quite well over the past 6 months (the most common widgets and all the methods of EVT_* class objects), so if you have questions there, I can probably guide you.
Well, Thank you for the offer.
I myself have gotton to know wxPython quite well.
My problem is that I know wxPython 2.6 > better than I know wxPython 2.4
And the same with Python 2.4 > better than Python 2.3
Jan 10 '07 #5

bartonc
Expert 5K+
P: 6,596
Well, Thank you for the offer.
I myself have gotton to know wxPython quite well.
My problem is that I know wxPython 2.6 > better than I know wxPython 2.4
And the same with Python 2.4 > better than Python 2.3
Sounds like our skill sets may be on about the same level. I've never even tried to to stay 2.3 compatible. It seems like most significant changes took place in 2.2 and maybe now with 2.5 some new syntax has evolved, but I haven't really checked it out too much.
Jan 10 '07 #6

P: 94
Sounds like our skill sets may be on about the same level. I've never even tried to to stay 2.3 compatible. It seems like most significant changes took place in 2.2 and maybe now with 2.5 some new syntax has evolved, but I haven't really checked it out too much.
Exactly, I have the same problem.
I am forced though to still use Python 2.3 and Python 2.4
I get an error with SetStringSelection.
[ERROR] wxPython.wxc.wxPyAssertionError
C++ assertion "wxAssertFailure" failed in ../src/common/lboxcmn.cpp(81): invalid string in SetStringSelection [/ERROR]
Expand|Select|Wrap|Line Numbers
  1.  self.R.SetStringSelection(rol 
)
Jan 10 '07 #7

bartonc
Expert 5K+
P: 6,596
Exactly, I have the same problem.
I am forced though to still use Python 2.3 and Python 2.4
I get an error with SetStringSelection.
[ERROR] wxPython.wxc.wxPyAssertionError
C++ assertion "wxAssertFailure" failed in ../src/common/lboxcmn.cpp(81): invalid string in SetStringSelection [/ERROR]
Expand|Select|Wrap|Line Numbers
  1.  self.R.SetStringSelection(rol 
)
This does not look like a python error (or version problem). Your wxPython version may be out of sink with wxWidgets installed. Post enough code to run and I'll try to run it to see if I get the same error. I am currnetly using Py2.4.4 because of current MySQL support.
Jan 10 '07 #8

P: 94
This does not look like a python error (or version problem). Your wxPython version may be out of sink with wxWidgets installed. Post enough code to run and I'll try to run it to see if I get the same error. I am currnetly using Py2.4.4 because of current MySQL support.
What I haven't mensioned is that the application I am working on is very big, 1 Gb of code.
Keeping that in mind, you can understand that there is a lot of imports depending on each other, sending you enough code, isn't quite possible
But the good news is that I think I found my problem. A wxWidget problem.
Thank you so much for your help
Jan 10 '07 #9

bartonc
Expert 5K+
P: 6,596
What I haven't mensioned is that the application I am working on is very big, 1 Gb of code.
Keeping that in mind, you can understand that there is a lot of imports depending on each other, sending you enough code, isn't quite possible
But the good news is that I think I found my problem. A wxWidget problem.
Thank you so much for your help
OK, here's the plan: Make a simpleApp with enough code to produce the error on your machine. Then start a new discussion and post your simpleApp there and I'll run it. We should be targeting the wx installation since that is what the error looks like to me.
Jan 10 '07 #10

P: 94
OK, here's the plan: Make a simpleApp with enough code to produce the error on your machine. Then start a new discussion and post you simpleApp there and I'll run it. We should be targeting the wx installation since that is what the error looks like to me.
You are fast, I am about to do it, then you can have a look at it
Thanx a lot
That's the kind of errors that appear when you feel you want to change widgets a little (referencing to me)
Jan 10 '07 #11

P: 94
This does not look like a python error (or version problem). Your wxPython version may be out of sink with wxWidgets installed. Post enough code to run and I'll try to run it to see if I get the same error. I am currnetly using Py2.4.4 because of current MySQL support.
Hi, there, just by the way, I found my fault
It was a wx.Choice problem. In wxPython 2.4, wxChoice takes the first choice as the default, but in wxPython 2.6, it doesn't do that anymore. So after writing a little method, I got it right, thanx
Jan 12 '07 #12

bartonc
Expert 5K+
P: 6,596
Hi, there, just by the way, I found my fault
It was a wx.Choice problem. In wxPython 2.4, wxChoice takes the first choice as the default, but in wxPython 2.6, it doesn't do that anymore. So after writing a little method, I got it right, thanx
Thanks for the update. I'm sure that this will help somebody down the road.
Jan 12 '07 #13

P: 94
For anyone who cares, I found one more change which I think would be a great help to anyone. In Python 2.3 a boolean (ie True, False) could be either a bool or an integer( ex. If you said True, but the program expects an integer, it automatically takes it as 1) In 2.4 however, it doesn't do that anymore, you would have to say int(boolvariable) eg int(True) will give you 1 but True will give you True
Just something for thought,
Jan 16 '07 #14

bartonc
Expert 5K+
P: 6,596
For anyone who cares, I found one more change which I think would be a great help to anyone. In Python 2.3 a boolean (ie True, False) could be either a bool or an integer( ex. If you said True, but the program expects an integer, it automatically takes it as 1) In 2.4 however, it doesn't do that anymore, you would have to say int(boolvariable) eg int(True) will give you 1 but True will give you True
Just something for thought,
If that's true, then this shouldn't work in 2.4.4:

>>> 1 + True
2
>>>
but it does. It's all about the context.
Jan 16 '07 #15

P: 94
If that's true, then this shouldn't work in 2.4.4:
Obviously it depends on the context, but it is just safer to imply int(True).
In more complex cases and in Combination with wxPython,it is a much better practice.
This is only what I experienced.
Jan 17 '07 #16

bartonc
Expert 5K+
P: 6,596
Obviously it depends on the context, but it is just safer to imply int(True).
In more complex cases and in Combination with wxPython,it is a much better practice.
This is only what I experienced.
The truth is that bool is a subtype of integer, and so inherits integer operations from there.

Integers
These represent elements from the mathematical set of integers (positive and negative).
There are three types of integers:


Plain integers
These represent numbers in the range -2147483648 through 2147483647. (The range may be larger on machines with a larger natural word size, but not smaller.) When the result of an operation would fall outside this range, the result is normally returned as a long integer (in some cases, the exception OverflowError is raised instead). For the purpose of shift and mask operations, integers are assumed to have a binary, 2's complement notation using 32 or more bits, and hiding no bits from the user (i.e., all 4294967296 different bit patterns correspond to different values).

Long integers
These represent numbers in an unlimited range, subject to available (virtual) memory only. For the purpose of shift and mask operations, a binary representation is assumed, and negative numbers are represented in a variant of 2's complement which gives the illusion of an infinite string of sign bits extending to the left.

Booleans
These represent the truth values False and True. The two objects representing the values False and True are the only Boolean objects. The Boolean type is a subtype of plain integers, and Boolean values behave like the values 0 and 1, respectively, in almost all contexts, the exception being that when converted to a string, the strings "False" or "True" are returned, respectively.
Jan 17 '07 #17

P: 94
The truth is that bool is a subtype of integer, and so inherits integer operations from there.
The truth is that I got that error and that is what happened.
I believe your facts, but like I said, I got that error
"Invalid type True" when I needed to get 1
It is a very important little difference when you need to generate XML
It is just an intresting little thing I found I needed to watch out for
Jan 17 '07 #18

bartonc
Expert 5K+
P: 6,596
The truth is that I got that error and that is what happened.
I believe your facts, but like I said, I got that error
"Invalid type True" when I needed to get 1
It is a very important little difference when you need to generate XML
It is just an intresting little thing I found I needed to watch out for
So true! I get a lot of this type of thing (type casting) when dealing with SQL. It's interesting that an earlier version of python treated this differently. I wonder if it is the particular library that you are dealing with or the interpreter itself. I would tend to bet on the former.
Jan 17 '07 #19

P: 94
So true! I get a lot of this type of thing (type casting) when dealing with SQL. It's interesting that an earlier version of python treated this differently. I wonder if it is the particular library that you are dealing with or the interpreter itself. I would tend to bet on the former.
It's interesting, but annoying. Why change that?
I think it is the library,as well. I't is annoying if it works fine on the one version and gives an error on the other. Normally it isn't big errors, but it is not easy to find, especially if you (in my case) generate XML to use in another module and the error appear there. Hard to trace
Jan 17 '07 #20

Post your reply

Sign in to post your reply or Sign up for a free account.