[issue1144] parsermodule validation out of sync with Grammar
New submission from David Binger: >>> parser.sequence2st(parser.suite("class A(object): pass").tolist()) Traceback (most recent call last): File "", line 1, in parser.ParserError: Expected node type 326, got 329. --- The Grammar in python 3 uses "arglist" instead of "testlist" for class definitions. The parsermodule's validate_class() calls validate_testlist() where it should now be calling validate_arglist(). -- components: Library (Lib) messages: 55818 nosy: dbinger severity: normal status: open title: parsermodule validation out of sync with Grammar type: behavior versions: Python 3.0 __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1144> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1144] parsermodule validation out of sync with Grammar
David Binger added the comment: The one line patch below makes "import parser; parser.sequence2st(parser.suite("class A(object): pass").tolist())" work. It puts the parsermodule's validation back in sync with the Python3 grammar for this rule of the grammar. This bug is a serious problem for me. Index: Modules/parsermodule.c === --- Modules/parsermodule.c (revision 58978) +++ Modules/parsermodule.c (working copy) @@ -992,7 +992,7 @@ if (res) { if (nch == 7) { res = ((validate_lparen(CHILD(tree, 2)) && - validate_testlist(CHILD(tree, 3)) && + validate_arglist(CHILD(tree, 3)) && validate_rparen(CHILD(tree, 4; } else if (nch == 6) { __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1144> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1144] parsermodule validation out of sync with Grammar
David Binger added the comment: Okay, here is the whole thing with a unittest that exposes the problem. Index: Lib/test/test_parser.py === --- Lib/test/test_parser.py (revision 58984) +++ Lib/test/test_parser.py (working copy) @@ -136,6 +136,7 @@ def test_class_defs(self): self.check_suite("class foo():pass") +self.check_suite("class foo(object):pass") def test_import_from_statement(self): self.check_suite("from sys.path import *") Index: Modules/parsermodule.c === --- Modules/parsermodule.c (revision 58984) +++ Modules/parsermodule.c (working copy) @@ -992,7 +992,7 @@ if (res) { if (nch == 7) { res = ((validate_lparen(CHILD(tree, 2)) && - validate_testlist(CHILD(tree, 3)) && + validate_arglist(CHILD(tree, 3)) && validate_rparen(CHILD(tree, 4; } else if (nch == 6) { __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1144> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1514] missing constants in socket module
New submission from David Binger: TCP_NODELAY and some constants are not present in the socket module. I think maybe "#include " should appear somewhere, perhaps at the top of socketmodule.c? (This is on OS X 10.5.1 with py3k revision 59215). -- components: Library (Lib), Macintosh messages: 57921 nosy: dbinger severity: normal status: open title: missing constants in socket module type: behavior versions: Python 3.0 __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1514> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2893] dict.has_key() expected in h2py.py.
New submission from David Binger <[EMAIL PROTECTED]>: The h2py.py script is invoked at the end of "make install" on OS X. It raises an exception on the line where dict.has_key() is called. (There seem to be many calls to has_key() in the current 3.0 tree. I bet there are other cases like this one.) -- components: Installation messages: 66946 nosy: dbinger severity: normal status: open title: dict.has_key() expected in h2py.py. type: behavior versions: Python 3.0 __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue2893> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2280] parser module chokes on unusual characters
David Binger <[EMAIL PROTECTED]> added the comment: On Jul 11, 2008, at 5:35 PM, Kuba Fast wrote: > I get no problem in 3.0b1. Should this be closed? I think so. It looks like this has been fixed. Thanks. ___ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue2280> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4048] parsermodule won't validate relative imports
New submission from David Binger <[EMAIL PROTECTED]>: The parser module validates st instances that it builds from list or tuple structures. This validation fails for parse trees that include relative imports because it fails to correctly count the dots that immediately follow the "from" token. Here is a test and a patch. This bug probably extends back to all Python 2 versions that support relative import, but I have not checked it. Fixing this has immediate value to me because the QPY package depends on the parser module to convert list structures into st instances. (In the long run, I wonder if the verification part of the sequence2st() function could be made optional or dropped, since the current pattern requires to parser module to be updated every time the language grammer changes.) -- components: Library (Lib) files: parserdot.diff keywords: patch messages: 74354 nosy: dbinger severity: normal status: open title: parsermodule won't validate relative imports type: behavior versions: Python 3.0 Added file: http://bugs.python.org/file11705/parserdot.diff ___ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue4048> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1482] IMAP4 SSL isn't working
David Binger added the comment: Bill's patch does appear to fix the ssl-related problem. imaplib is still broken in py3k, though, due to bytes/str issues. -- nosy: +dbinger __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1482> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1482] IMAP4 SSL isn't working
David Binger added the comment: On Jan 31, 2008, at 12:42 PM, Bill Janssen wrote: > > Bill Janssen added the comment: > > But that's issue 1210, which is still open. David, do you want to > submit a patch for 1210? I see that you are correct that 1210 is the bytes/str issue. I regret it, but I won't be able to supply a patch. > > Meanwhile, do we still need this issue to be open? Unless I'm missing something, the patch "b" that you posted has not been checked in. I think the issue should remain open until that happens. __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1482> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2280] parser module chokes on unusual characters
New submission from David Binger <[EMAIL PROTECTED]>: This is with the current revision of py3k: 61353. parser.suite('"\u1234"') fails with a TypeError. Changing the argument format from "s" to "s#" works around this problem. I added a unit test for this. After fixing the "s#", another bug is exposed by the same test: a string literal containing \u1234 is mangled by sequence2st(). The last section of the patch seems to correct the second bug. (I think getarg.c's handling of "s" has a problem handling a unicode string containing a character whose encoding is not 1 byte. It has a test for null bytes at the end that does not work correctly.) -- components: Library (Lib) files: parsermodule.patch keywords: patch messages: 63482 nosy: dbinger severity: normal status: open title: parser module chokes on unusual characters type: behavior versions: Python 3.0 Added file: http://bugs.python.org/file9662/parsermodule.patch __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue2280> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2285] list.sort.__doc__ says "cmp" is a keyword, but it isn't.
New submission from David Binger <[EMAIL PROTECTED]>: (at revision 61376) It looks like this docstring needs to be updated. -- assignee: georg.brandl components: Documentation messages: 63521 nosy: dbinger, georg.brandl severity: minor status: open title: list.sort.__doc__ says "cmp" is a keyword, but it isn't. versions: Python 3.0 __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue2285> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2285] list.sort.__doc__ says "cmp" is a keyword, but it isn't.
David Binger <[EMAIL PROTECTED]> added the comment: Hi Bruno, Are you testing py3k? This is what I see: Python 3.0a3+ (py3k:61352M, Mar 12 2008, 13:11:35) [GCC 4.0.1 (Apple Inc. build 5465)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> [].sort(cmp=lambda x, y: 1) Traceback (most recent call last): File "", line 1, in TypeError: 'cmp' is an invalid keyword argument for this function >>> In listobject.c, in listsort(), at line 1863, we have the following, which appears to be where "key" and "reverse" keyword args are supported, but not "cmp". static char *kwlist[] = {"key", "reverse", 0}; assert(self != NULL); assert (PyList_Check(self)); if (args != NULL) { if (!PyArg_ParseTupleAndKeywords(args, kwds, "|Oi:sort", On Mar 14, 2008, at 8:41 AM, Bruno Gola wrote: > > Bruno Gola <[EMAIL PROTECTED]> added the comment: > > i'm using the lastest version from subversion (trunk) and cmp still > is a > keyord for list.sort. __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue2285> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4396] parser module fails to validate "with" statements.
New submission from David Binger <[EMAIL PROTECTED]>: The parser module validates node trees when they are built from sequences. The validator must, unfortunately, be updated every time there is a change in the grammar. The current validator fails to validate "with" statements. This bug probably exists in earlier versions of python that support "with", but I haven't checked. Here is a patch with a unit test for py3k. Files involved: parsermodule.c, test_parser.py. -- components: Library (Lib) files: parsewith.diff keywords: patch messages: 76271 nosy: dbinger severity: normal status: open title: parser module fails to validate "with" statements. type: behavior versions: Python 3.0 Added file: http://bugs.python.org/file12111/parsewith.diff ___ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue4396> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4396] parser module fails to validate "with" statements.
David Binger <[EMAIL PROTECTED]> added the comment: Thanks, Benjamin. I see that you applied this to the main python branch, which is probably okay (though I haven't tested it), but I wrote the patch against the py3k code. Did you mean to apply it to py3k? On Nov 23, 2008, at 11:09 PM, Benjamin Peterson wrote: > > Benjamin Peterson <[EMAIL PROTECTED]> added the comment: > > Thanks for the patch! Fixed in r67365. > > -- > nosy: +benjamin.peterson > resolution: -> fixed > status: open -> closed > > ___ > Python tracker <[EMAIL PROTECTED]> > <http://bugs.python.org/issue4396> > ___ ___ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue4396> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com