direct.stdpy.file tell() can cause exceptions, and lacks 'with' support
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Panda3D |
Fix Released
|
Undecided
|
David Rose |
Bug Description
from direct.stdpy import file
file.open(
"""
Causes this error:
Traceback (most recent call last):
File "test.py", line 2, in <module>
file.
File "/Developer/
raise ValueError
ValueError
"""
with file.open(
pass
"""
Causes this error:
Traceback (most recent call last):
File "/Users/
with file.open(
AttributeError: file instance has no attribute '__exit__'
"""
# direct.stdpy.file does not support tell() in some cases (perhaps just before any reading or writing?)
# direct.stdpy.file does not support being used with 'with' blocks
# these are supported by python's file objects,
# and losing these features when the runtime replaces the builtin open method can
# cause confusing and annoying issues
# Tested on Mac OS 10.5 and 10.6 (intel) with panda 1.7.0
Changed in panda3d: | |
assignee: | nobody → David Rose (droklaunchpad) |
Changed in panda3d: | |
status: | Fix Committed → Fix Released |
First bug fix committed as version 1.13 of file.py.
Second bug was previously reported and already fixed on trunk.