Skip to content

🐛 fix(unix): drop a backslash before a user-dirs.dirs line break - #721

Merged
gaborbernat merged 1 commit into
tox-dev:mainfrom
gaborbernat:fix/user-dirs-line-end
Nov 17, 2026
Merged

gaborbernat merged 1 commit into
tox-dev:mainfrom
gaborbernat:fix/user-dirs-line-end

Conversation

@gaborbernat

Copy link
Copy Markdown
Member

Main has failed every test job since 4.14.6 (run), and 4.14.6 keeps the backslash in an unquoted user-dirs.dirs value such as XDG_DOCUMENTS_DIR=$HOME/Docs\ followed by a line break, so the folder name ends in \. 🔧 Once this merges, that backslash is dropped and main is green again.

#712 strips the whole line ending before a line is matched, while #716 keeps a backslash only when nothing follows it in the file. Each passed on its own; together, a backslash before a line break looked like one at the end of the file. The reader now drops only the carriage return of a Windows line ending and keeps the line feed, so the two cases stay apart. A backslash at the very end of the file is still kept, as the shell keeps it.

Since tox-dev#712 strips the whole line ending before matching, the backslash
tox-dev#716 keeps only at the end of the file also matched before a newline,
so $HOME/Docs\ followed by a line break kept its backslash.
@gaborbernat
gaborbernat requested a review from ofek as a code owner November 17, 2026 19:47
@gaborbernat gaborbernat added the bug Something isn't working label Nov 17, 2026
@gaborbernat
gaborbernat merged commit 786757f into tox-dev:main Nov 17, 2026
40 checks passed
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 this pull request may close these issues.

1 participant