Skip to content
Snippets Groups Projects
Commit e5fd78d0 authored by Ryan Gonzalez's avatar Ryan Gonzalez
Browse files

Fix double-escaping of path segments on 1.6.1+

As of:

https://github.com/openSUSE/osc/commit/3f14cef53a853296d7f60bf7b14eb86615842cf9



`osc.core.makeurl` will escape path comonents itself, so calling
`pathname2url` ends up double-escaping, resulting in 404 errors with
filenames that have special characters.

Signed-off-by: default avatarRyan Gonzalez <ryan.gonzalez@collabora.com>
parent 8de5d843
No related branches found
No related tags found
1 merge request!11Fix double-escaping of path segments on 1.6.1+
Pipeline #111756 failed
......@@ -192,13 +192,18 @@ def do_dput(self, subcmd, opts, *args):
superseded = set()
retained = set()
# osc <1.6.1 doesn't automatically escape path members.
should_escape_filename = osc.core.makeurl('', ['+']) == '/+'
for f in remote_file_list.keys():
if f.endswith('.dsc'):
u = osc.core.makeurl(conf.config['apiurl'],
['source',
proj_name,
package_name,
pathname2url(f)],
pathname2url(f)
if should_escape_filename
else f],
query={})
remote_dsc = Dsc(osc.core.streamfile(u, bufsize='line'))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment