Python-3.2 (SVN) bug [was syntax question]

Discussion in 'Python' started by Helmut Jarausch, Oct 12, 2009.

  1. I wrote
    I'm trying to build the recent Python-3.2a (SVN).
    It fails in
    Lib/tokenize.py (line 87)


    85 def group(*choices): return '(' + '|'.join(choices) + ')'
    86 def any(*choices): return group(*choices) + '*'
    87 def maybe(*choices): return group(*choices) + '?'

    with: TypeError: group() argument after ** must be a mapping, not tuple


    Meanwhile I could narrow this down to the --with-tsc configure option.
    Without it, it builds just fine.

    Helmut.

    --
    Helmut Jarausch

    Lehrstuhl fuer Numerische Mathematik
    RWTH - Aachen University
    D 52056 Aachen, Germany
    Helmut Jarausch, Oct 12, 2009
    #1
    1. Advertising

  2. On Oct 12, 7:55 am, Helmut Jarausch <-aachen.de>
    wrote:
    > I wrote
    > I'm trying to build the recent Python-3.2a (SVN).
    > It fails in
    > Lib/tokenize.py  (line 87)
    >
    > 85  def group(*choices): return '(' + '|'.join(choices) + ')'
    > 86  def any(*choices): return group(*choices) + '*'
    > 87  def maybe(*choices): return group(*choices) + '?'
    >
    > with: TypeError: group() argument after ** must be a mapping, not tuple


    It looks like there's already a tracker issue open for this (or
    for something that looks an awful lot like this issue):

    http://bugs.python.org/issue6603

    but work on that bug has stalled, because core developers have
    been unable to reproduce the problem.

    It would be really helpful if you could add a comment to that
    bug report, giving as much system information (including
    compiler information) as possible. If you can come up with any
    ideas about what might be causing the failure, that would also
    be useful.

    Like Antoine, I'd be inclined to suspect that it's a compiler bug,
    but it could also be caused by some not-quite-standards-compliant
    C code in Python somewhere. What happens if you turn compiler
    optimizations off? (E.g., by editing configure.in to remove all
    occurrences of '-O3' and then rerunning autoconf and autoheader.)

    Thanks,

    Mark
    Mark Dickinson, Oct 12, 2009
    #2
    1. Advertising

  3. On Oct 12, 7:55 am, Helmut Jarausch <-aachen.de>
    wrote:
    > I wrote
    > I'm trying to build the recent Python-3.2a (SVN).
    > It fails in
    > Lib/tokenize.py  (line 87)

    [...]
    > with: TypeError: group() argument after ** must be a mapping, not tuple


    I believe I've found the source of this problem: the --with-tsc
    configure option enables some buggy inline assembly: see the
    READ_TIMESTAMP macro in Python/ceval.c. This uses the constraint
    "A" for the output of the x86 'rdtsc' instruction; for x86 that's
    fine, but for x86_64 it apparently refers to the 'rax' register,
    which is wrong: rdtsc loads its result into the edx and eax
    registers. So the edx register ends up being clobbered without
    gcc knowing about it, and all hell breaks loose as a result.

    So it is a Python bug, not a compiler bug. I've updated the
    bug report, and the bug should be fixed soonish.

    Thanks for reporting this, and for whittling the failure down
    to the --with-tsc configure option!

    Mark
    Mark Dickinson, Oct 12, 2009
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Harry George

    python under subversion (svn)

    Harry George, Apr 27, 2004, in forum: Python
    Replies:
    3
    Views:
    300
    Harry George
    Apr 28, 2004
  2. bruce

    python/svn issues....

    bruce, Apr 12, 2005, in forum: Python
    Replies:
    1
    Views:
    491
    David M. Cooke
    Apr 12, 2005
  3. bruce

    RE: python/svn issues....

    bruce, Apr 12, 2005, in forum: Python
    Replies:
    0
    Views:
    354
    bruce
    Apr 12, 2005
  4. James Stroud

    Using SVN with Python and .pyc files

    James Stroud, Oct 13, 2006, in forum: Python
    Replies:
    4
    Views:
    263
    James Stroud
    Oct 13, 2006
  5. Good Night Moon
    Replies:
    9
    Views:
    267
    Rick DeNatale
    Jul 25, 2007
Loading...

Share This Page