Message68749
#!/usr/bin/python
import sys
import thread
f = file("o.test","w")
buff = " " * 1024
def run():
while 1:
try:
f.read(100)
#
f.write(buff)
except Exception, e:
print >>sys.stderr, "An exception, that's OK, ", repr(e)
if __name__ == '__main__':
thread.start_new_thread(run, (), {})
while 1:
try:
f.close()
except Exception, e:
print >>sys.stderr, "An exception, main thread ", repr(e)
f = file("o.test","w")
On Wed, Jun 25, 2008 at 2:36 PM, Eric Sadit Téllez Avila <donsadit@gmail.com>
wrote:
> The test script
>
> #!/usr/bin/python
>
> import sys
> import thread
>
> f = file("o.test","w")
> buff = " " * 1024
> def run():
> while 1:
> try:
> f.read(100)
> #
> f.write(buff)
>
> except Exception, e:
> print >>sys.stderr, "An exception, that's OK, ", repr(e)
>
> if __name__ == '__main__':
> thread.start_new_thread(run, (), {})
> while 1:
> try:
>
>
> On Wed, Jun 25, 2008 at 2:32 PM, Eric Sadit <report@bugs.python.org>
> wrote:
>
>>
>> Eric Sadit <donsadit@gmail.com> added the comment:
>>
>>
>> Thanks Amaury
>>
>> I run a test script and Python 2.5.2 crashes, but 2.6b1 runs perfectly
>> throwing a ValueError exception (Operation of closed file)
>> in the reader/writer thread and "IOError: close() called during concurrent
>> operation on the same file object" in the closer thread.
>> Python doesn't crash anymore.
>>
>> Cheers
>>
>> Eric Sadit
>>
>> On Wed, Jun 25, 2008 at 12:44 PM, Amaury Forgeot d'Arc <
>> report@bugs.python.org> wrote:
>>
>> >
>> > Amaury Forgeot d'Arc <amauryfa@gmail.com> added the comment:
>> >
>> > This problem may be a duplicate of issue815646 and issue595601, and was
>> > probably corrected with r62195.
>> >
>> > Can you please check with the new python version 2.6b1 ?
>> >
>> > ----------
>> > nosy: +amaury.forgeotdarc
>> > resolution: -> out of date
>> > status: open -> pending
>> >
>> > _______________________________________
>> > Python tracker <report@bugs.python.org>
>> > <http://bugs.python.org/issue3200>
>> > _______________________________________
>> >
>>
>> Added file: http://bugs.python.org/file10732/unnamed
>>
>> _______________________________________
>> Python tracker <report@bugs.python.org>
>> <http://bugs.python.org/issue3200>
>> _______________________________________
>>
>
> |
File name |
Uploaded |
unnamed
|
sadit,
2008-06-25.19:38:38
|
|
Date |
User |
Action |
Args |
2008-06-25 19:38:39 | sadit | set | spambayes_score: 0.000414948 -> 0.0004149476 recipients:
+ sadit, amaury.forgeotdarc |
2008-06-25 19:38:39 | sadit | link | issue3200 messages |
2008-06-25 19:38:39 | sadit | create | |
|