Issue1758279

classification
Title: Java classes exposed as Python classes but have no __module__
Type: Severity: normal
Components: None Versions:
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: nriley Nosy List: cgroves, fwierzbicki, glyph, nriley
Priority: normal Keywords: patch, test failure causes, twisted

Created on 2007-07-22.00:19:19 by cgroves, last changed 2008-09-07.15:02:25 by nriley.

Files
File name Uploaded Description Edit Remove
classnames.patch glyph, 2008-09-06.20:07:35
classnames-with-tests.patch glyph, 2008-09-06.20:35:46
classnames-2.patch nriley, 2008-09-06.22:49:15
Messages
msg1751 (view) Author: Charlie Groves (cgroves) Date: 2007-07-22.00:19:19
Java classes are exposed like Python classes by PyJavaClass, but they have no __module__ field like a Python class.  Since they aren't really defined in a module, it probably makes sense to just add this as None but I'm not sure enough of that to just go ahead and do it.

As it is, this causes doctest to fail when it runs _from_module since it expects anything inspect thinks is a class to have a __module__
msg1752 (view) Author: Charlie Groves (cgroves) Date: 2007-08-06.00:05:59
See http://wiki.python.org/jython/JythonDeveloperGuide/VersionTransitionTestExclusions for how to get the test running again to fix this.
msg3471 (view) Author: Glyph Lefkowitz (glyph) Date: 2008-09-06.16:17:29
Twisted needs this for a bunch of different things; the
"twisted.python.reflect.qual" function expects to be able to get the
name of a class by joining its "__module__" and its "__name__".
msg3477 (view) Author: Glyph Lefkowitz (glyph) Date: 2008-09-06.20:07:35
I couldn't find the appropriate place for test cases, but hopefully this
will be useful to someone anyway - here's a rough cut of setting
__name__ and __module__ correctly.
msg3478 (view) Author: Glyph Lefkowitz (glyph) Date: 2008-09-06.20:35:45
Improved version of the patch, with tests.
msg3479 (view) Author: Nicholas Riley (nriley) Date: 2008-09-06.22:49:15
This patch fixes all the regressions but test_ast.
msg3482 (view) Author: Nicholas Riley (nriley) Date: 2008-09-07.15:02:25
Frank fixed up test_ast and committed it in r5301.
History
Date User Action Args
2008-09-07 15:02:25nrileysetstatus: open -> closed
resolution: accepted -> fixed
messages: + msg3482
2008-09-06 22:49:16nrileysetfiles: + classnames-2.patch
nosy: + fwierzbicki
messages: + msg3479
2008-09-06 20:41:50nrileysetkeywords: + patch, twisted
assignee: nriley
resolution: accepted
nosy: + nriley
2008-09-06 20:35:46glyphsetfiles: + classnames-with-tests.patch
messages: + msg3478
2008-09-06 20:07:35glyphsetfiles: + classnames.patch
messages: + msg3477
2008-09-06 16:17:36glyphsettitle: Java classes exposed as Python classes but have no __module_ -> Java classes exposed as Python classes but have no __module__
2008-09-06 16:17:30glyphsetnosy: + glyph
messages: + msg3471
2007-07-22 00:19:19cgrovescreate