Issue1909
Created on 2012-06-06.15:42:05 by adorsk, last changed 2012-06-23.00:49:36 by fwierzbicki.
File name |
Uploaded |
Description |
Edit |
Remove |
attrgetter
|
int3,
2012-06-16.08:59:04
|
Patch |
|
|
msg7183 (view) |
Author: Alex the Jython User (adorsk) |
Date: 2012-06-06.15:42:04 |
|
The 'attrgetter' method in the 'operator' library does not appear to function as expected.
Environment: jython2.7a2, w/ OpenJDK-6 on Ubuntu 12.04
Test: try running the code below:
class Foo(object):
pass
class Bar(object):
pass
f = Foo()
f.bar = Bar()
f.bar.bat = 5
from operator import attrgetter
print attrgetter("bar.bat")(f)
----
The result is this error:
Traceback (most recent call last):
File "t.py", line 13, in <module>
print attrgetter("bar.bat")(f)
AttributeError: 'Foo' object has no attribute 'bar.bat'
This specifically causes problems when used with SqlAlchemy 0.7.7, as per this thread:
http://groups.google.com/group/sqlalchemy/browse_thread/thread/8dd77dccad818ba6
PS: I'm just getting into Jython, looks like a very cool tool, and potentially very useful as well.
|
msg7222 (view) |
Author: Jez Ng (int3) |
Date: 2012-06-15.07:40:36 |
|
This patch fixes the issue.
|
msg7223 (view) |
Author: Jez Ng (int3) |
Date: 2012-06-15.12:04:52 |
|
Didn't set up the first patch properly -- here's an updated copy.
|
msg7232 (view) |
Author: Jez Ng (int3) |
Date: 2012-06-16.08:59:04 |
|
Third attempt at submitting a proper patch file.
|
msg7257 (view) |
Author: Frank Wierzbicki (fwierzbicki) |
Date: 2012-06-22.20:35:38 |
|
Jez: I applied your patch - note that I added the test that adorsk submitted to test_operator_jy.py. Normally I would have bugged you to do that but it's too close to beta time :)
|
msg7258 (view) |
Author: Jez Ng (int3) |
Date: 2012-06-22.22:02:57 |
|
There's actually a test for dotted attributes in the original CPython test which I uncommented. :)
|
msg7259 (view) |
Author: Frank Wierzbicki (fwierzbicki) |
Date: 2012-06-23.00:49:35 |
|
Oops - you know I think I pushed so many of your patches that I probably just got mixed up :) -- I'll delete the redundant test.
|
|
Date |
User |
Action |
Args |
2012-06-23 00:49:36 | fwierzbicki | set | messages:
+ msg7259 |
2012-06-22 22:02:57 | int3 | set | messages:
+ msg7258 |
2012-06-22 20:35:39 | fwierzbicki | set | status: open -> closed resolution: fixed messages:
+ msg7257 nosy:
+ fwierzbicki |
2012-06-16 08:59:04 | int3 | set | files:
+ attrgetter messages:
+ msg7232 title: attrgetter not working -> attrgetter does not parse dotted attributes |
2012-06-16 08:58:29 | int3 | set | files:
- attrgetter.diff |
2012-06-15 12:04:52 | int3 | set | files:
+ attrgetter.diff keywords:
+ patch messages:
+ msg7223 |
2012-06-15 11:56:38 | int3 | set | files:
- attrgetter |
2012-06-15 07:40:36 | int3 | set | files:
+ attrgetter nosy:
+ int3 messages:
+ msg7222 |
2012-06-06 15:42:05 | adorsk | create | |
|