[Tutor] subprocess module seems to be failing...

Peter Otten __peter__ at web.de
Fri Jun 3 16:30:18 EDT 2016


DirkJSoren at gmail.com wrote:

> Running Linux Mint 17.3
> Python3.4.3
> 
> I'm following a Tutor concerning the subprocess module which said to
> open a Terminal SHELL and type:
> 
> $ python3
>  >>> import subprocess
>  >>> subprocess.call('ls', shell=True)
> 
> Last night the subprocess.call portion was erroring saying their was no
> 'call' attribute. I tried asking
> dir(subprocess) and call wasn't listed there. I figured I would try
> again this morning, however, this
> is what I was greeted with shortly after booting up and launching my
> Terminal:
> 
> [justme at ispy] ~$ python3
> Python 3.4.3 (default, Oct 14 2015, 20:28:29)
> [GCC 4.8.4] on linux
> Type "help", "copyright", "credits" or "license" for more information.
>  >>>
>  >>> import subprocess
> Traceback (most recent call last):
>    File "<stdin>", line 1, in <module>
>    File "/home/justme/python_work/subprocess.py", line 39

Look carefully at the line above. You wrote a script and called it 
subprocess.py. Bad idea ;)

Delete or rename your subprocess.py, and the one in the standard library 
will become visible again and work as smoothly as ever.

> 
>      ^
> SyntaxError: EOF while scanning triple-quoted string literal
>  >>>
> 
> Seems like the module is deteriorating or something, as yesterday it
> accepted the import command
> to include it!  :)
> 
> I found a subprocess.py in /usr/lib/python3.4 and grabbed it with gedit
> and looked at it line by line. It has tripple double quotes but also
> single double quotes throughout it in places, but they all seemed to
> have a companion quote to offset them...and the entire text area is one
> solid color which would seem to indicate
> it is being ignored by python...
> 
> What should I do now?
> 
> Thanks!
> 
> 
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> To unsubscribe or change subscription options:
> https://mail.python.org/mailman/listinfo/tutor




More information about the Tutor mailing list