﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
3036	Misc minor doctest failures	Yary H <spam-django@…>	Peter van Kampen	"Tried running all the easily-runnable doctests in django's source, found these minor anomolies. Sorry if this is just ""noise"", all errors seem to be ""pedantic"" and not indicitive of true bugs.

{{{
File ""django/core/validators.py"", line 394, in django.core.validators.IsAPowerOf
Failed example:
    v(17, None)
Exception raised:
    Traceback (most recent call last):
...
      File ""....django/core/validators.py"", line 404, in __call__
        raise ValidationError, gettext(""This value must be a power of %s."") % self.power_of
    ValidationError: ['This value must be a power of 2.']
**********************************************************************
1 items had failures:
   1 of   5 in django.core.validators.IsAPowerOf
}}}

To fix, change lines 394,395 of core\validators.py to read:
{{{
    >>> v(17, None)
    Traceback (most recent call last):
        ...
    ValidationError: ['This value must be a power of 2.']
}}}

next one:
{{{
File ""django/core/serializers/__init__.py"", line 7, in django.core.serializers
Failed example:
    json = serializers.serialize(""json"", some_query_set)
Exception raised:
    Traceback (most recent call last):
...
      File ""<doctest django.core.serializers[1]>"", line 1, in ?
        json = serializers.serialize(""json"", some_query_set)
    NameError: name 'some_query_set' is not defined
**********************************************************************
File ""django/core/serializers/__init__.py"", line 8, in django.core.serializers
Failed example:
    objects = list(serializers.deserialize(""json"", json))
Exception raised:
    Traceback (most recent call last):
...
      File ""<doctest django.core.serializers[2]>"", line 1, in ?
        objects = list(serializers.deserialize(""json"", json))
      File ""django/core/serializers/json.py"", line 32, in Deserializer
        for obj in PythonDeserializer(simplejson.load(stream)):
      File ""django/utils/simplejson/__init__.py"", line 177, in load
        return cls(encoding=encoding, **kw).decode(fp.read())
    AttributeError: 'module' object has no attribute 'read'
**********************************************************************
1 items had failures:
   2 of   3 in django.core.serializers
***Test Failed*** 2 failures.
(2, 3)
}}}

Not super-simple for me to fix!

Next ones-
{{{
File ""django/template/__init__.py"", line 37, in django.template
Failed example:
    import template
Exception raised:
    Traceback (most recent call last):
...
      File ""<doctest django.template[0]>"", line 1, in ?
        import template
    ImportError: No module named template
...
2 items had failures:
   6 of   7 in django.template
   3 of   4 in django.template.FilterExpression
***Test Failed*** 9 failures.
(9, 19)
 }}}
was able to quickly fix a few (but not all) errors by changing line 37 to read:
{{{ >>> from django import template }}}

next-
{{{
File ""django/utils/datastructures.py"", line 217, in django.utils.datastructures.DotExpandedDict
Failed example:
    d = DotExpandedDict({'person.1.firstname': ['Simon'],
Exception raised:
    Traceback (most recent call last):
    ...
      File ""<doctest django.utils.datastructures.DotExpandedDict[0]>"", line 1
         d = DotExpandedDict({'person.1.firstname': ['Simon'],
                                                              ^
     SyntaxError: unexpected EOF while parsing

}}}

hmm, missing the '{{{ ... }}}' continuation markers.

{{{django/utils/simplejson/encoder.py}}} has a simple whitespace issue? change line 264 to {{{'{""foo"": [""bar"", ""baz""]}'}}} - that is, add a single space between ':' and '['


Also check {{{django.utils.feedgenerator}}}

I also listed a different one of these in ticket #3035 for utils.text

thanks!
"	defect	closed	Testing framework	dev	minor	fixed			Ready for checkin	1	0	0	0	0	0
