py35: TestCheckForMutableDefaultArgs fails
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Identity (keystone) |
Fix Released
|
High
|
Eric Brown |
Bug Description
The py35 gate fails on TestCheckForMut
ft125.1: keystone.
File "/home/
self.
File "/home/
self.
File "/home/
return self.assertSequ
File "/home/
self.fail(msg)
File "/home/
raise self.failureExc
AssertionError: Sequences differ: [(7, [201 chars] 'K001'), (28, 27, 'K001'), (29, 21, 'K001'), (32, 11, 'K001')] != [(7, [201 chars] 'K001'), (28, 26, 'K001'), (29, 21, 'K001'), (32, 10, 'K001')]
First differing element 12:
(28, 27, 'K001')
(28, 26, 'K001')
[(7, 10, 'K001'),
(10, 15, 'K001'),
(10, 29, 'K001'),
(13, 15, 'K001'),
(16, 15, 'K001'),
(16, 31, 'K001'),
(22, 14, 'K001'),
(22, 31, 'K001'),
(22, 53, 'K001'),
(25, 14, 'K001'),
(25, 36, 'K001'),
(28, 10, 'K001'),
- (28, 27, 'K001'),
? ^
+ (28, 26, 'K001'),
? ^
(29, 21, 'K001'),
- (32, 11, 'K001')]
? ^
+ (32, 10, 'K001')]
? ^
The root cause is a difference the in the ast node col_offset value. Python 3.4 and earlier were incorrect whereas 3.5 is fixed. It only affected two of the function definitions in the code sample.
Here is a sample piece of code that illustrates the difference in the ast module between Pythong 3.5 and earlier versions:
Changed in keystone: | |
assignee: | nobody → Eric Brown (ericwb) |
status: | New → In Progress |
Changed in keystone: | |
importance: | Undecided → High |
milestone: | none → newton-3 |
Reviewed: https:/ /review. openstack. org/337952 /git.openstack. org/cgit/ openstack/ keystone/ commit/ ?id=05b5dfe1449 58b70331a841184 40d6bb0e2863e2
Committed: https:/
Submitter: Jenkins
Branch: master
commit 05b5dfe144958b7 0331a84118440d6 bb0e2863e2
Author: Eric Brown <email address hidden>
Date: Tue Jul 5 18:53:52 2016 -0700
Handle Py35 fix of ast.node.col_offset bug
In 3.5, the ast module returns the correct value for the col_offset
of a function definition whereas earlier versions did not. The value
is off by one column.
Closes-Bug: #1603236
Change-Id: I7835d7ed8d652a 6bd585e8e0372fa b402424038d