Skip to content

Commit

Permalink
patch on issue #5
Browse files Browse the repository at this point in the history
removed pipe on stdin and stderr to leave only stdout, this seems to be fine now
  • Loading branch information
seb5g committed May 11, 2021
1 parent ca205dc commit ef15fc9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/pymodaq_plugin_manager/data/PluginList.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "pymodaq-pluginList",
"version": "0.0.13",
"version": "0.0.14",
"pymodaq-plugins": [
{
"plugin-name": "pymodaq_plugins",
Expand Down
7 changes: 5 additions & 2 deletions src/pymodaq_plugin_manager/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,8 +287,11 @@ def do_action(self):

def do_subprocess(self, command):
try:
with subprocess.Popen(command, stdout=subprocess.PIPE, stdin=sys.stdout, stderr=sys.stdout,
universal_newlines=True) as sp:
self.info_widget.moveCursor(QTextCursor.End)
self.info_widget.insertPlainText(' '.join(command))
self.info_widget.moveCursor(QTextCursor.End)

with subprocess.Popen(command, stdout=subprocess.PIPE, universal_newlines=True, shell=True) as sp:
while True:
self.info_widget.moveCursor(QTextCursor.End)
self.info_widget.insertPlainText(sp.stdout.readline())
Expand Down

1 comment on commit ef15fc9

@Semptum
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was wondering what is the reason for using shell=True? It's causing problems for me (PyMoDaq 4.1.1, Arch Linux). Specifically, the line where it readline() the stdout, it opens up a shell in the terminal from which I launched the plugin manager and waits for my input. Closing that shell (Ctrl+D) makes the program continue without ever installing the package.

Removing the shell=True makes it possible to install the plugins, at least on my system.

Please sign in to comment.