Skip to content

[Jobs] Use the script file name as default Job name on Windows paths - #5388

Open
Wauplin wants to merge 2 commits into
mainfrom
Wauplin/huggingface-hub-private-note-huggingface-hub-335fb3a9
Open

Wauplin wants to merge 2 commits into
mainfrom
Wauplin/huggingface-hub-private-note-huggingface-hub-335fb3a9

Conversation

@Wauplin

@Wauplin Wauplin commented Nov 19, 2026 •

Copy link
Copy Markdown
Collaborator

Fixes #5359. Alternative to #5360 (thanks @inchang-ing, same fix, without the added test).

_default_job_name_from_script only split on /, so on Windows .\train.py gave --train-<hash> and C:\Users\alice\...\train.py leaked the whole path into the Job name. It now splits on both / and \. The hash input is unchanged.

'.\\train.py'                              -> train-2e746d5d   (was --train-...)
'C:\\Users\\alice\\projects\\sft\\train.py' -> train-5dc62f91   (was C--Users-alice-projects-sft-train-...)
'scripts/train.py'                         -> train-0e048206   (unchanged)
'https://x.co/a/sft.py?raw=1'              -> sft-fdafee7e     (unchanged)

No new test: the change is 1 line. Existing Jobs tests pass locally.

Written by Hubert.py Bot via Launchpad, posted automatically


Note

Low Risk
Single-line naming helper change with no API or security impact; behavior on non-Windows paths is intended to stay the same.

Overview
Fixes default Hub Job names when the launch script path uses Windows separators. _default_job_name_from_script now splits on both / and \ (and trims trailing slashes/backslashes) before taking the final segment, so paths like .\train.py or C:\Users\...\train.py yield train-<hash> instead of malformed names that included .. or the full path. Unix and URL-based script paths behave as before; the hash inputs are unchanged.

Reviewed by Cursor Bugbot for commit c44fc48. Bugbot is set up for automated code reviews on this repo. Configure here.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@bot-ci-comment

Copy link
Copy Markdown

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

This branch has not been deployed

No deployments
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.

[Jobs] Auto-generated Job name uses the whole Windows script path (.\train.py -> --train-<hash>)

1 participant