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
Taking screenshot or recording crashes the game #11
Comments
The filename for captured images is decided in the _get_capture_filename method in app.py. If there's some way to get the path to the desktop on Linux, I'll add the code for that. And if there's no common way for that, I think the home directory can be used instead of the desktop. Do you know how to get the desktop path on Linux? (I hope it's not different for each distribution.) |
Both
and
Worked for me on Ubuntu and Fedora, I don't know if it works on all distribution though. |
I fixed it and released as 0.7.4. |
If you use that, please add a fallback, an external tool like
|
Well this is not the actual code: Line 362 in d73c3aa
|
@Godzil I was afraid that something like that would happen.
|
@JeanAraujo @Godzil |
Works for me, but I would first like @Godzil and @vesche thoughts on this 🤔 |
@kitao As you must know there is not just one Linux distribution, and not all necessarily provide the same set of tools. xdg-user-dir is not a tool installed by default on all distributions, on one of my computer, this tool does not exist, so relying only on it is not a good idea. @JeanAraujo seems to be a good solution, try if the tool works, if not, fallback using the user folder, apart from missing Mac OS X, xdg-user is clearly not supported under Mac OS X. |
Oh, that's true, @Godzil
Well, this code looks a bit... extensive, but it supposedly works. I can't use a linux system at the moment so I'll check it later. |
I imported the above code and released it as 0.7.5. |
Changed, tested and solved on #32. |
My Ubuntu is in Portuguese and when I try to take a screenshot or record a gif, the game crashes trying to create a file:
File "/home/jean/Documentos/pyxel-debug/lib/python3.6/site-packages/PIL/Image.py", line 1947, in save fp = builtins.open(filename, "w+b") FileNotFoundError: [Errno 2] No such file or directory: '/home/jean/Desktop/pyxel-180731-095749.gif'
If I create a Desktop folder on my home directory the problem is solved, but I don't that's a good solution.☺️
An alternative would be creating a subfolder inside the game's current directory. I would do a pull request, but even that being pretty simple, I think that's more like a design decision, so it's up to you
The text was updated successfully, but these errors were encountered: