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

Regression: updating shebang in binary files #1827

Closed
1 task done
pawamoy opened this issue Apr 9, 2023 · 1 comment · Fixed by j178/pdm#1
Closed
1 task done

Regression: updating shebang in binary files #1827

pawamoy opened this issue Apr 9, 2023 · 1 comment · Fixed by j178/pdm#1
Labels
🐛 bug Something isn't working

Comments

@pawamoy
Copy link
Contributor

pawamoy commented Apr 9, 2023

  • I have searched the issue tracker and believe that this is not a duplicate.

Issue

PR #1710 was overwritten by commit 146daa2.

Actual behavior

% pdm use -f python3.9 -v 
Using the last selection, add '-i' to ignore it.
Using Python interpreter: /home/pawamoy/.basher-packages/pyenv/pyenv/shims/python3.9 (3.9)
Using __pypackages__ because non-venv Python is used.
Updating executable scripts...
Traceback (most recent call last):
  File "/home/pawamoy/.local/bin/pdm", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/home/pawamoy/.local/pipx/venvs/pdm/lib/python3.11/site-packages/pdm/core.py", line 255, in main
    return Core().main(args)
           ^^^^^^^^^^^^^^^^^
  File "/home/pawamoy/.local/pipx/venvs/pdm/lib/python3.11/site-packages/pdm/core.py", line 193, in main
    raise cast(Exception, err).with_traceback(traceback) from None
  File "/home/pawamoy/.local/pipx/venvs/pdm/lib/python3.11/site-packages/pdm/core.py", line 188, in main
    self.handle(project, options)
  File "/home/pawamoy/.local/pipx/venvs/pdm/lib/python3.11/site-packages/pdm/core.py", line 154, in handle
    command.handle(project, options)
  File "/home/pawamoy/.local/pipx/venvs/pdm/lib/python3.11/site-packages/pdm/cli/commands/use.py", line 31, in handle
    actions.do_use(
  File "/home/pawamoy/.local/pipx/venvs/pdm/lib/python3.11/site-packages/pdm/cli/actions.py", line 666, in do_use
    project.environment.update_shebangs(selected_python.executable.as_posix())
  File "/home/pawamoy/.local/pipx/venvs/pdm/lib/python3.11/site-packages/pdm/environments/local.py", line 94, in update_shebangs
    child.write_bytes(_replace_shebang(child.read_bytes(), new_shebang))
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/pawamoy/.local/pipx/venvs/pdm/lib/python3.11/site-packages/pdm/environments/local.py", line 45, in _replace_shebang
    assert match is not None
AssertionError

Expected behavior

No error.

Environment Information

# Paste the output of `pdm info && pdm info --env` below:
PDM version:
  2.5.1
Python Interpreter:
  /home/pawamoy/.basher-packages/pyenv/pyenv/versions/3.9.15/bin/python3.9 (3.9)
Project Root:
  /media/data/dev/griffe
Local Packages:
  /media/data/dev/griffe/__pypackages__/3.9
{
  "implementation_name": "cpython",
  "implementation_version": "3.9.15",
  "os_name": "posix",
  "platform_machine": "x86_64",
  "platform_release": "6.2.10-arch1-1",
  "platform_system": "Linux",
  "platform_version": "#1 SMP PREEMPT_DYNAMIC Fri, 07 Apr 2023 02:10:43 +0000",
  "python_full_version": "3.9.15",
  "platform_python_implementation": "CPython",
  "python_version": "3.9",
  "sys_platform": "linux"
}
@pawamoy pawamoy added the 🐛 bug Something isn't working label Apr 9, 2023
@pawamoy
Copy link
Contributor Author

pawamoy commented Apr 10, 2023

Thanks @frostming 🙂

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.

1 participant