[PythonCE] Version 2.3
goodey27 at juno.com
goodey27 at juno.com
Mon Nov 3 18:52:14 EST 2003
1) When I try to open a file in Ver. 2.2 that doesn't exist.
Like this for example:
">>> f = open('my documents\\python\\myfile.txt', 'r')"
I get this Traceback.
"Traceback (most recent call last):
File "\Program Files\Python\lib\pcceshell.py", line 457, in Interact
exec codeOb in locals
IOError: [Errno 2] The system cannot find the file specified: 'my
documents\\python\\myfile.txt'"
This Traceback tells me exactly what the problem is.
While in Ver. 2.3 for the same thing I get this Traceback.
"Traceback (most recent call last):
File "\Program Files\Python\lib\pcceshell.py", line 460, in Interact
IOError: invalid mode: r"
witch doesn't really tell me the problem
2)When I run this code in Ver. 2.2 it works as it should.
But when I run it in Ver. 2.3 I get an I/O error(not the excepted error)
"try:
f = open('myfile.txt')
s = f.readline()
i = int(string.strip(s))
except IOError, (errno, strerror):
print "I/O error(%s): %s" % (errno, strerror)
except ValueError:
print "Could not convert data to an integer."
except:
print "Unexpected error:", sys.exc_info()[0]
raise"
This is the Traceback I get in Ver. 2.3
"Traceback (most recent call last):
File "\Program Files\Python\lib\pcceshell.py", line 460, in Interact
ValueError: need more than 1 value to unpack"
I conclude from all this that something changed about how the Exception
Handling works, and the change is for the worse.
Maybe and hopefully this can be corrected (especially problem #1).
3) I tried to use the file method truncate but I get an error any help
would be appreciated.
Thanks
Isr
________________________________________________________________
The best thing to hit the internet in years - Juno SpeedBand!
Surf the web up to FIVE TIMES FASTER!
Only $14.95/ month - visit www.juno.com to sign up today!
More information about the PythonCE
mailing list