Modify

Opened 6 years ago

Closed 5 years ago

#3728 closed enhancement (wontfix)

os.popen3 usage cause lags in launch() function

Reported by: franck34 Owned by: pkropf
Priority: high Component: GraphvizPlugin
Severity: normal Keywords: mod_python, popen, subprocess
Cc: Trac Release: 0.10

Description

Commands launched by launch() function are working, but a lag of 20/30 sec occur after when using apache2+mod_python

Here is my fix, don't know if it's good or not, but it's working for me :

    def launch(self, cmd, input):
        """Launch a process (cmd), and returns exitcode, stdout + stderr"""
        p = subprocess.Popen(cmd, shell=True,stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
        (p_in, p_out, p_err) = (p.stdin, p.stdout, p.stderr)
        if input:
            p_in.write(input)
        p_in.close()
        out = p_out.read()
        err = p_err.read()
        p.wait()
        p_err.close()
        p_out.close()
        return out, err

Attachments (0)

Change History (3)

comment:1 Changed 6 years ago by cboos

subprocess is now used for the 0.11 version of the plugin.
I don't know really, but it seems unlikely that the 0.10 version will adopt this change.

Closing as worksforme?

comment:2 Changed 6 years ago by franck34

Not until change adopted, as you said about subprocess, or this patch applied.

Should be great to have the feedback of pkropf too .

Regards

comment:3 Changed 5 years ago by cboos

  • Resolution set to wontfix
  • Status changed from new to closed

Works fine in the 0.11 version.

The maintenance of the 0.10 version of the plugin is up for adoption...

Add Comment

Modify Ticket

Action
as closed .
as The resolution will be set. Next status will be 'closed'.
to The owner will be changed from pkropf. Next status will be 'closed'.
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.