Skip to content

Refactor run_custom_user_commands - #4668

Merged
svartkanin merged 1 commit into
archlinux:masterfrom
codefiles:run-custom-user-commands
Jul 25, 2026
Merged

Refactor run_custom_user_commands#4668
svartkanin merged 1 commit into
archlinux:masterfrom
codefiles:run-custom-user-commands

Conversation

@codefiles

Copy link
Copy Markdown
Contributor

With #2026, the issue was misdiagnosed.

On the pathlib slash operator:

If the argument is an absolute path, the previous path is ignored.

Source: https://docs.python.org/3/library/pathlib.html#operators

Example of the problem, script_path as an absolute path:

>>> from pathlib import Path
>>> target = Path('/mnt')
>>> script_path = '/var/tmp/user-command.sh'
>>> target / script_path
PosixPath('/var/tmp/user-command.sh')

This fails to produce the intended /mnt/var/tmp/user-command.sh.

script_path as a relative path (without the / prefix):

>>> from pathlib import Path
>>> target = Path('/mnt')
>>> script_path = 'var/tmp/user-command.sh'
>>> target / script_path
PosixPath('/mnt/var/tmp/user-command.sh')

@codefiles
codefiles requested a review from Torxed as a code owner July 25, 2026 02:25
@svartkanin
svartkanin merged commit fe16238 into archlinux:master Jul 25, 2026
11 checks passed
@codefiles
codefiles deleted the run-custom-user-commands branch July 25, 2026 12:31
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

Successfully merging this pull request may close these issues.

2 participants