287: ClientError undefined

hjian*****@gmai***** (Google Code) (Is this you? Claim this profile.)
chipx86
chipx86
Nov. 10, 2007
I tried to run the trunk version. When I try to create a new review request
I received an error saying ClientError is not defined.

I don't know much about Python, but the following patch fixes the problem:

Index: scmtools/svn.py
===================================================================
--- scmtools/svn.py     (revision 995)
+++ scmtools/svn.py     (working copy)
@@ -51,7 +51,7 @@
         try:
             return self.client.cat(self.__normalize_path(path),
                                    self.__normalize_revision(revision))
-        except ClientError, e:
+        except pysvn.ClientError, e:
             stre = str(e)
             if 'File not found' in stre:
                 raise FileNotFoundError(path, revision, str(e))
chipx86
#1 chipx86
Do you not have a line near the top that says:

try:    
    from pysvn import ClientError, Revision, opt_revision_kind
except ImportError:                
    pass

?
  • +Component-SCMTools
#2 hjian*****@gmai***** (Google Code) (Is this you? Claim this profile.)
I do. And I tried the imports manually in a python shell to make sure they work. I
don't understand why the error was raised, and why using pysvn.ClientError would fix it.

I'll spend some more time on this later and let you know if I figure out anything.
chipx86
#3 chipx86
What version of pysvn do you have? It might help to upgrade. I'm using 1.5.1
  • +chipx86
#4 hjian*****@gmai***** (Google Code) (Is this you? Claim this profile.)
I'm using the same version.

I just reverted my change and tried to figure out the reason. But somehow the problem
went away. It was probably my fault, but I will poke around and let you know if I am
able to reproduce it.
chipx86
#5 chipx86
Okay. Going to assume this is "fixed" then, but I'll continue watching this ticket.
Any chance you had an older pysvn?
  • +Fixed
#6 hjian*****@gmai***** (Google Code) (Is this you? Claim this profile.)
I figured out the reason. It was indeed my problem. I didn't restart Apache after I
installed pysvn, so when I tried, ClientError was not found because pysvn was not
imported (and ImportError is suppressed.). Then I changed ClientError to
pysvn.ClientError and restarted Apache, so it worked the second time (because of
reloading Apache, not my change).

It seems pysvn is critical for that file, I am wondering why ImportError is
suppressed though.