Query on Python Compiled source--Urgent

Tim Golden mail at timgolden.me.uk
Mon Oct 14 06:10:45 EDT 2013


[Please post your answer below the previous reply, not above]

[... snip most of original traceback ...]

>  File "C:\Python27\lib\site-packages\pyExcelerator\CompoundDoc.py",
> line 554, in save
>     f = file(filename, 'wb')
> IOError: [Errno 22] invalid mode ('wb') or filename:
> '.\\TestResults\\TestReport.xls'
>
> Now my question is of there any issue with logging to excel it should
> happen for the first test suite itself,but it occurs in either 2,3,4 or
> 5 test suite. Some it runs without any issues.

On 14/10/2013 10:34, chandan kumar wrote:
> Yes ,its not actual logging module.Using pyexcelerator we are  storing just test results to excel file.Each test suite has some 25-100 test cases.We are using unit test from python ,after completion of each test case the test result will be stored in excel file.Below is the sample result that is stored in excel file.
> 
>  S.No    TestCaseID       TestDescription         TestResult 
>  1         Test_case_1     SetTransmitPower       Pass
>  2         Test_case_2     Set  Frequency           Fail
> 
>  
>  Nothing is running parallel.

Sorry -- I didn't look closely enough at the error message. "invalid
mode or filename" wouldn't be the result of a file getting deleted out
from under a write.

Error 22 is returned from the MS runtime as EINVAL. It's not clear from
the traceback why it would consider that path invalid, but you're going
to have to do some legwork to narrow it down, I'm afraid.

The most likely prospects is that you're not running in the directory
you think you're in. Try putting a "print os.getcwd()" somewhere in the
mix to see where you actually are.

However, that still wouldn't quite explain why it occurs only sometimes
but, as I said, we'd have to know more about your test-runner to be able
to help.

TJG



More information about the Python-list mailing list