Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python 3: Error in invoking subprocess.Popen with stream wrapper #12

Closed
rgov opened this issue Mar 22, 2018 · 1 comment · Fixed by #13
Closed

Python 3: Error in invoking subprocess.Popen with stream wrapper #12

rgov opened this issue Mar 22, 2018 · 1 comment · Fixed by #13

Comments

@rgov
Copy link

rgov commented Mar 22, 2018

I'm running Python 3.6.3 and trying to just django_gulp 3.0.0.

$ python manage.py runserver
>>> Starting gulp
<class 'django.core.management.base.OutputWrapper'> <class 'django.core.management.base.OutputWrapper'>
Traceback (most recent call last):
  File "/usr/local/Cellar/python3/3.6.3/Frameworks/Python.framework/Versions/3.6/lib/python3.6/concurrent/futures/thread.py", line 56, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/Users/rzg/Projects/2017/10/cocktails-ii/.direnv/python-3.6.3/lib/python3.6/site-packages/django_gulp/management/commands/runserver.py", line 112, in start_gulp
    stderr=self.stderr)
  File "/usr/local/Cellar/python3/3.6.3/Frameworks/Python.framework/Versions/3.6/lib/python3.6/subprocess.py", line 667, in __init__
    errread, errwrite) = self._get_handles(stdin, stdout, stderr)
  File "/usr/local/Cellar/python3/3.6.3/Frameworks/Python.framework/Versions/3.6/lib/python3.6/subprocess.py", line 1184, in _get_handles
    c2pwrite = stdout.fileno()
io.UnsupportedOperation: fileno

>>> Killing pid 36211
>>> Exiting

What seems to be happening is that start_gulp calls subprocess.Popen and passes self.stdout, which is an instance of django.core.management.base.OutputWrapper. This class in turn wraps a _io.TextIOWrapper, which does not necessarily have an associated file descriptor number.

@rgov
Copy link
Author

rgov commented Mar 22, 2018

I'm not sure what the appropriate solution is, but for now it can just not redirect the subprocess's stdout and stderr.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant