[viewvc-dev] [PATCH] Fix exception when generating a tarball from remote repositories

Ceri Storey <[email protected]>
Newsgroups gmane.comp.version-control.cvs.viewcvs.devel
Message-ID <[email protected]>
Eyup.

I got this exception when trying to make a tarball from a remote repository:

<h3>An Exception Has Occurred</h3>
<h4>Python Traceback</h4>
<p><pre>Traceback (most recent call last):
  File "/usr/share/viewvc/lib/viewvc.py", line 3630, in main
    request.run_viewvc()
  File "/usr/share/viewvc/lib/viewvc.py", line 388, in run_viewvc
    self.view_func(self)
  File "/usr/share/viewvc/lib/viewvc.py", line 2937, in download_tarball
    generate_tarball(fp, request, [], [])
  File "/usr/share/viewvc/lib/viewvc.py", line 2898, in generate_tarball
    contents = fp.read()
TypeError: read() takes exactly 2 arguments (1 given)
</pre></p>

So I made the attached patch to fix the signature of the read() method.
I also notice that it seems to make multiple connections to the remote
SVN server where one would do, but we can live with that for now.

Cheers.
-- 
Ceri Storey <[email protected]>
'What I really want is "apt-get smite"' 
    --Rob Partington
http://unix.culti.st/

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
viewvc.diff (text/plain, 322 B)
--- lib/vclib/svn_ra/__init__.py	2006-10-14 09:15:18.000000000 +0100
+++ lib/vclib/svn_ra/__init__.py.new	2007-09-14 08:47:35.000000000 +0100
@@ -240,7 +240,7 @@
     self._path = path
     self._eof = 0
     
-  def read(self, len):
+  def read(self, len=None):
     if len:
       chunk = self._fp.read(len)
     else:
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.