Skip to content

Can't compare relative paths to absolute paths - #193

Merged
ColdHeat merged 3 commits into
CTFd:masterfrom
mew1033:paths
Nov 10, 2025
Merged

ColdHeat merged 3 commits into
CTFd:masterfrom
mew1033:paths

Conversation

@mew1033

@mew1033 mew1033 commented Nov 7, 2025

Copy link
Copy Markdown
Contributor

I think this is the right way to fix the error? When a challenge is a relative path, I get:

  File "/home/.../.env/lib/python3.13/site-packages/ctfcli/cli/challenges.py", line 751, in deploy
    f"({challenge_instance.challenge_file_path.relative_to(config.project_path)}) "
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.13/pathlib/_local.py", line 385, in relative_to
    raise ValueError(f"{str(self)!r} is not in the subpath of {str(other)!r}")
ValueError: 'relative/path/challenge.yml' is not in the subpath of '/home/user/Borg/ctf-root'

@ColdHeat

ColdHeat commented Nov 7, 2025

Copy link
Copy Markdown
Member

I believe I saw this error in a prior release but this might be a different instance of it. I haven't had much time to dig into PRs but I know there's a build up of them. Will get to them this weekend or next week 🤞

@ColdHeat

Copy link
Copy Markdown
Member

Since this is a simple logging message I had just changed it to the full file path: 7393941

@ColdHeat
ColdHeat merged commit 71f7cb7 into CTFd:master Nov 10, 2025
8 checks passed
@mew1033
mew1033 deleted the paths branch September 17, 2026 19:06
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