Running a program from another program.

Stephen Hansen me+list/python at ixokai.io
Thu Jun 17 18:16:39 EDT 2010


On 6/17/10 3:06 PM, Laurent Verweijen wrote:
>>
>> In your other thread you include an actual traceback:
>>
>> Traceback (most recent call last):
>>   File "subchronous_test.py", line 5, in <module>
>>     send_all(str(p), n)
>>   File "/home/Somelauw/asynchronous.py", line 145, in send_all
>>     while len(data):
>> TypeError: object of type 'int' has no len()
>>
>> The first argumetn to send_all should be the actual Popen subclass. The
>> second should be a string to send. I think that line really is intended
>> to be:
>>
>> send_all(p, str(n)) # assuming 'n' is say, the number 5.
>>
> 
> You are right, I swapped the parameters, but even if I correct it, it
> still gives the second error.
> 

General rule of thumb: its best to never use the word "still" when it
comes to debugging Python and exceptions, unless you are absolutely
certain the exception is precisely the same.

I don't doubt that you may still get an exception on send_all; but there
is no way you're getting the *same* exception (that specific type error:
attempting to call len() on an integer) if you corrected your arguments.

You're getting the EOFError, because you're never sending anything to
the subprocess. You're not getting anything from the subprocess because
it never receives anything to send back. And apparently there's an error
on send, which is causing that problem, but that error is...?

-- 

   Stephen Hansen
   ... Also: Ixokai
   ... Mail: me+list/python (AT) ixokai (DOT) io
   ... Blog: http://meh.ixokai.io/

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 487 bytes
Desc: OpenPGP digital signature
URL: <http://mail.python.org/pipermail/python-list/attachments/20100617/09492ab0/attachment-0001.sig>


More information about the Python-list mailing list