This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: getlines() in linecache.py raises TypeError
Type: Stage:
Components: Library (Lib) Versions: Python 2.5
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: scoder, zseil
Priority: normal Keywords:

Created on 2006-08-04 13:04 by scoder, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (3)
msg29434 - (view) Author: Stefan Behnel (scoder) * (Python committer) Date: 2006-08-04 13:04
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)
msg29435 - (view) Author: Ziga Seilnacht (zseil) * (Python committer) Date: 2006-08-04 13:30
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.
msg29436 - (view) Author: Stefan Behnel (scoder) * (Python committer) Date: 2006-08-04 14:06
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' ...
History
Date User Action Args
2022-04-11 14:56:19adminsetgithub: 43773
2006-08-04 13:04:36scodercreate