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

close_fds is not supported on Windows platforms if you redirect stdin/stdout/stderr #43

Open
flystar233 opened this issue Jan 16, 2019 · 5 comments

Comments

@flystar233
Copy link

close_fds is not supported on Windows platforms if you redirect stdin/stdout/stderr

@vm-asd2015
Copy link

I encounter the same problem.
Below is more information about the issue:

Webserver traceback log

(base) C:\Users\myusername>excalibur webserver
 * Serving Flask app "excalibur.www.app" (lazy loading)
 * Environment: production
   WARNING: Do not use the development server in a production environment.
   Use a production WSGI server instead.
 * Debug mode: off
 * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
127.0.0.1 - - [08/Feb/2019 09:55:45] "GET / HTTP/1.1" 302 -
127.0.0.1 - - [08/Feb/2019 09:55:45] "GET /files HTTP/1.1" 200 -
127.0.0.1 - - [08/Feb/2019 09:55:46] "GET /static/css/base.css HTTP/1.1" 304 -
127.0.0.1 - - [08/Feb/2019 09:55:46] "GET /static/js/vendor/popper.min.js HTTP/1.1" 304 -
127.0.0.1 - - [08/Feb/2019 09:55:46] "GET /static/css/vendor/bootstrap.min.css HTTP/1.1" 304 -
127.0.0.1 - - [08/Feb/2019 09:55:46] "GET /static/js/vendor/jquery-3.3.1.min.js HTTP/1.1" 304 -
127.0.0.1 - - [08/Feb/2019 09:55:46] "GET /static/js/vendor/bootstrap.min.js HTTP/1.1" 304 -
127.0.0.1 - - [08/Feb/2019 09:55:46] "GET /static/js/files.js HTTP/1.1" 304 - 127.0.0.1 - - [08/Feb/2019 09:55:47] "GET /static/favicon.ico HTTP/1.1" 200 -
127.0.0.1 - - [08/Feb/2019 09:56:02] "POST /files HTTP/1.1" 200 - 127.0.0.1 - - [08/Feb/2019 09:56:02] "GET /workspaces/e82d55e3-6832-447c-b0de-255d519d8c90 HTTP/1.1" 200 -
127.0.0.1 - - [08/Feb/2019 09:56:02] "GET /static/css/vendor/fontawesome.css HTTP/1.1" 200 -
127.0.0.1 - - [08/Feb/2019 09:56:02] "GET /static/css/vendor/jquery.selectareas.css HTTP/1.1" 200 -
127.0.0.1 - - [08/Feb/2019 09:56:02] "GET /static/css/workspace.css HTTP/1.1" 200 -
127.0.0.1 - - [08/Feb/2019 09:56:02] "GET /static/css/vendor/jquery-ui.structure.min.css HTTP/1.1" 200 -
127.0.0.1 - - [08/Feb/2019 09:56:02] "GET /static/css/vendor/jquery-ui.theme.min.css HTTP/1.1" 200 -
127.0.0.1 - - [08/Feb/2019 09:56:02] "GET /static/css/vendor/jquery-ui.min.css HTTP/1.1" 200 -
127.0.0.1 - - [08/Feb/2019 09:56:02] "GET /static/js/vendor/jquery.selectareas.min.js HTTP/1.1" 304 -
127.0.0.1 - - [08/Feb/2019 09:56:03] "GET /static/js/workspace.js HTTP/1.1" 304-
127.0.0.1 - - [08/Feb/2019 09:56:03] "GET /static/js/vendor/jquery-ui.min.js HTTP/1.1" 304 -
Traceback (most recent call last):
  File "c:\users\myusername\appdata\local\continuum\anaconda3\lib\site-packages\excalibur\executors\sequential_executor.py", line 12, in execute_command
    subprocess.check_call(command, stderr=subprocess.STDOUT, close_fds=True)
  File "c:\users\myusername\appdata\local\continuum\anaconda3\lib\subprocess.py",
line 286, in check_call
    retcode = call(*popenargs, **kwargs)
  File "c:\users\myusername\appdata\local\continuum\anaconda3\lib\subprocess.py",
line 267, in call
    with Popen(*popenargs, **kwargs) as p:
  File "c:\users\myusername\appdata\local\continuum\anaconda3\lib\subprocess.py",
line 624, in __init__
    "close_fds is not supported on Windows platforms"
ValueError: close_fds is not supported on Windows platforms if you redirect stdin/stdout/stderr

Version information

(base) C:\Users\myusername>python
Python 3.6.4 |Anaconda, Inc.| (default, Jan 16 2018, 10:22:32) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import platform; print(platform.platform())
Windows-7-6.1.7601-SP1
>>> import sys; print('Python', sys.version)
Python 3.6.4 |Anaconda, Inc.| (default, Jan 16 2018, 10:22:32) [MSC v.1900 64 bit (AMD64)]
>>> import numpy; print('NumPy', numpy.__version__)
NumPy 1.14.2
>>> import cv2; print('OpenCV', cv2.__version__)
OpenCV 4.0.0
>>> import excalibur; print('Excalibur', excalibur.__version__)
Excalibur 0.4.2

@vm-asd2015
Copy link

I've just found another project's solution to this issue here.

@vinayak-mehta
Copy link
Member

@vm-asd2015 Would you like to open a PR?

@Sijiu
Copy link

Sijiu commented Jun 27, 2019

great!

@zhengyyi
Copy link

after I change the code according to close_fds incompatibility on windows platform, I encounter this problem:

GPL Ghostscript 9.52: Unrecoverable error, exit code 1
ERROR:root:-100
Traceback (most recent call last):
  File "C:\Users\zheng\Documents\lenovoJob\project file\excalibur\excalibur\executors\sequential_executor.py", line 13, in execute_command
    subprocess.check_call(command, stderr=subprocess.STDOUT, close_fds=(sys.platform != 'win32'))
  File "C:\Users\zheng\Anaconda3\envs\excalibur\lib\subprocess.py", line 306, in check_call
    retcode = call(*popenargs, **kwargs)
  File "C:\Users\zheng\Anaconda3\envs\excalibur\lib\subprocess.py", line 287, in call
    with Popen(*popenargs, **kwargs) as p:
  File "C:\Users\zheng\Anaconda3\envs\excalibur\lib\subprocess.py", line 729, in __init__
    restore_signals, start_new_session)
  File "C:\Users\zheng\Anaconda3\envs\excalibur\lib\subprocess.py", line 1017, in _execute_child
    startupinfo)
FileNotFoundError: [WinError 2] The system cannot find the specified file

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\zheng\Documents\lenovoJob\project file\excalibur\excalibur\tasks.py", line 77, in split
    with Ghostscript(*gs_call, stdout=null) as gs:
  File "C:\Users\zheng\Documents\lenovoJob\project file\excalibur\excalibur\camelot\ext\ghostscript\__init__.py", line 95, in Ghostscript
    stderr=kwargs.get("stderr", None),
  File "C:\Users\zheng\Documents\lenovoJob\project file\excalibur\excalibur\camelot\ext\ghostscript\__init__.py", line 39, in __init__
    rc = gs.init_with_args(instance, args)
  File "C:\Users\zheng\Documents\lenovoJob\project file\excalibur\excalibur\camelot\ext\ghostscript\_gsprint.py", line 173, in init_with_args
    raise GhostscriptError(rc)
excalibur.camelot.ext.ghostscript._gsprint.GhostscriptError: -100

foarsitter added a commit that referenced this issue Jul 15, 2023
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

No branches or pull requests

5 participants