[ python-Bugs-1534517 ] getlines() in linecache.py raises TypeError

SourceForge.net noreply at sourceforge.net
Fri Aug 4 16:06:00 CEST 2006


Bugs item #1534517, was opened at 2006-08-04 15:04
Message generated for change (Comment added) made by scoder
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1534517&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Python Library
Group: Python 2.5
>Status: Closed
>Resolution: Invalid
Priority: 5
Submitted By: Stefan Behnel (scoder)
Assigned to: Nobody/Anonymous (nobody)
Summary: getlines() in linecache.py raises TypeError

Initial Comment:
In my doctests, I get the following error under 2.5.
I'm on AMD64 in case that's of any interest.

Traceback (most recent call last):
  File
"/var/tmp/python2.5-2.5b3-root/usr/lib64/python2.5/unittest.py",
line 260, in run
    testMethod()
  File
"/home/me/source/Python/lxml/lxml-HEAD/src/doctest.py",
line 2182, in runTest
    test, out=new.write, clear_globs=False)
  File
"/home/me/source/Python/lxml/lxml-HEAD/src/doctest.py",
line 1389, in run
    return self.__run(test, compileflags, out)
  File
"/home/me/source/Python/lxml/lxml-HEAD/src/doctest.py",
line 1280, in __run
    got += _exception_traceback(exc_info)
  File
"/home/me/source/Python/lxml/lxml-HEAD/src/doctest.py",
line 257, in _exception_traceback
    traceback.print_exception(exc_type, exc_val,
exc_tb, file=excout)
  File
"/var/tmp/python2.5-2.5b3-root/usr/lib64/python2.5/traceback.py",
line 125, in print_exception
    print_tb(tb, limit, file)
  File
"/var/tmp/python2.5-2.5b3-root/usr/lib64/python2.5/traceback.py",
line 69, in print_tb
    line = linecache.getline(filename, lineno, f.f_globals)
  File
"/var/tmp/python2.5-2.5b3-root/usr/lib64/python2.5/linecache.py",
line 14, in getline
    lines = getlines(filename, module_globals)
TypeError: __patched_linecache_getlines() takes exactly
2 arguments (3 given)


----------------------------------------------------------------------

>Comment By: Stefan Behnel (scoder)
Date: 2006-08-04 16:06

Message:
Logged In: YES 
user_id=313935

Argh! Sure.

I only saw "doctest" and "linecache" and didn't even notice
it was using the local file. No idea why it's there anyway.

Thanks! Great time to close this 'bug' ...


----------------------------------------------------------------------

Comment By: Žiga Seilnacht (zseil)
Date: 2006-08-04 15:30

Message:
Logged In: YES 
user_id=1326842

This bug is caused by your custom doctest module. Doctest
monkeypatches linecache's getlines() function. It was
fixed in the standard library to support an aditional
argument, but it looks that lxml is still using the 2.4
version.


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1534517&group_id=5470


More information about the Python-bugs-list mailing list