Skip to content
This repository has been archived by the owner on Apr 20, 2020. It is now read-only.

failing to write wsk.log due to directory permissions kills script #3

Open
jeremydouglass opened this issue Jul 27, 2018 · 0 comments

Comments

@jeremydouglass
Copy link
Contributor

Currently, running searchcmd.py in a directory with no write permissions causes the script to die when the log file cannot be written to disk.

An alternative might be to write the log file out to wherever the destination directory is specified to be (-o).

jovyan@2dfeff0ab998:/app$ cd /
jovyan@2dfeff0ab998:/$ searchcmd.py -q /data/queries/queries_test_nyt.csv -o /data/test/
Traceback (most recent call last):
  File "/app/searchcmd.py", line 35, in <module>
    main(ARGS)
  File "/app/searchcmd.py", line 20, in main
    outpath=args.outpath, zip_output=args.zip)
  File "/app/search.py", line 195, in search_querylist
    zip_output=zip_output
  File "/app/search.py", line 68, in search_query
    logging.info(slug)
  File "/usr/local/lib/python3.6/logging/__init__.py", line 1901, in info
    root.info(msg, *args, **kwargs)
  File "/usr/local/lib/python3.6/logging/__init__.py", line 1307, in info
    self._log(INFO, msg, args, **kwargs)
  File "/usr/local/lib/python3.6/logging/__init__.py", line 1443, in _log
    self.handle(record)
  File "/usr/local/lib/python3.6/logging/__init__.py", line 1453, in handle
    self.callHandlers(record)
  File "/usr/local/lib/python3.6/logging/__init__.py", line 1515, in callHandlers
    hdlr.handle(record)
  File "/usr/local/lib/python3.6/logging/__init__.py", line 864, in handle
    self.emit(record)
  File "/usr/local/lib/python3.6/logging/__init__.py", line 1070, in emit
    self.stream = self._open()
  File "/usr/local/lib/python3.6/logging/__init__.py", line 1060, in _open
    return open(self.baseFilename, self.mode, encoding=self.encoding)
PermissionError: [Errno 13] Permission denied: '/wsk.log'
jovyan@2dfeff0ab998:/$
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant