#10722 closed defect (cantfix)
TypeError: expecting an integer for the buffer size
Reported by: | anonymous | Owned by: | |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | version control/changeset view | Version: | 0.12.3 |
Severity: | critical | Keywords: | needinfo |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description
How to Reproduce
While doing a GET operation on /changeset/636
, Trac issued an internal error.
Problem occurs on every try to show a changeset since I upgraded some Debian Wheezy packages.
Request parameters:
{'new': u'636'}
User agent: Opera/9.80 (Windows NT 6.1; WOW64; U; de) Presto/2.10.229 Version/11.64
System Information
Trac | 0.12.3
|
Babel | 0.9.5
|
Genshi | 0.6
|
mod_python | 3.3.1
|
pysqlite | 2.6.0
|
Python | 2.7.3rc2 (default, Apr 22 2012, 22:50:19) [GCC 4.6.3]
|
setuptools | 0.6
|
SQLite | 3.7.12.1
|
Subversion | 1.6.17 (r1128011)
|
jQuery | 1.4.4
|
Enabled Plugins
TracExtractUrl | 0.3
|
TracServerSideRedirectPlugin | 0.4
|
TracTicketChangesets | 1.0dev-r10004
|
Python Traceback
Traceback (most recent call last): File "/usr/local/lib/python2.7/dist-packages/Trac-0.12.3-py2.7.egg/trac/web/main.py", line 522, in _dispatch_request dispatcher.dispatch(req) File "/usr/local/lib/python2.7/dist-packages/Trac-0.12.3-py2.7.egg/trac/web/main.py", line 243, in dispatch resp = chosen_handler.process_request(req) File "/usr/local/lib/python2.7/dist-packages/Trac-0.12.3-py2.7.egg/trac/versioncontrol/web_ui/changeset.py", line 352, in process_request self._render_html(req, repos, chgset, restricted, xhr, data) File "/usr/local/lib/python2.7/dist-packages/Trac-0.12.3-py2.7.egg/trac/versioncontrol/web_ui/changeset.py", line 618, in _render_html diffs = _content_changes(old_node, new_node) File "/usr/local/lib/python2.7/dist-packages/Trac-0.12.3-py2.7.egg/trac/versioncontrol/web_ui/changeset.py", line 551, in _content_changes old_content = old_node.get_content().read() File "/usr/lib/pymodules/python2.7/svn/core.py", line 148, in read data = svn_stream_read(self._stream, SVN_STREAM_CHUNK_SIZE) File "/usr/lib/pymodules/python2.7/libsvn/core.py", line 4801, in svn_stream_read return _core.svn_stream_read(*args) TypeError: expecting an integer for the buffer size
Attachments (0)
Change History (6)
comment:1 by , 12 years ago
comment:2 by , 12 years ago
Keywords: | needinfo added |
---|
Are you using mod_python correctly, i.e. with the PythonInterpreter "main_interpreter"
directive?
Other possibility, what output do you get with the following input to the python shell?
>>> from svn import core >>> core.SVN_STREAM_CHUNK_SIZE
And yes, it might well be a Debian specific issue, see debianbug:676176 (in particular see debianbug:676176#10, broke after an upgrade of svn.
Are you sure the bindings are exactly up-to-date with the base libraries? Check:
$ dpkg-query -l subversion python-subversion Desired=Unknown/Install/Remove/Purge/Hold | Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend |/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad) ||/ Name Version Description +++-==============-==============-============================================ ii python-subvers 1.6.12dfsg-6 Python bindings for Subversion ii subversion 1.6.12dfsg-6 Advanced version control system
Both must have exactly the same patchlevel (at least, that's a good start…)
follow-up: 5 comment:3 by , 12 years ago
TRAC 0.11.7 used to work fine. Now I have 0.12.2 and everything works fine except viewing changesets.
This is what I get:
>>> from svn import core >>> core.SVN_STREAM_CHUNK_SIZE 102400L
dpkg-query -l subversion python-subversion Desired=Unknown/Install/Remove/Purge/Hold | Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend |/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad) ||/ Name Version Description +++-========================-========================-================================================================ ii python-subversion 1.6.17dfsg-4 Python bindings for Subversion ii subversion 1.6.17dfsg-4 Advanced version control system
comment:4 by , 12 years ago
HOWEVER I got it to work by applying the following change:
/usr/lib/pymodules/python2.7/libsvn/core.py line 4801
Original:
def svn_stream_read(*args): """svn_stream_read(svn_stream_t * stream, char * buffer) -> svn_error_t""" return _core.svn_stream_read(*args)
Fixed:
def svn_stream_read(*args): """svn_stream_read(svn_stream_t * stream, char * buffer) -> svn_error_t""" return _core.svn_stream_read(args[0], int(args[1]))
Thanks to the following post: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=676176#10
comment:5 by , 12 years ago
Resolution: | → cantfix |
---|---|
Status: | new → closed |
Replying to anonymous:
TRAC 0.11.7 used to work fine. Now I have 0.12.2 and everything works fine except viewing changesets.
This is what I get:
>>> from svn import core >>> core.SVN_STREAM_CHUNK_SIZE 102400L
And that's precisely their problem. It should be:
>>> core.SVN_STREAM_CHUNK_SIZE 102400
i.e. not a long integer, but a regular integer.
It's a build issue of the Python bindings for Subversion on Debian, not a Trac problem.
I confirm this. It happened here after upgrading from debian squeeze to wheezy.