You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@chemistry.apache.org by lm...@apache.org on 2018/11/27 19:07:37 UTC

svn commit: r1847584 - in /chemistry/cmislib/branches/py3_compat/src: cmislib/browser/binding.py tests/test_repository.py

Author: lmignon
Date: Tue Nov 27 19:07:37 2018
New Revision: 1847584

URL: http://svn.apache.org/viewvc?rev=1847584&view=rev
Log:
[PATCH] BrowserBinding: quote literal '+' into url path by default,
python requests doesn't quote the sting literal '+'. Nevertheless this
literal must be quoted when used in the getObjectByPath request


Modified:
    chemistry/cmislib/branches/py3_compat/src/cmislib/browser/binding.py
    chemistry/cmislib/branches/py3_compat/src/tests/test_repository.py

Modified: chemistry/cmislib/branches/py3_compat/src/cmislib/browser/binding.py
URL: http://svn.apache.org/viewvc/chemistry/cmislib/branches/py3_compat/src/cmislib/browser/binding.py?rev=1847584&r1=1847583&r2=1847584&view=diff
==============================================================================
--- chemistry/cmislib/branches/py3_compat/src/cmislib/browser/binding.py (original)
+++ chemistry/cmislib/branches/py3_compat/src/cmislib/browser/binding.py Tue Nov 27 19:07:37 2018
@@ -35,7 +35,7 @@ from cmislib.domain import CmisId, CmisO
 from cmislib.exceptions import CmisException, InvalidArgumentException, \
     NotSupportedException, ObjectNotFoundException
 from cmislib.util import parsePropValueByType, parseDateTimeValue, iteritems, \
-    itervalues
+    itervalues, safe_quote
 
 moduleLogger = logging.getLogger('cmislib.browser.binding')
 
@@ -791,7 +791,7 @@ class BrowserRepository(object):
          - includeAllowableActions
         """
 
-        url = self.getRootFolderUrl() + path
+        url = self.getRootFolderUrl() + safe_quote(path)
         params = {
             'cmisselector': 'object',
         }

Modified: chemistry/cmislib/branches/py3_compat/src/tests/test_repository.py
URL: http://svn.apache.org/viewvc/chemistry/cmislib/branches/py3_compat/src/tests/test_repository.py?rev=1847584&r1=1847583&r2=1847584&view=diff
==============================================================================
--- chemistry/cmislib/branches/py3_compat/src/tests/test_repository.py (original)
+++ chemistry/cmislib/branches/py3_compat/src/tests/test_repository.py Tue Nov 27 19:07:37 2018
@@ -154,7 +154,7 @@ class TestRepository:
         """Create test objects (one folder, one document) then try to get
         them by path"""
         # names of folders and test docs (without and with unicode char)
-        for suffix in ['', u'_éà€$']:
+        for suffix in ['', u'_éà€$', ' +']:
             parentFolderName = 'testGetObjectByPath folder' + suffix
             subFolderName = 'subfolder' + suffix
             docName = 'testdoc' + suffix