Re: ValueError: I/O operation on closed file

2016-05-25 Thread Steven D'Aprano
On Thursday 26 May 2016 15:47, San wrote: > Following is the code i used. > > def test_results(filename): > import csv > with open(filename,"rU") as f: > reader = csv.reader(f,delimiter="\t") > result = {} You should use more consistent indents. Can you set your editor to auto

Re: ValueError: I/O operation on closed file

2016-05-25 Thread Rustom Mody
On Thursday, May 26, 2016 at 11:17:56 AM UTC+5:30, San wrote: > On Wednesday, May 25, 2016 at 6:00:07 PM UTC+5:30, San wrote: > > Hi Gorup, > > > > why i am getting "ValueError: I/O operation on closed file" this error. > > Pls let me know. > >

Re: ValueError: I/O operation on closed file

2016-05-25 Thread San
On Wednesday, May 25, 2016 at 6:00:07 PM UTC+5:30, San wrote: > Hi Gorup, > > why i am getting "ValueError: I/O operation on closed file" this error. > Pls let me know. > > Thanks in Advance. > san Hello, Following is the code i used. def test_results(filename

Re: ValueError: I/O operation on closed file

2016-05-25 Thread alister
On Wed, 25 May 2016 05:29:53 -0700, San wrote: > Hi Gorup, > > why i am getting "ValueError: I/O operation on closed file" this error. > Pls let me know. > > Thanks in Advance. > san because you are trying to do something with a file that has been closed the err

Re: ValueError: I/O operation on closed file

2016-05-25 Thread Joel Goldstick
On Wed, May 25, 2016 at 8:29 AM, San wrote: > Hi Gorup, > > why i am getting "ValueError: I/O operation on closed file" this error. > Pls let me know. Because your program is incorrect? Why not list your code, so that someone might be able to help you? > &

ValueError: I/O operation on closed file

2016-05-25 Thread San
Hi Gorup, why i am getting "ValueError: I/O operation on closed file" this error. Pls let me know. Thanks in Advance. san -- https://mail.python.org/mailman/listinfo/python-list

Re: ValueError: I/O operation on closed file. with python3

2013-06-12 Thread Serhiy Storchaka
12.06.13 10:26, Peter Otten написав(ла): @contextmanager def my_urlopen(url): resp = urlopen(url) yield io.TextIOWrapper(resp.fp) with urlopen(url) as resp: yield io.TextIOWrapper(resp) Note that last bugfix releases (i.e. 3.3.1) are needed. There was a

Re: ValueError: I/O operation on closed file. with python3

2013-06-12 Thread Adam Mercer
On Wed, Jun 12, 2013 at 2:26 AM, Peter Otten <__pete...@web.de> wrote: > Applying these findings to your script: > > from contextlib import contextmanager > try: > # python-2.x > from urllib2 import urlopen > from ConfigParser import ConfigParser > > @contextmanager > def my_urlopen(url)

Re: ValueError: I/O operation on closed file. with python3

2013-06-12 Thread Peter Otten
.read_file(fp, source=filename) > File > "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/configparser.py", > line 708, in read_file > self._read(f, source) > File > "/opt/local/Library/Frameworks/Python.framework/Versions/

ValueError: I/O operation on closed file. with python3

2013-06-11 Thread Adam Mercer
ry/Frameworks/Python.framework/Versions/3.3/lib/python3.3/configparser.py", line 1010, in _read for lineno, line in enumerate(fp, start=1): ValueError: I/O operation on closed file. $ Is there a way to get this working in both python2 and python3? This is a small script and I'm s

Re: ValueError: I/O operation on closed file

2009-04-14 Thread Vinay Sajip
On Apr 14, 6:43 am, Dennis Lee Bieber wrote: > On Mon, 13 Apr 2009 16:44:44 -0700 (PDT), dj And Dennis' revised script works for me on Python 2.6 and [after converting print x to print(x)] Python 3.0 (both ActivePython installations). Regards, Vinay Sajip -- http://mail.python.org/mailman/list

Re: ValueError: I/O operation on closed file

2009-04-13 Thread dj
houldRollover(record): > >   File "C:\python26\lib\logging\handlers.py", line 146, in > > shouldRollover > >     self.stream.seek(0, 2)  #due to non-posix-compliant Windows > > feature > > ValueError: I/O operation on closed file > >         That'

Re: ValueError: I/O operation on closed file

2009-04-10 Thread Vinay Sajip
\handlers.py", line 74, in emit > if self.shouldRollover(record): > File "C:\python26\lib\logging\handlers.py", line 146, in > shouldRollover > self.stream.seek(0, 2) #due to non-posix-compliant Windows > feature > ValueError: I/O operation on closed file >

ValueError: I/O operation on closed file

2009-04-10 Thread dj
;, line 146, in shouldRollover self.stream.seek(0, 2) #due to non-posix-compliant Windows feature ValueError: I/O operation on closed file I am completely stumped has to what could be the issue. Any help would be greatly appreciated. -- http://mail.python.org/mailman/listinfo/python-list

Re: multiple threads with Logging: ValueError: I/O operation on closed file

2008-11-10 Thread Vinay Sajip
): > File "/tools/python-2_4_4.i386.solaris.5_9/lib/python2.4/logging/ > __init__.py", line 737, in emit > self.stream.write(fs % msg) > ValueError: I/O operation on closed file > Traceback (most recent call last): > File "/tools/python-2_4_4.i386.solaris.5_

Re: multiple threads with Logging: ValueError: I/O operation on closed file

2008-11-10 Thread Vinay Sajip
): > File "/tools/python-2_4_4.i386.solaris.5_9/lib/python2.4/logging/ > __init__.py", line 737, in emit > self.stream.write(fs % msg) > ValueError: I/O operation on closed file > Traceback (most recent call last): > File "/tools/python-2_4_4.i386.solaris.5_

multiple threads with Logging: ValueError: I/O operation on closed file

2008-11-08 Thread scriptlearner
;, line 737, in emit self.stream.write(fs % msg) ValueError: I/O operation on closed file Traceback (most recent call last): File "/tools/python-2_4_4.i386.solaris.5_9/lib/python2.4/logging/ __init__.py", line 737, in emit self.stream.write(fs % msg) ValueError: I/O operation on closed file

logging module ValueError: I/O operation on closed file

2006-06-19 Thread emvee bhian
getting the following error  while using logging at random any idea what can cause this behaviour   Traceback (most recent call last): File    lib/python2.4/logging/__init__.py", line 737, in emitValueError: I/O operation on closed file         self.Log = logging.getLogger('MAIN')    sForm