#164 Python 2.5 and Linux (slackware) error.

devel (cvs)
closed-fixed
None
5
2015-01-31
2007-02-09
No

I am using Python 2.5 (r25:51908, Feb 7 2007, 16:10:05) on Linux gladius 2.4.33.3 #1 Fri Sep 1 01:48:52 CDT 2006 i686 pentium4 i386 GNU/Linux.

I got the latest subversion tree (as of today: Fri Feb 9 11:58:51 GMT 2007) and ran the unit testing with the below output.

I am happy to test any patches you have.

; make test
python src/epydoc/test/__init__.py
Doctest: docbuilder.doctest ... FAIL
Doctest: apidoc.doctest ... ok
Doctest: docparser.doctest ... ok
Doctest: epytext.doctest ... ok
Doctest: encoding.doctest ... FAIL
Doctest: docintrospecter.doctest ... FAIL

======================================================================
FAIL: Doctest: docbuilder.doctest
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/local/lib/python2.5/doctest.py", line 2112, in runTest
raise self.failureException(self.format_failure(new.getvalue()))
AssertionError: Failed doctest test for docbuilder.doctest
File "src/epydoc/test/docbuilder.doctest", line 0

----------------------------------------------------------------------
File "src/epydoc/test/docbuilder.doctest", line 66, in docbuilder.doctest
Failed example:
runbuilder(s='''
__docformat__ = 'restructuredtext'

class Foo:
"""Testing defining_module

:cvar `c`: class var in class docstring
:type `c`: str
"""
c = 'abc'

def __init__(self):
#: A funny number
#:
#: :type: float
self.x = 108.0

y = property(
fget=lambda self: 42,
doc="""A property has no defining module

:type: int
""")

def f(self):
"""A function has a defining module

:rtype: int
"""
return 42
''',
build='Foo',
attribs="variables name value type_descr return_type descr")
Differences (unified diff with -expected +actual):
@@ -1,4 +1,4 @@
ClassDoc for epydoc_test.Foo [0]
- +- descr = u'Testing defining_module'
+ +- descr = u'Testing defining_module\n\n:cvar `c...
+- variables
+- __init__ => VariableDoc for epydoc_test.Foo.__init__ [1]
@@ -11,7 +11,7 @@
| +- return_type = None
+- c => VariableDoc for epydoc_test.Foo.c [3]
- | +- descr = u'class var in class docstring'
+ | +- descr = None
| +- name = 'c'
- | +- type_descr = u'str'
+ | +- type_descr = None
| +- value
| +- GenericValueDoc [4]
@@ -23,10 +23,10 @@
| +- value
| +- RoutineDoc for epydoc_test.Foo.f [6]
- | +- descr = u'A function has a defining module'
- | +- return_type = u'int'
+ | +- descr = u'A function has a defining module\n\...
+ | +- return_type = None
+- x => VariableDoc for epydoc_test.Foo.x [7]
- | +- descr = u'A funny number'
+ | +- descr = u'A funny number\n\n:type: float\n'
| +- name = u'x'
- | +- type_descr = u'float'
+ | +- type_descr = None
| +- value = <UNKNOWN>
+- y => VariableDoc for epydoc_test.Foo.y [8]
@@ -36,4 +36,4 @@
+- value
+- PropertyDoc for epydoc_test.Foo.y [9]
- +- descr = u'A property has no defining module'
- +- type_descr = u'int'
+ +- descr = u'A property has no defining module\n...
+ +- type_descr = None
----------------------------------------------------------------------
File "src/epydoc/test/docbuilder.doctest", line 141, in docbuilder.doctest
Failed example:
runbuilder(s="""
from __future__ import division
from re import match
""",
attribs='variables value')
Differences (unified diff with -expected +actual):
@@ -3,3 +3,3 @@
+- match => VariableDoc for epydoc_test.match [1]
+- value
- +- ValueDoc for sre.match [2]
+ +- ValueDoc for re.match [2]
----------------------------------------------------------------------
File "src/epydoc/test/docbuilder.doctest", line 386, in docbuilder.doctest
Failed example:
runbuilder(s='''
__docformat__ = 'restructuredtext'
class Foo:
"""This is the object docstring

:Parameters:
`a` : string
init param.

:Exceptions:
* `ValueError`: frobnication error
init param.

:IVariables:
`a` : date
instance var.
def __init__(self, a):
pass
''',
build="Foo",
attribs="variables name value exception_descrs "
"posargs vararg kwarg type_descr arg_types arg_descrs")
Differences (unified diff with -expected +actual):
@@ -2,16 +2,12 @@
+- variables
+- __init__ => VariableDoc for epydoc_test.Foo.__init__ [1]
- | +- name = '__init__'
- | +- type_descr = None
- | +- value
- | +- RoutineDoc for epydoc_test.Foo.__init__ [2]
- | +- arg_descrs = [([u'a'], [u'init', u'param.'])]
- | +- arg_types = {u'a': [u'string']}
- | +- exception_descrs = [(DottedName(u'ValueError'), ...
- | +- kwarg = None
- | +- posargs = ['self', 'a']
- | +- vararg = None
- +- a => VariableDoc for epydoc_test.Foo.a [3]
- +- name = u'a'
- +- type_descr = u'date'
- +- value = <UNKNOWN>
+ +- name = '__init__'
+ +- type_descr = None
+ +- value
+ +- RoutineDoc for epydoc_test.Foo.__init__ [2]
+ +- arg_descrs = []
+ +- arg_types = {}
+ +- exception_descrs = []
+ +- kwarg = None
+ +- posargs = ['self', 'a']
+ +- vararg = None

======================================================================
FAIL: Doctest: encoding.doctest
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/local/lib/python2.5/doctest.py", line 2112, in runTest
raise self.failureException(self.format_failure(new.getvalue()))
AssertionError: Failed doctest test for encoding.doctest
File "src/epydoc/test/encoding.doctest", line 0

----------------------------------------------------------------------
File "src/epydoc/test/encoding.doctest", line 116, in encoding.doctest
Failed example:
test("# -*- coding: utf-8 -*-\n"+utf8_test)
Differences (unified diff with -expected +actual):
@@ -2,3 +2,3 @@
<p>0x80-0x7ff range: &#128; &#129; &#2046; &#2047;</p>
<p>0x800-0xffff range: &#2048; &#2049; &#65534; &#65535;</p>
-0x10000-0x10ffff range: &#65536; &#65537; &#1114110; &#1114111;
+0x10000-0x10ffff range: &#55296;&#56320; &#55296;&#56321; &#56319;&#57342; &#56319;&#57343;
----------------------------------------------------------------------
File "src/epydoc/test/encoding.doctest", line 123, in encoding.doctest
Failed example:
test(utf8_bom+"# -*- coding: utf-8 -*-\n"+utf8_test)
Differences (unified diff with -expected +actual):
@@ -2,3 +2,3 @@
<p>0x80-0x7ff range: &#128; &#129; &#2046; &#2047;</p>
<p>0x800-0xffff range: &#2048; &#2049; &#65534; &#65535;</p>
-0x10000-0x10ffff range: &#65536; &#65537; &#1114110; &#1114111;
+0x10000-0x10ffff range: &#55296;&#56320; &#55296;&#56321; &#56319;&#57342; &#56319;&#57343;
----------------------------------------------------------------------
File "src/epydoc/test/encoding.doctest", line 130, in encoding.doctest
Failed example:
test(utf8_bom+utf8_test)
Differences (unified diff with -expected +actual):
@@ -2,3 +2,3 @@
<p>0x80-0x7ff range: &#128; &#129; &#2046; &#2047;</p>
<p>0x800-0xffff range: &#2048; &#2049; &#65534; &#65535;</p>
-0x10000-0x10ffff range: &#65536; &#65537; &#1114110; &#1114111;
+0x10000-0x10ffff range: &#55296;&#56320; &#55296;&#56321; &#56319;&#57342; &#56319;&#57343;
----------------------------------------------------------------------
File "src/epydoc/test/encoding.doctest", line 155, in encoding.doctest
Failed example:
test("\n# -*- coding: utf-8 -*-\n"+utf8_test)
Differences (unified diff with -expected +actual):
@@ -2,3 +2,3 @@
<p>0x80-0x7ff range: &#128; &#129; &#2046; &#2047;</p>
<p>0x800-0xffff range: &#2048; &#2049; &#65534; &#65535;</p>
-0x10000-0x10ffff range: &#65536; &#65537; &#1114110; &#1114111;
+0x10000-0x10ffff range: &#55296;&#56320; &#55296;&#56321; &#56319;&#57342; &#56319;&#57343;
----------------------------------------------------------------------
File "src/epydoc/test/encoding.doctest", line 161, in encoding.doctest
Failed example:
test("# comment\n# -*- coding: utf-8 -*-\n"+utf8_test)
Differences (unified diff with -expected +actual):
@@ -2,3 +2,3 @@
<p>0x80-0x7ff range: &#128; &#129; &#2046; &#2047;</p>
<p>0x800-0xffff range: &#2048; &#2049; &#65534; &#65535;</p>
-0x10000-0x10ffff range: &#65536; &#65537; &#1114110; &#1114111;
+0x10000-0x10ffff range: &#55296;&#56320; &#55296;&#56321; &#56319;&#57342; &#56319;&#57343;
----------------------------------------------------------------------
File "src/epydoc/test/encoding.doctest", line 212, in encoding.doctest
Failed example:
test("# -*- coding: utf-8 -*-\n"+utf8_test, introspect=False)
Differences (unified diff with -expected +actual):
@@ -2,3 +2,3 @@
<p>0x80-0x7ff range: &#128; &#129; &#2046; &#2047;</p>
<p>0x800-0xffff range: &#2048; &#2049; &#65534; &#65535;</p>
-0x10000-0x10ffff range: &#65536; &#65537; &#1114110; &#1114111;
+0x10000-0x10ffff range: &#55296;&#56320; &#55296;&#56321; &#56319;&#57342; &#56319;&#57343;
----------------------------------------------------------------------
File "src/epydoc/test/encoding.doctest", line 217, in encoding.doctest
Failed example:
test(utf8_bom+"# -*- coding: utf-8 -*-\n"+utf8_test, introspect=False)
Differences (unified diff with -expected +actual):
@@ -2,3 +2,3 @@
<p>0x80-0x7ff range: &#128; &#129; &#2046; &#2047;</p>
<p>0x800-0xffff range: &#2048; &#2049; &#65534; &#65535;</p>
-0x10000-0x10ffff range: &#65536; &#65537; &#1114110; &#1114111;
+0x10000-0x10ffff range: &#55296;&#56320; &#55296;&#56321; &#56319;&#57342; &#56319;&#57343;
----------------------------------------------------------------------
File "src/epydoc/test/encoding.doctest", line 222, in encoding.doctest
Failed example:
test(utf8_bom+utf8_test, introspect=False)
Differences (unified diff with -expected +actual):
@@ -2,3 +2,3 @@
<p>0x80-0x7ff range: &#128; &#129; &#2046; &#2047;</p>
<p>0x800-0xffff range: &#2048; &#2049; &#65534; &#65535;</p>
-0x10000-0x10ffff range: &#65536; &#65537; &#1114110; &#1114111;
+0x10000-0x10ffff range: &#55296;&#56320; &#55296;&#56321; &#56319;&#57342; &#56319;&#57343;
----------------------------------------------------------------------
File "src/epydoc/test/encoding.doctest", line 228, in encoding.doctest
Failed example:
test("# -*- coding: utf-8 -*-\n"+utf8_test, parse=False)
Differences (unified diff with -expected +actual):
@@ -2,3 +2,3 @@
<p>0x80-0x7ff range: &#128; &#129; &#2046; &#2047;</p>
<p>0x800-0xffff range: &#2048; &#2049; &#65534; &#65535;</p>
-0x10000-0x10ffff range: &#65536; &#65537; &#1114110; &#1114111;
+0x10000-0x10ffff range: &#55296;&#56320; &#55296;&#56321; &#56319;&#57342; &#56319;&#57343;
----------------------------------------------------------------------
File "src/epydoc/test/encoding.doctest", line 233, in encoding.doctest
Failed example:
test(utf8_bom+"# -*- coding: utf-8 -*-\n"+utf8_test, parse=False)
Differences (unified diff with -expected +actual):
@@ -2,3 +2,3 @@
<p>0x80-0x7ff range: &#128; &#129; &#2046; &#2047;</p>
<p>0x800-0xffff range: &#2048; &#2049; &#65534; &#65535;</p>
-0x10000-0x10ffff range: &#65536; &#65537; &#1114110; &#1114111;
+0x10000-0x10ffff range: &#55296;&#56320; &#55296;&#56321; &#56319;&#57342; &#56319;&#57343;
----------------------------------------------------------------------
File "src/epydoc/test/encoding.doctest", line 238, in encoding.doctest
Failed example:
test(utf8_bom+utf8_test, parse=False)
Differences (unified diff with -expected +actual):
@@ -2,3 +2,3 @@
<p>0x80-0x7ff range: &#128; &#129; &#2046; &#2047;</p>
<p>0x800-0xffff range: &#2048; &#2049; &#65534; &#65535;</p>
-0x10000-0x10ffff range: &#65536; &#65537; &#1114110; &#1114111;
+0x10000-0x10ffff range: &#55296;&#56320; &#55296;&#56321; &#56319;&#57342; &#56319;&#57343;

======================================================================
FAIL: Doctest: docintrospecter.doctest
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/local/lib/python2.5/doctest.py", line 2112, in runTest
raise self.failureException(self.format_failure(new.getvalue()))
AssertionError: Failed doctest test for docintrospecter.doctest
File "src/epydoc/test/docintrospecter.doctest", line 0

----------------------------------------------------------------------
File "src/epydoc/test/docintrospecter.doctest", line 506, in docintrospecter.doctest
Failed example:
runintrospecter(s="""
import re
from re import match
""",
attribs='variables value is_imported')
Differences (unified diff with -expected +actual):
@@ -4,5 +4,5 @@
| +- is_imported = True
| +- value
- | +- ValueDoc for sre.match [2]
+ | +- ValueDoc for re.match [2]
+- re => VariableDoc for epydoc_test.re [3]
+- is_imported = True
----------------------------------------------------------------------
File "src/epydoc/test/docintrospecter.doctest", line 523, in docintrospecter.doctest
Failed example:
runintrospecter(s="""
from __future__ import division
from re import match
""",
attribs='variables value')
Differences (unified diff with -expected +actual):
@@ -3,3 +3,3 @@
+- match => VariableDoc for epydoc_test.match [1]
+- value
- +- ValueDoc for sre.match [2]
+ +- ValueDoc for re.match [2]

----------------------------------------------------------------------
Ran 6 tests in 1.210s

FAILED (failures=3)

Discussion

  • Edward Loper

    Edward Loper - 2007-02-09
    • priority: 5 --> 6
     
  • Edward Loper

    Edward Loper - 2007-02-09

    Logged In: YES
    user_id=195958
    Originator: NO

    This appears to occur when using Python 2.5 but not Python 2.4. To summarize, the following errors are made:

    1. It appears that docstrings in docbuilder.doctest are not having their epytext fields processed. It's not immediately obvious to me why this would be the case, but it needs to be fixed. (Are they getting treated as plaintext rather than epytext for some reason?)

    2. Expect "sre.match"/get "re.match" -- this one is pretty harmless, and just reflects the fact that Python's name for this class has changed -- the sre module was deprecated. The doctest examples should probably be changed to use a different import value for testing.

    3. Unicode repr changes. This reflects a change in how python's unicode.encode() funtion works. Namely, in 2.4:
    >>> u'\U00010000'.encode('ascii', 'xmlcharrefreplace')
    '&#65536;'

    vs in 2.5:
    >>> u'\U00010000'.encode('ascii', 'xmlcharrefreplace')
    '&#55296;&#56320;'

    I don't know enough about unicode to know why this was changed in Python2.5; but I don't think it will have any negative effects. (I believe that the two unicode strings are '&#65536;' and '&#55296;&#56320;' are supposed to be equivalent -- the latter is just a decomposed version.) Python's behavior here does seem a little confusing to me, though:
    >>> a, b = u'\ud800\udc00', u'\U00010000'
    >>> print (a, b, a==b, repr(a)==repr(b))
    (u'\U00010000', u'\U00010000', False, True)

     
  • Edward Loper

    Edward Loper - 2007-02-09

    Logged In: YES
    user_id=195958
    Originator: NO

    On further inspection, I think the problem I listed as (1) in my previous comment occurs when docutils is not installed. The docstrings in question all use restructuredtext as the markup language; and if docutils is not installed, epydoc will (silently?) fall back on treating the docstrings as plaintext.

    So this isn't so much a bug in epydoc as a bug in the test cases -- this test case should really only be run if docutils is installed. Perhaps these tests should be moved to a new 'restructuredtext.doctest' file, that's only run if the docutils module is importable.

     
  • Yann Golanski

    Yann Golanski - 2007-02-09

    Logged In: YES
    user_id=457259
    Originator: YES

    Yes, I am using python 2.5, The code works fine on my python 2.4 install -- different machine.

    I've install docutil 0.4 and now I am getting the following:

    ; gmake distributions
    [...]
    mkdir -p html/doctest
    for doctest in src/epydoc/test/apidoc.doctest src/epydoc/test/docbuilder.doctest src/epydoc/test/docintrospecter.doctest src/epydoc/test/docparser.doctest src/epydoc/test/encoding.doctest src/epydoc/test/epytext.doctest; do \ out_file=html/doctest/`basename $doctest .doctest`.html; \ echo "python src/tools/rst2html.py $doctest $out_file"; \ if python src/tools/rst2html.py $doctest $out_file; then true; \ else exit 1; fi\ done
    /bin/sh: -c: line 6: syntax error: unexpected end of file
    gmake: *** [.doctest-html.up2date] Error 2
    ; svn up
    At revision 1443.

    Thanks for the prompt help. Lemme know if you need more information or run test.

     
  • Nobody/Anonymous

    Logged In: NO

    That's odd -- perhaps your version of /bin/sh is causing trouble with the little shell-script command? At any rate, that clause of the makefile should probably be rewritten to do what it does in a more makefile-like way. I'll rewrite it when I get a chance.

    But this makefile error is totally unrelated to the bug reported by this bug report.

     
  • Edward Loper

    Edward Loper - 2007-02-11
    • priority: 6 --> 5
    • assigned_to: nobody --> edloper
    • status: open --> closed-fixed
     
  • Edward Loper

    Edward Loper - 2007-02-11

    Logged In: YES
    user_id=195958
    Originator: NO

    All tests now run cleanly under Python 2.5. If you don't have docutils installed, it will skip the tests that require it. I also changed the makefile, so hopfully that will work for you now too. (svn revisions 1459)

     
  • Nobody/Anonymous

    Logged In: NO

    Awesome. I updated the source, did a "make distributions" and got it to work fine. I like the new GUI.

    Many thanks indeed for fixing this bug and writing epydoc in the first place.

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks