← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] ~cjwatson/launchpad:artifactory-quoting-on-deploy into launchpad:master

 

The proposal to merge ~cjwatson/launchpad:artifactory-quoting-on-deploy into launchpad:master has been updated.

Description changed to:

`ArtifactoryPath.deploy_file` and `ArtifactoryPath.set_properties` have two entirely distinct quoting conventions.  Astonishingly, the Python bindings for the former leave this entirely up to the caller without saying so.  Fortunately, all that `deploy_file` needs is URL-quoting according to `urllib.parse.quote_plus`.  Do this.

In the process of fixing this, I noticed that the Artifactory fixture's endpoints don't correctly unquote the URL path, so I fixed that.

Testing against a real instance:

  >>> (testpath / 'pool' / 'base-files_12ubuntu4.1_amd64.deb').deploy_file('/home/cjwatson/base-files_12ubuntu4.1_amd64.deb', parameters={'unquoted': ['foo+bar;baz'], 'backslashquoted': [r'foo\+bar\;baz'], 'urlquoted': [quote_plus('foo+bar;baz')]})
  >>> (testpath / 'pool' / 'base-files_12ubuntu4.1_amd64.deb').properties
  {'unquoted': ['foo bar'], 'backslashquoted': ['foo\\ bar\\'], 'urlquoted': ['foo+bar;baz'], 'baz': ['']}

For more details, see:
https://code.launchpad.net/~cjwatson/launchpad/+git/launchpad/+merge/425385
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of ~cjwatson/launchpad:artifactory-quoting-on-deploy into launchpad:master.



References