Unusual i/o problems
Peter Otten
__peter__ at web.de
Fri May 18 05:08:24 EDT 2007
saif.shakeel at gmail.com wrote:
> On May 18, 1:01 pm, Peter Otten <__pete... at web.de> wrote:
>> saif.shak... at gmail.com wrote:
>> > I am running the exe from command prompt,but i am not able to see
>> > the error as it goes off very quickly.
>>
>> http://effbot.org/pyfaq/how-do-i-run-a-python-program-under-windows.htm
>>
>> > How do i capture the error (traceback).I tried putting an input prompt
>> > after the expected line of error but wont work.Is there a command to
>> > capture the error.
>>
>> You can redirect stderr to a file:
>>
>> http://www.microsoft.com/resources/documentation/windows/xp/all/prodd...
>>
>> Peter
>
> ok i traced the error for above code.It says something like this:
> Traceback (most recent call last):
> File "C:\Projects\ODX Import\code_ini\odxparse_mod.py", line 294, in
> <module>
> input_xml_sec = open(output_file,'r')
> TypeError: coercing to Unicode: need string or buffer, file found
> Can someone help me in this.
> Thanks
I already pointed you to the error in my first post in this thread.
output_file is a file, but open() expects a file name.
Peter
More information about the Python-list
mailing list