You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by tr...@apache.org on 2018/12/27 04:16:43 UTC

svn commit: r1849786 - in /subversion/branches/swig-py3/subversion/bindings/swig/python: libsvn_swig_py/swigutil_py.c tests/client.py

Author: troycurtisjr
Date: Thu Dec 27 04:16:43 2018
New Revision: 1849786

URL: http://svn.apache.org/viewvc?rev=1849786&view=rev
Log:
On branch swig-py3: Fix tests after str to bytes API conversion.

* subversion/bindings/swig/python/tests/client.py
  (SubversionClientTestCase.test_conflict,
   SubversionClientTestCase.test_shelf)): Construct paths as bytes instead of
    str.

* subversion/bindings/swig/python/libsvn_swig_py/swigutil_py.c
  (svn_swig_py_client_status_func): The path given to the callback should be
    bytes instead of str for consistency with the rest of the API.


Modified:
    subversion/branches/swig-py3/subversion/bindings/swig/python/libsvn_swig_py/swigutil_py.c
    subversion/branches/swig-py3/subversion/bindings/swig/python/tests/client.py

Modified: subversion/branches/swig-py3/subversion/bindings/swig/python/libsvn_swig_py/swigutil_py.c
URL: http://svn.apache.org/viewvc/subversion/branches/swig-py3/subversion/bindings/swig/python/libsvn_swig_py/swigutil_py.c?rev=1849786&r1=1849785&r2=1849786&view=diff
==============================================================================
--- subversion/branches/swig-py3/subversion/bindings/swig/python/libsvn_swig_py/swigutil_py.c (original)
+++ subversion/branches/swig-py3/subversion/bindings/swig/python/libsvn_swig_py/swigutil_py.c Thu Dec 27 04:16:43 2018
@@ -2872,7 +2872,13 @@ void svn_swig_py_client_status_func(void
     return;
 
   svn_swig_py_acquire_py_lock();
-  if ((result = PyObject_CallFunction(function, (char *)"sO&O&", path,
+  if ((result = PyObject_CallFunction(function,
+#if IS_PY3
+                                      (char *)"yO&O&",
+#else
+                                      (char *)"sO&O&",
+#endif
+                                      path,
                                       make_ob_client_status, status,
                                       make_ob_pool, scratch_pool)) == NULL)
     {

Modified: subversion/branches/swig-py3/subversion/bindings/swig/python/tests/client.py
URL: http://svn.apache.org/viewvc/subversion/branches/swig-py3/subversion/bindings/swig/python/tests/client.py?rev=1849786&r1=1849785&r2=1849786&view=diff
==============================================================================
--- subversion/branches/swig-py3/subversion/bindings/swig/python/tests/client.py (original)
+++ subversion/branches/swig-py3/subversion/bindings/swig/python/tests/client.py Thu Dec 27 04:16:43 2018
@@ -514,7 +514,7 @@ class SubversionClientTestCase(unittest.
     client.checkout2(self.repos_uri, path, rev, rev, True, True,
             self.client_ctx)
 
-    trunk_path = os.path.join(path, 'trunk')
+    trunk_path = os.path.join(path, b'trunk')
 
     # Create a conflicting path
     os.mkdir(trunk_path)
@@ -550,11 +550,11 @@ class SubversionClientTestCase(unittest.
             self.client_ctx)
 
     pool = core.Pool()
-    shelf = client._shelf_open_or_create("test1", path, self.client_ctx, pool)
+    shelf = client._shelf_open_or_create(b"test1", path, self.client_ctx, pool)
 
     self.assertTrue(isinstance(shelf, client.svn_client__shelf_t))
 
-    new_subpath = os.path.join('trunk', 'new-shelf-test.txt')
+    new_subpath = os.path.join(b'trunk', b'new-shelf-test.txt')
     new_path = os.path.join(path, new_subpath)
 
     with open(new_path, "wb") as fp: