[issue5373] TypeError when '\x00' in docstring
Alexandre Vassalotti alexan...@peadrop.com added the comment: Patch committed in r73195. -- resolution: - accepted status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5373 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue5373] TypeError when '\x00' in docstring
Alexandre Vassalotti alexan...@peadrop.com added the comment: The motivation behind the restriction was to prevent the tp_doc member to get truncated. Since tp_doc is a C string, it cannot contains embeded null bytes. However, it seems tp_doc is not used at all for heap types. So, I don't mind lifting the restriction. ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5373 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue5373] TypeError when '\x00' in docstring
Changes by Alexandre Vassalotti alexan...@peadrop.com: Added file: http://bugs.python.org/file13214/remove_null_restriction_on_classdoc.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5373 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue5373] TypeError when '\x00' in docstring
Changes by Alexandre Vassalotti alexan...@peadrop.com: Removed file: http://bugs.python.org/file13213/remove_null_restriction_on_classdoc.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5373 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue5373] TypeError when '\x00' in docstring
Georg Brandl ge...@python.org added the comment: Looks good. (Alternately, you could also set tp_doc to NULL in the embedded \0 case.) ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5373 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue5373] TypeError when '\x00' in docstring
Terry J. Reedy tjre...@udel.edu added the comment: The bug is the discrepancy between doc [3] A string literal appearing as the first statement in the function body is transformed into the function’s __doc__ attribute and therefore the function’s docstring. [4] A string literal appearing as the first statement in the class body is transformed into the namespace’s __doc__ item and therefore the class’s docstring. and behavior. In this case, I would agree that the behavior is wrong unless somehow justified. I verified in 3.0.1, winxp: '\x00' ok in function, not in class. -- nosy: +tjreedy ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5373 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue5373] TypeError when '\x00' in docstring
New submission from Noel Cuillandre noel.cuillan...@gmail.com: The following code raises 'TypeError: __doc__ contains null-bytes':: Python 3.1a0 (py3k, Jan 27 2009, 18:02:26) [GCC 4.1.1 (Gentoo 4.1.1-r1)] on linux2 Type help, copyright, credits or license for more information. class Foo: ... '\x00' ... Traceback (most recent call last): File stdin, line 1, in module TypeError: __doc__ contains null-bytes -- messages: 82747 nosy: noel.cuillandre severity: normal status: open title: TypeError when '\x00' in docstring type: compile error versions: Python 3.1 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5373 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue5373] TypeError when '\x00' in docstring
Georg Brandl ge...@python.org added the comment: Why do you think this is a bug? -- nosy: +georg.brandl ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5373 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue5373] TypeError when '\x00' in docstring
Noel Cuillandre noel.cuillan...@gmail.com added the comment: Because the same code in Python 2.5.2 does not produce a TypeError:: Python 2.5.2 (r252:60911, Oct 21 2008, 15:11:46) [GCC 4.1.1 (Gentoo 4.1.1-r1)] on linux2 Type help, copyright, credits or license for more information. class Foo: ... '\x00' ... Added file: http://bugs.python.org/file13189/unnamed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5373 ___Because the same code in Python 2.5.2 does not produce a TypeError::brbrPython 2.5.2 (r252:60911, Oct 21 2008, 15:11:46) br[GCC 4.1.1 (Gentoo 4.1.1-r1)] on linux2brType quot;helpquot;, quot;copyrightquot;, quot;creditsquot; or quot;licensequot; for more information.br gt;gt;gt; class Foo:br... quot;quot;quot;#39;\x00#39;quot;quot;quot;br... brgt;gt;gt;brbr ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue5373] TypeError when '\x00' in docstring
Changes by Noel Cuillandre noel.cuillan...@gmail.com: Removed file: http://bugs.python.org/file13189/unnamed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5373 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue5373] TypeError when '\x00' in docstring
Georg Brandl ge...@python.org added the comment: Well, that per se is not an indication that it is not a valid change in 3.0. However, I can see no good reason to disallow null-bytes in class docstrings (especially since they're still allowed in function docstrings). Assigning to Alexandre who made this change. -- assignee: - alexandre.vassalotti nosy: +alexandre.vassalotti ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5373 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com