diff --git a/osc_plugin_dput/main.py b/osc_plugin_dput/main.py index 1ff6ed8a2eeefa185cfc380192624407761bd5f8..ac8a533b7c23028ca2f56741819adb604b89c214 100644 --- a/osc_plugin_dput/main.py +++ b/osc_plugin_dput/main.py @@ -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'))