DEF X = -1 raises TypeError in ExprNodes.py

Bug #227784 reported by Joost Cassee on 2008-05-07
2
Affects Status Importance Assigned to Milestone
Cython
Fix Committed
Medium
Unassigned

Bug Description

The fix for bug #220108 introduces a problem when defining a negative integer:

DEX X = -1

...
  File "/usr/lib/python2.5/site-packages/Cython-0.9.6.14-py2.5.egg/Cython/Compiler/Parsing.py", line 1267, in p_DEF_statement
    value = expr.compile_time_value(denv)
  File "/usr/lib/python2.5/site-packages/Cython-0.9.6.14-py2.5.egg/Cython/Compiler/ExprNodes.py", line 674, in compile_time_value
    return int(self.value, 0)
TypeError: int() can't convert non-string with explicit base

Cython version 0.9.6.13 worked fine.

We are now using trac, could you please file your bug there?

http://trac.cython.org/cython_trac

On May 7, 2008, at 7:43 AM, Joost Cassee wrote:
> Public bug reported:
>
> The fix for bug #220108 introduces a problem when defining a negative
> integer:
>
> DEX X = -1
>
> ...
> File "/usr/lib/python2.5/site-packages/Cython-0.9.6.14-py2.5.egg/
> Cython/Compiler/Parsing.py", line 1267, in p_DEF_statement
> value = expr.compile_time_value(denv)
> File "/usr/lib/python2.5/site-packages/Cython-0.9.6.14-py2.5.egg/
> Cython/Compiler/ExprNodes.py", line 674, in compile_time_value
> return int(self.value, 0)
> TypeError: int() can't convert non-string with explicit base
>
> Cython version 0.9.6.13 worked fine.
>
> ** Affects: cython
> Importance: Undecided
> Status: New
>
> --
> DEF X = -1 raises TypeError in ExprNodes.py
> https://bugs.launchpad.net/bugs/227784
> You received this bug notification because you are a member of Cython-
> dev, which is subscribed to Cython.

scoder (scoder) wrote :

This was actually due to a different bug that showed only after fixing bug #220108.

Thanks!

Changed in cython:
importance: Undecided → Medium
status: New → Fix Committed
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers