This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author l4mer
Recipients l4mer
Date 2017-10-06.11:39:09
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1507289950.65.0.213398074469.issue31712@psf.upfronthosting.co.za>
In-reply-to
Content
I am using ssh mux + authorized key. So can exectute commands without passwod.

1. disconnect mux by: ssh user@localhost -O exit
2. run simple script
import subprocess

if __name__ == '__main__':
    cmd = ["ssh", "user@localhost", "id"]
    try:
        buf = subprocess.check_output(cmd, stderr=subprocess.STDOUT)
    except subprocess.CalledProcessError as e:
        buf = e.output
3. This always hang in read(3,
fcntl(3, F_GETFL)                       = 0 (flags O_RDONLY)
fstat(3, {st_mode=S_IFIFO|0600, st_size=0, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f036b5f1000
lseek(3, 0, SEEK_CUR)                   = -1 ESPIPE (Illegal seek)
fstat(3, {st_mode=S_IFIFO|0600, st_size=0, ...}) = 0
munmap(0x7f036b5f1000, 4096)            = 0
fstat(3, {st_mode=S_IFIFO|0600, st_size=0, ...}) = 0
lseek(3, 0, SEEK_CUR)                   = -1 ESPIPE (Illegal seek)
read(3, "uid=0(", 6)                    = 6
fstat(3, {st_mode=S_IFIFO|0600, st_size=0, ...}) = 0
lseek(3, 0, SEEK_CUR)                   = -1 ESPIPE (Illegal seek)
read(3, "root) ", 6)                    = 6
fstat(3, {st_mode=S_IFIFO|0600, st_size=0, ...}) = 0
lseek(3, 0, SEEK_CUR)                   = -1 ESPIPE (Illegal seek)
read(3, "gid=0(r", 7)                   = 7
fstat(3, {st_mode=S_IFIFO|0600, st_size=0, ...}) = 0
lseek(3, 0, SEEK_CUR)                   = -1 ESPIPE (Illegal seek)
read(3, "oot) gro", 8)                  = 8
fstat(3, {st_mode=S_IFIFO|0600, st_size=0, ...}) = 0
lseek(3, 0, SEEK_CUR)                   = -1 ESPIPE (Illegal seek)
read(3, "ups=0(roo", 9)                 = 9
fstat(3, {st_mode=S_IFIFO|0600, st_size=0, ...}) = 0
lseek(3, 0, SEEK_CUR)                   = -1 ESPIPE (Illegal seek)
read(3, "t)\n", 10)                     = 3
read(3, 0x7f036b480653, 7)              = ? ERESTARTSYS (To be restarted if SA_RESTART is set)
--- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=21620, si_status=0, si_utime=1, si_stime=0} ---
read(3,

4. After ctr+c
read(3, ^CProcess 21619 detached
 <detached ...>
Traceback (most recent call last):
  File "test.py", line 6, in <module>
    buf = subprocess.check_output(cmd, stderr=subprocess.STDOUT)
  File "/usr/lib/python2.7/subprocess.py", line 567, in check_output
    output, unused_err = process.communicate()
  File "/usr/lib/python2.7/subprocess.py", line 791, in communicate
wigig@wigig-Latitude-E5270:~$     stdout = _eintr_retry_call(self.stdout.read)
  File "/usr/lib/python2.7/subprocess.py", line 476, in _eintr_retry_call
    return func(*args)

BTW, when MUX is created it always works.
History
Date User Action Args
2017-10-06 11:39:10l4mersetrecipients: + l4mer
2017-10-06 11:39:10l4mersetmessageid: <1507289950.65.0.213398074469.issue31712@psf.upfronthosting.co.za>
2017-10-06 11:39:10l4merlinkissue31712 messages
2017-10-06 11:39:09l4mercreate