[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

swig-py3 svn_stream_read

From: Daniel Shahaf <d.s_at_daniel.shahaf.name>
Date: Fri, 23 Mar 2018 08:10:26 +0000

Trying to merge trunk_at_HEAD into branches/swig-py3, the py2 tests pass
but the py3 tests fail:

[[[
............................................E/usr/lib/python3.5/unittest/case.py:629: ResourceWarning: unclosed file <_io.BufferedWriter name='/tmp/tmpt0y_m2lx'>
  outcome.errors.clear()
E/usr/lib/python3.5/unittest/case.py:629: ResourceWarning: unclosed file <_io.BufferedWriter name='/tmp/tmpnxp8y69m'>
  outcome.errors.clear()
...................................................................................
======================================================================
ERROR: test_diff_repos_paths_external (fs.SubversionFSTestCase)
Test diffing of a repository path using an external diff (if available).
----------------------------------------------------------------------

======================================================================
ERROR: test_diff_repos_paths_internal (fs.SubversionFSTestCase)
Test diffing of a repository path using the internal diff.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/daniel/in/svn/swig-py3/subversion/bindings/swig/python/tests/fs.py", line 93, in test_diff_repos_paths_internal
    diffp = fdiff.get_pipe()
  File "/home/daniel/in/svn/swig-py3/subversion/bindings/swig/python/tests/../svn/fs.py", line 113, in get_pipe
    self.get_files()
  File "/home/daniel/in/svn/swig-py3/subversion/bindings/swig/python/tests/../svn/fs.py", line 107, in get_files
    self._dump_contents(self.tempfile1, self.root1, self.path1)
  File "/home/daniel/in/svn/swig-py3/subversion/bindings/swig/python/tests/../svn/fs.py", line 92, in _dump_contents
    fp.write(chunk)
TypeError: a bytes-like object is required, not 'str'

----------------------------------------------------------------------
Ran 129 tests in 2.203s
]]]

The relevant revisions being merged are:

% svn mergeinfo --show-revs eligible {../trunk,../swig-py3}/subversion/bindings/swig/ | me
r1823802 - Ensure Python bindings for fs.FileDiff behaves correctly when the python-future package is installed.
r1824410 - Fix Python unit test, fs.SubversionFSTestCase, on Windows.
r1825316 - Update external 'diff' command test for svn.fs.FileDiff() to depend on presence of the command instead of testing for 'win32' platform.
%

(OT: it'd be nice to have an 'svn log' mode that shows just the first
line/paragraph of each listed revision, as above)

The first two revisions changed open() call modes to use binary mode,
which is likely the cause of the bytes/str mismatch. However, looking
into it —

>>> sys.version_info.major
    3
>>> from svn.core import *
>>> e = svn_stream_empty()
>>> svn_stream_read(e, 5)
    ''
>>>

— shouldn't svn_stream_read() return bytes under py3?

Cheers,

Daniel
Received on 2018-03-23 09:10:36 CET

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.