Community Packages

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#57112 - [renpy] Missing tmp directory results in the creation of broken new projects

Attached to Project: Community Packages
Opened by Klaus Borges (spaceporn) - Tuesday, 16 January 2018, 14:46 GMT
Last edited by Maxime Gauduin (Alucryd) - Wednesday, 13 June 2018, 21:01 GMT
Task Type Bug Report
Category Upstream Bugs
Status Closed
Assigned To Maxime Gauduin (Alucryd)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:
Ren'Py's built-in launcher fails when creating a project and after raising an exception leaves an incomplete new project which fails to load. The output of running renpy on a terminal shows that `/usr/share/renpy/tmp` doesn't exist; creating the missing directory with `sudo` raises a permission error. I believe the workaround relies on creating the directory via PKGBUILD and setting the correct permissions.

Additional info:

Exception raised with no prior steps taken:

I'm sorry, but an uncaught exception occurred.

While running game code:
File "launcher/game/gui7.rpy", line 440, in script call
call update_renpy_strings_common
File "launcher/game/translations.rpy", line 310, in script
python:
File "launcher/game/translations.rpy", line 316, in <module>
renpy.translation.extract.extract_strings_core(language, get_strings_json())
File "launcher/game/translations.rpy", line 65, in get_strings_json
with open(write_test, "w"):
IOError: [Errno 2] No such file or directory: u'/usr/share/renpy/tmp/writetest.txt'

-- Full Traceback ------------------------------------------------------------

Full traceback:
File "launcher/game/gui7.rpy", line 440, in script call
call update_renpy_strings_common
File "launcher/game/translations.rpy", line 310, in script
python:
File "/usr/share/renpy/renpy/ast.py", line 827, in execute
renpy.python.py_exec_bytecode(self.code.bytecode, self.hide, store=self.store)
File "/usr/share/renpy/renpy/python.py", line 1764, in py_exec_bytecode
exec bytecode in globals, locals
File "launcher/game/translations.rpy", line 316, in <module>
renpy.translation.extract.extract_strings_core(language, get_strings_json())
File "launcher/game/translations.rpy", line 65, in get_strings_json
with open(write_test, "w"):
IOError: [Errno 2] No such file or directory: u'/usr/share/renpy/tmp/writetest.txt'

Linux-4.14.13-1-ARCH-x86_64-with-glibc2.2.5
Ren'Py 6.99.13.2919
Ren'Py Launcher 6.99.13.2919


Exception raised after creating the missing directory with root permissions:

I'm sorry, but an uncaught exception occurred.

While running game code:
File "launcher/game/gui7.rpy", line 440, in script call
call update_renpy_strings_common
File "launcher/game/translations.rpy", line 310, in script
python:
File "launcher/game/translations.rpy", line 316, in <module>
renpy.translation.extract.extract_strings_core(language, get_strings_json())
File "launcher/game/translations.rpy", line 65, in get_strings_json
with open(write_test, "w"):
IOError: [Errno 13] Permission denied: u'/usr/share/renpy/tmp/writetest.txt'

-- Full Traceback ------------------------------------------------------------

Full traceback:
File "launcher/game/gui7.rpy", line 440, in script call
call update_renpy_strings_common
File "launcher/game/translations.rpy", line 310, in script
python:
File "/usr/share/renpy/renpy/ast.py", line 827, in execute
renpy.python.py_exec_bytecode(self.code.bytecode, self.hide, store=self.store)
File "/usr/share/renpy/renpy/python.py", line 1764, in py_exec_bytecode
exec bytecode in globals, locals
File "launcher/game/translations.rpy", line 316, in <module>
renpy.translation.extract.extract_strings_core(language, get_strings_json())
File "launcher/game/translations.rpy", line 65, in get_strings_json
with open(write_test, "w"):
IOError: [Errno 13] Permission denied: u'/usr/share/renpy/tmp/writetest.txt'

Linux-4.14.13-1-ARCH-x86_64-with-glibc2.2.5
Ren'Py 6.99.13.2919
Ren'Py Launcher 6.99.13.2919


Steps to reproduce:
This task depends upon

Closed by  Maxime Gauduin (Alucryd)
Wednesday, 13 June 2018, 21:01 GMT
Reason for closing:  Fixed
Additional comments about closing:  6.99.14.3-1
Comment by Klaus Borges (spaceporn) - Tuesday, 16 January 2018, 14:58 GMT
Enter key apparently became sentient (or chalk it up to fat fingers) and sent out the post with unedited code tags from Ren'Py's exception handler and unfinished title, it should say "Missing tmp directory results in the creation of broken new projects." I cannot edit the report, so I'm adding this errata here. Steps to reproduce are just installing the renpy package (with or without renpy-demos) and attempt to create a new project. /usr/share/renpy/tmp is simply not created upon install (and needs the correct permissions to work properly). I've checked the changelog for the minor version bump (package is flagged out of date) and that wasn't fixed upstream, it seems to be a packaging issue.
Comment by Eli Schwartz (eschwartz) - Tuesday, 16 January 2018, 16:17 GMT
  • Field changed: Summary ([renpy] Missing tmp directory doesn → [renpy] Missing tmp directory results in the creation of broken new projects)
  • Field changed: Details
  • Field changed: Status (Unconfirmed → Assigned)
  • Field changed: Category (Packages → Upstream Bugs)
  • Field changed: Architecture (x86_64 → All)
  • Task assigned to Maxime Gauduin (Alucryd)
My question is, why does it want to use a directory in /usr/share/ at all? Surely it should use one in ${XDG_DATA_HOME:-$HOME/.local/share} for per-user data.

Please file an upstream bugreport, as this seems like incredibly wrong behavior altogether.
Comment by Klaus Borges (spaceporn) - Tuesday, 16 January 2018, 17:32 GMT
Thanks for the quick response! Indeed, this default behavior does seem unreasonable.

For reference, even though I don't have a desktop environment, my environment seems sane enough:

% echo $XDG_DATA_HOME
/home/klaus/.local/share
% echo $HOME
/home/klaus

Upon further inspection of the codebase, I found:

basedir = None [1]

Which resides on a config.py file that is imported and called on the following try block:

try:
tempdir = os.path.join(config.basedir, "tmp") [2]

I will file the bug report upstream, I left the details here since I don't know if it's necessary to re-tag this report somehow.

[1]: https://github.com/renpy/renpy/blob/c3b9db09eda159f7d99ac6c2d3eaa9830056bfd7/renpy/config.py#L383
[2]: https://github.com/renpy/renpy/blob/c3b9db09eda159f7d99ac6c2d3eaa9830056bfd7/launcher/game/translations.rpy#L53
Comment by Klaus Borges (spaceporn) - Wednesday, 13 June 2018, 20:28 GMT
The line responsible for causing this was found and reported in the issue [1] and it was fixed on a commit [2] which was tagged all the way back to 6.99.14.2.3237 (as of writing, the version on the repos is 6.99.14.3-1). I've just tested and the issue is not present anymore, I hope there's no issue in reporting that it's fixed this late.

[1] https://github.com/renpy/renpy/issues/1357#issuecomment-364270059
[2] https://github.com/renpy/renpy/commit/3846bcdeb9238eea2047dbe6098a35bde970a6ea
Comment by Maxime Gauduin (Alucryd) - Wednesday, 13 June 2018, 21:01 GMT
No problem, thanks for the heads up!

Loading...