Ticket #2841 (closed enhancement: fixed)

Opened 1 year ago

Last modified 1 year ago

Unexpected pyflakes termination while bad permissions on a .py file

Reported by: chaica Assigned to: exarkun
Priority: high Milestone:
Component: Pyflakes Severity: major
Keywords: Cc:
Estimated Completion (YYYY/MM/DD): Branch: branches/pyflakes-permission-denied-2841
Author: exarkun

Description

Hi,

Reading pyflakes code, I spotted that giving a .py file with bad permissions (try chmod ugo-r test.py && pyflakes test.py) was leading to an unexpected pyflakes termination. Here is a really simple patch to solve this issue, warning the user and exiting with a return value of 1.

Best regards, Carl Chenet, www.ohmytux.com

Attachments

pyflakes.py.diff (261 bytes) - added by chaica on 03/14/09 18:57:13.
patch to solve problem with bad permissions on .py file

Change History

03/14/09 18:57:13 changed by chaica

  • attachment pyflakes.py.diff added.

patch to solve problem with bad permissions on .py file

06/15/09 17:00:54 changed by exarkun

  • branch set to branches/pyflakes-permission-denied-2841.
  • branch_author set to exarkun.

(In [17472]) Branching to 'pyflakes-permission-denied-2841'

06/15/09 17:03:58 changed by exarkun

(In [17473]) Handle IOErrors trying to open and read the file to check

refs #2841

06/15/09 17:06:01 changed by exarkun

  • keywords set to review.
  • owner deleted.

Added a test for this case and simplified the code in the region of the fix at the same time as actually making the fix. Very simple. Please review.

06/17/09 15:37:14 changed by jonathanj

  • keywords deleted.
  • owner set to exarkun.

Looks good. Go ahead and merge.

06/17/09 16:18:07 changed by exarkun

  • status changed from new to closed.
  • resolution set to fixed.

(In [17486]) Merge pyflakes-permission-denied-2841

Author: exarkun Reviewer: jonathanj Fixes: #2841

Handle permission errors when trying to read source files.

jethro@divmod.org