"Variable referenced before initialization" using Cython 0.15 to compile extensions
Bug #837221 reported by
John A Meinel
This bug affects 3 people
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Bazaar |
Fix Released
|
Medium
|
Denys Duchier | ||
2.4 |
Fix Released
|
Medium
|
Martin Packman | ||
bzr (Ubuntu) |
Fix Released
|
Medium
|
Jelmer Vernooij | ||
Oneiric |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
I did a test build, upgrading to Cython 0.15 (the current latest). They changed the code so that now variables are no longer implicitly initialized. eg:
cdef foo
if foo is not None:
...
In earlier Cython (and Pyrex) objects were always initialized to None, and other variables to a reasonable default (pointers to NULL, etc).
The one bit I investigated was spurious, the variable was being set by a function call as an 'out' parameter. However, there were about 10 warnings, and it would be nice to be warning free.
This would apply to older versions of bzr as well, since the windows build host uses the same version of Cython across all versions.
Related branches
lp:~denys.duchier/bzr/bzr.cython015
- Jelmer Vernooij (community): Approve
-
Diff: 26 lines (+4/-1)2 files modifiedbzrlib/_dirstate_helpers_pyx.pyx (+1/-0)
setup.py (+3/-1)
lp:~gz/bzr/2.4_new_cython_compat_837221
- John A Meinel: Approve
-
Diff: 38 lines (+5/-1)3 files modifiedbzrlib/_dirstate_helpers_pyx.pyx (+1/-0)
doc/en/release-notes/bzr-2.4.txt (+3/-0)
setup.py (+1/-1)
affects: | bazaar (Ubuntu) → bzr (Ubuntu) |
Changed in bzr (Ubuntu): | |
status: | New → Confirmed |
Changed in bzr (Ubuntu): | |
status: | New → In Progress |
assignee: | nobody → Jelmer Vernooij (jelmer) |
importance: | Undecided → Medium |
To post a comment you must log in.
Apparently quite a few people are now running into this in the form of errors like:
Traceback (most recent call last): helpers_ pyx.pyx" , line 1459, in bzrlib. _dirstate_ helpers_ pyx.ProcessEntr yC.__next_ _ (bzrlib/ _dirstate_ helpers_ pyx.c:12037) helpers_ pyx.pyx" , line 1732, in bzrlib. _dirstate_ helpers_ pyx.ProcessEntr yC._iter_ next (bzrlib/ _dirstate_ helpers_ pyx.c:14786) helpers_ pyx.pyx" , line 1888, in bzrlib. _dirstate_ helpers_ pyx.ProcessEntr yC._loop_ one_block (bzrlib/ _dirstate_ helpers_ pyx.c:16487)
...
File "_dirstate_
File "_dirstate_
File "_dirstate_
UnboundLocalError: local variable 'changed' referenced before assignment