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 crash on OSX when calling grab_to_file #39

Closed
theshinyknight opened this issue Feb 13, 2017 · 1 comment
Closed

Python crash on OSX when calling grab_to_file #39

theshinyknight opened this issue Feb 13, 2017 · 1 comment

Comments

@theshinyknight
Copy link

Hi,
I did install pyscreenshot on my mac running OSX 10.11. The machine is stock OSX so it has python 2.7. I did run the installer via sudo pip install pyscreenshot

If I run python from console, and import pyscreenshot, I can grab the screenshot and have it correctly saved on the location that I specify. Although the issue seems to happen when I use pyscreenshot inside a unit test, which is executed via py.test.

The import run fine; the test begin and start to execute; then when I run

pyscreenshot.grab_to_file(/Users/testuser/Desktop/test1.png")

OSX give me a "Python quit unexpetedly" prompt; which does not happen if I remove the call to the screenshot.

I run the unit test with the py.test command

py.test mytest.py

the test is a very basic unittest.TestCase class, all that it does is to open an application and then try to take a screenshot.

Is this a known issue? Since it seems to work fine via console, I assume that it must be an issue with either py.test or unittest? I did try to use childprocess=True BTW, without luck.

@ponty
Copy link
Owner

ponty commented Feb 13, 2017

Please read first #38

@ponty ponty closed this as completed Dec 20, 2018
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