#2815 closed bug (Fixed)
Path inconsistency while escaping whitespace
Reported by: | Joe96 | Owned by: | Calum |
---|---|---|---|
Priority: | minor | Milestone: | 1.3.13 |
Component: | Console UI | Version: | 1.3.12 |
Keywords: | Cc: |
Description
While adding a torrent using a command similar to this:
deluge-console add -p 'C:\Path\With Spaces' D:\my_torrent_file.torrent
, if what the torrent downloads contains folders, the download path will be something like this:
C:\\Path\\With Spaces\\torrent_folder\torrent_file.txt
And that single slash ("\") is inconsistent with the others, therefore, deluge returns the error
The filename, directory name, or volume label syntax is incorrect: C:\\Path\\With Spaces\\torrent_folder\torrent_file.txt
Paths containing no white spaces, or torrents that do not have a folder in their download do not have this issue.
Attachments (1)
Change History (9)
by , 8 years ago
comment:3 by , 8 years ago
Actually, you're right. I excluded the os.path.expanduser because i don't need it. The reason i used the deluge-console add command was because i wanted to make a python script that adds new torrents automatically, and the path i provide is always the full path, but to address this bug, the correct fix would be
t_options["download_location"] = os.path.abspath(os.path.expanduser(options["path"]))
comment:4 by , 8 years ago
Milestone: | 1.3.x → 1.3.13 |
---|---|
Owner: | set to |
Status: | new → accepted |
comment:5 by , 8 years ago
Just to note abspath
calls `normpath` which is what actually fixes this issue. It's helpful however using abspath
in this case as a relative folder could also be provided.
comment:6 by , 8 years ago
Milestone: | 1.3.13 → 2.0 |
---|
Fixed 1.3-stable: [a1e66a4dc154]
Will also need fixing in develop
comment:8 by , 8 years ago
Milestone: | 2.0 → 1.3.13 |
---|
In
on line 62, there is:
I changed that to
And it seems to work fine. abspath turns the double slashes into single slashes, while expanduser doesn't.