Package: vim
Version: 2:7.3.035+hg~8fdc12103333-1
Severity: normal

When writing a new python module (ie. and empty file), if you start it with a
module level doc string at the top and try to complete something in that doc
sting before closing it you get a traceback (below). It is caused by an
uninitialized variable in the exception handling block (parserline). This
variable is only set via the return values from the tokenizer which is where
the error is occurring (TokenError, "EOF in multi-line string").

The most obvious fix is just to make sure this variable is initialized in the
__init__ method as I've done in the attached patch (diff vs hg default of this
day).

I've reproduced this against upstream hg repo and have also reported it there
along with the same patch (related code didn't change).
     

--- here's the traceback, sans all but one of the  vim error lines
Error detected while processing function pythoncomplete#Complete:
line   35:
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "<string>", line 34, in vimcomplete
  File "<string>", line 57, in evalsource
  File "<string>", line 515, in parse
AttributeError: PyParser instance has no attribute 'parserline'


Hope this helps.


-- System Information:
Debian Release: squeeze/sid
  APT prefers testing
  APT policy: (990, 'testing')
Architecture: i386 (x86_64)

Kernel: Linux 2.6.32-5-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages vim depends on:
ii  libacl1      2.2.49-4                    Access control list shared library
ii  libc6        2.11.2-7                    Embedded GNU C Library: Shared lib
ii  libgpm2      1.20.4-3.3                  General Purpose Mouse - shared lib
ii  libncurses5  5.7+20100313-4              shared libraries for terminal hand
ii  libselinux1  2.0.96-1                    SELinux runtime shared libraries
ii  vim-common   2:7.3.035+hg~8fdc12103333-1 Vi IMproved - Common files
ii  vim-runtime  2:7.3.035+hg~8fdc12103333-1 Vi IMproved - Runtime files

vim recommends no packages.

Versions of packages vim suggests:
ii  exuberant-ctags [ctags]       1:5.8-3    build tag file indexes of source c
pn  vim-doc                       <none>     (no description available)
ii  vim-scripts                   20091011   plugins for vim, adding bells and 

-- no debconf information

-- 

John Eikenberry
[ j...@zhar.net - http://zhar.net ]
[ PGP public key @ http://zhar.net/jae_at_zhar_net.gpg ]
______________________________________________________________
"Perfection is attained, not when no more can be added, but when no more 
 can be removed." -- Antoine de Saint-Exupery
diff -r f987220caa57 runtime/autoload/pythoncomplete.vim
--- a/runtime/autoload/pythoncomplete.vim	Thu Dec 30 14:57:08 2010 +0100
+++ b/runtime/autoload/pythoncomplete.vim	Thu Dec 30 14:16:48 2010 -0500
@@ -377,6 +377,7 @@
     def __init__(self):
         self.top = Scope('global',0)
         self.scope = self.top
+        self.parserline = 0
 
     def _parsedotname(self,pre=None):
         #returns (dottedname, nexttoken)

Attachment: signature.asc
Description: Digital signature

Reply via email to