Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PermissionError with system-wide spoon install #4

Open
wvengen opened this issue Mar 9, 2020 · 0 comments
Open

PermissionError with system-wide spoon install #4

wvengen opened this issue Mar 9, 2020 · 0 comments

Comments

@wvengen
Copy link

wvengen commented Mar 9, 2020

On a Linux system, when you install spoon, it raises a PermissionError on the logfile on loading.

  1. pip3 install spoonproxy
  2. any code loading e.g. the Manager will raise an error
    example: python3 -m spoon_server.main.manager

The following error is raised:

Traceback (most recent call last):
  File "/usr/lib/python3.7/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.7/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/usr/local/lib/python3.7/dist-packages/spoon_server/main/manager.py", line 5, in <module>
    from spoon_server.proxy.fetcher import Fetcher
  File "/usr/local/lib/python3.7/dist-packages/spoon_server/proxy/fetcher.py", line 2, in <module>
    from spoon_server.proxy.ip3366_provider import IP3366Provider
  File "/usr/local/lib/python3.7/dist-packages/spoon_server/proxy/ip3366_provider.py", line 2, in <module>
    from spoon_server.util.html_parser import get_html_tree
  File "/usr/local/lib/python3.7/dist-packages/spoon_server/util/html_parser.py", line 6, in <module>
    from spoon_server.util.logger import log
  File "/usr/local/lib/python3.7/dist-packages/spoon_server/util/logger.py", line 10, in <module>
    log_file_handler = TimedRotatingFileHandler(filename=os.path.join(log_path, "spoon.log"), when="D", interval=1)
  File "/usr/lib/python3.7/logging/handlers.py", line 199, in __init__
    BaseRotatingHandler.__init__(self, filename, 'a', encoding, delay)
  File "/usr/lib/python3.7/logging/handlers.py", line 54, in __init__
    logging.FileHandler.__init__(self, filename, mode, encoding, delay)
  File "/usr/lib/python3.7/logging/__init__.py", line 1092, in __init__
    StreamHandler.__init__(self, self._open())
  File "/usr/lib/python3.7/logging/__init__.py", line 1121, in _open
    return open(self.baseFilename, self.mode, encoding=self.encoding)
PermissionError: [Errno 13] Permission denied: '/usr/local/lib/python3.7/dist-packages/spoon_server/spoon.log'

This looks like a debugging left-over. I'd suggest to specify no default logging output, but leave that to the user of this package.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant