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

Strange error when upgrading to 2.3.3 #1572

Closed
pgjones opened this issue Dec 15, 2022 · 3 comments · Fixed by j178/pdm#1
Closed

Strange error when upgrading to 2.3.3 #1572

pgjones opened this issue Dec 15, 2022 · 3 comments · Fixed by j178/pdm#1
Labels
🐛 bug Something isn't working

Comments

@pgjones
Copy link
Contributor

pgjones commented Dec 15, 2022

I'm running the following in a docker container as a non-root user,

pdm run -v hypercorn --config hypercorn.toml backend.run:app
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/pathlib.py", line 1175, in mkdir
    self._accessor.mkdir(self, mode)
FileNotFoundError: [Errno 2] No such file or directory: '/nonexistent/.config/pdm/pep582'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.10/pathlib.py", line 1175, in mkdir
    self._accessor.mkdir(self, mode)
FileNotFoundError: [Errno 2] No such file or directory: '/nonexistent/.config/pdm'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.10/pathlib.py", line 1175, in mkdir
    self._accessor.mkdir(self, mode)
FileNotFoundError: [Errno 2] No such file or directory: '/nonexistent/.config'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/ve/bin/pdm", line 8, in <module>
    sys.exit(main())
  File "/ve/lib/python3.10/site-packages/pdm/core.py", line 258, in main
    return Core().main(args)
  File "/ve/lib/python3.10/site-packages/pdm/core.py", line 190, in main
    raise cast(Exception, err).with_traceback(traceback)
  File "/ve/lib/python3.10/site-packages/pdm/core.py", line 185, in main
    f(project, options)
  File "/ve/lib/python3.10/site-packages/pdm/cli/commands/run.py", line 391, in handle
    exit_code = runner.run(options.command, options.args)
  File "/ve/lib/python3.10/site-packages/pdm/cli/commands/run.py", line 324, in run
    return self._run_process(
  File "/ve/lib/python3.10/site-packages/pdm/cli/commands/run.py", line 167, in _run_process
    pythonpath = [get_pep582_path(project)] + [
  File "/ve/lib/python3.10/site-packages/pdm/cli/utils.py", line 735, in get_pep582_path
    script_dir.mkdir(parents=True, exist_ok=True)
  File "/usr/local/lib/python3.10/pathlib.py", line 1179, in mkdir
    self.parent.mkdir(parents=True, exist_ok=True)
  File "/usr/local/lib/python3.10/pathlib.py", line 1179, in mkdir
    self.parent.mkdir(parents=True, exist_ok=True)
  File "/usr/local/lib/python3.10/pathlib.py", line 1179, in mkdir
    self.parent.mkdir(parents=True, exist_ok=True)
  File "/usr/local/lib/python3.10/pathlib.py", line 1175, in mkdir
    self._accessor.mkdir(self, mode)
PermissionError: [Errno 13] Permission denied: '/nonexistent'
$ ls /nonexistent
ls: cannot access '/nonexistent': No such file or directory

before 2.3.3 (with 2.3.2) this worked. I'm not sure what is going wrong here - any pointers?

@pgjones pgjones added the 🐛 bug Something isn't working label Dec 15, 2022
@frostming
Copy link
Collaborator

Yes, it is caused by #1567. PDM tries to write the PEP 582 sitecustomize.py file into a user config directory. While in your exact case the home dir doesn't exist and isn't writable.

@pgjones
Copy link
Contributor Author

pgjones commented Dec 16, 2022

Is the location PDM tries to write the PEP 582 sitecustomize.py file customisable?

@frostming
Copy link
Collaborator

Yes:

 -c CONFIG, --config CONFIG
                        Specify another config file path(env var: PDM_CONFIG_FILE)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants