OSError: [Errno 13] Permission denied: '/Configurations2'

Bug #1328139 reported by Gustavo Lepri
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Appy
Medium
Gaëtan Delannay

Bug Description

When we're creating a pdf file using Renderer class In renderer.py, we catch a permission error.

This error occurs because the os.path.join function is considering the second entry as an absolute path.

The latter strings shouldn't start with a slash. If they start with a slash, then they're considered an "absolute path" and everything before them is discarded.

Quoting the Python docs for os.path.join:

If any component is an absolute path, all previous components (on Windows, including the previous drive letter, if there was one) are thrown away, and joining continues.

here the solution for the error:

Line 173:

if zippedFile.startswith('/'):
    os.makedirs(os.path.join(self.unzipFolder, zippedFile[1:]))
else:
    os.makedirs(os.path.join(self.unzipFolder, zippedFile))

Revision history for this message
Gaëtan Delannay (gaetan-delannay) wrote :

Hi Gustavo,
Under Linux, it seems that "zippedFile" never starts with a leading "/". Could you send me more info about your environment? Thanks a lot,
Gaetan

Changed in appy:
importance: Undecided → Medium
assignee: nobody → Gaëtan Delannay (gaetan-delannay)
milestone: none → 0.9.0
status: New → Fix Committed
Changed in appy:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers