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

Windows compat? #2249

Closed
AndreLouisCaron opened this issue Jul 4, 2017 · 3 comments
Closed

Windows compat? #2249

AndreLouisCaron opened this issue Jul 4, 2017 · 3 comments

Comments

@AndreLouisCaron
Copy link

Thanks for posting this tool, looks very promising!

I just tried this on Windows and I got an error:

  safety\formatter.py", line 27, in get_terminal_size
    rows, columns = subprocess.check_output(['stty', 'size']).split()
WindowsError: [Error 2] Le fichier spécifié est introuvable

I guess the stty command is not available on Windows. There is an API to get this information. Would you be willing to accept a patch to fix this?

Thanks!

@jayfk
Copy link
Contributor

jayfk commented Jul 4, 2017

Hey @AndreLouisCaron!

Thanks for raising this issue. I've tried to make this as compatible as possible, looks like I've missed something.

The code is here: https://github.com/pyupio/safety/blob/master/safety/formatter.py#L12-L34

I'd be super happy to review a patch that fixes this :).

@AndreLouisCaron
Copy link
Author

OK, seems like the fix might be simple. From what I see, the code catches FileNotFoundError, but the exception raised on Python 2.7 is WindowsError (a subclass of OSError). I just made a local change in my installed copy and I get the safety report.

Pull request should be coming in soon :-)

@AndreLouisCaron
Copy link
Author

Seems like I reported this on the wrong project. Will close this one and re-open under pyupio/safety.

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

2 participants