Skip to content

Commit

Permalink
Check file permissions before attempting to write
Browse files Browse the repository at this point in the history
In case of insufficient permissions, a RuntimeError including
a description of the problem and possible solutions is raised.

This resolves issue #16
  • Loading branch information
Julius Neuffer committed Oct 28, 2016
1 parent 9862ee9 commit 7bc522a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tsfresh/examples/robot_execution_failures.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ def download_robot_execution_failures():
if os.path.exists(data_file_name):
_logger.warning("You have already downloaded the Robot Execution Failures LP1 Data Set.")
return

if not os.access(module_path, os.W_OK):
raise RuntimeError("You don't have the necessary permissions to download the Robot Execution Failures LP1 Data Set into the module path. Consider installing the module in a virtualenv virtualenv you own or run this function with appropriate permissions.")

os.makedirs(os.path.dirname(data_file_name))

Expand Down

0 comments on commit 7bc522a

Please sign in to comment.