Differences between revisions 41 and 87 (spanning 46 versions)
Revision 41 as of 2007-10-08 20:12:09
Size: 5547
Editor: n01-114
Comment: status update, also cleared the mess I left in the last edit
Revision 87 as of 2014-05-22 20:42:25
Size: 107
Editor: SXkz
Comment:
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
== Gaps between Jython and Django ==

[http://pipes.yahoo.com/pipes/pipe.info?_id=jroxOD1f3BGgvtiIqGIyXQ RSS Aggregator for blog posts about Django on Jython]

=== Major problems ===

 * Jython does not support non-str keys in {{{__dict__}}} right now. Jim Baker replaced the custom dictionary in {{{PyStringMap}}} with a {{{HashMap}}} (along Groves' earlier work). This change should resolve this problem. Try the [https://jython.svn.sourceforge.net/svnroot/jython/branches/modern/ modern] branch. Problem encountered in {{{django/utils/_threading_local.py}}}.
 * Something goes wrong with {{{re.compile(u"([\u0080-\uffff])")}}} in {{{django/utils/text.py}}} I think it is a lacking in our array implementation but this needs more investigation.
   * See [http://sourceforge.net/tracker/index.php?func=detail&aid=1544953&group_id=12867&atid=112867 bug 1544953]
 * {{{django/views/debug.py}}} wants to know a function's {{{__module__}}}. functions don't have a {{{__module__}}} attribute in jython yet. [http://sourceforge.net/tracker/index.php?func=detail&aid=1800472&group_id=12867&atid=312867 patch]
 * {{{inspect.getargs()}}} doesn't work.
   * That's because {{{co_code}}} isn't supported by {{{PyTableCode}}}.
     * '''But''', {{{co_code}}} is used by {{{getargs()}}} only to discover anonymous tuple arguments. Commenting such section seems to be enough to get the other cases working.
     * workaround [https://dev.archer.edu.au/projects/kepler/svn/jython-django/trunk/jython-patches/co_code-workaround.patch patch]. just sets {{{co_code = ""}}}. i haven't come across any problems for this inside django yet, but i'm sure it'll break other python code -- TristanKing
 * {{{time}}} module lacks {{{strptime()}}}.
   * workaround [https://dev.archer.edu.au/projects/kepler/svn/jython-django/trunk/jython-patches/time-strptime.patch patch]. this is incomplete, untested, and not optimal but works for the django tutorial -- TristanKing
 * inspect.isclass(time) shouldn't return True [http://sourceforge.net/tracker/index.php?func=detail&aid=1786009&group_id=12867&atid=112867 bug]
   * Django [http://code.djangoproject.com/changeset/6194 works around this] until it's fixed.

=== Minor annoyances ===

 * slice should be a type, not a function. [http://sourceforge.net/tracker/index.php?func=detail&aid=1791931&group_id=12867&atid=112867 bug] [http://sourceforge.net/tracker/index.php?func=detail&aid=1798544&group_id=12867&atid=312867 patch]
 * {{{PyBoolean.__tojava__}}} returns an {{{Integer}}}
   * It affects zxJDBC unless a DataHandler sets the right type of boolean parameters. Fortunately, JDBC30DataHandler does this thing, at least on my limited tests -- LeonardoSoto
 * Jython does not have {{{__builtins__}}} as a module. Django adds "_" as a convenience method for calling gettext in {{{django/conf/__init__.py}}}.
    * According to the Python docs, {{{__builtins__}}} is a implementation detail and shouldn't be used by portable applications, so it's a Django problem. (See note about {{{__builtins__}}} here: http://docs.python.org/ref/naming.html)
 * Jython methods are not descriptors. It seems a implementation detail. [http://code.djangoproject.com/ticket/5664 django patch]
 * Jython classes which extend dict cannot be compared to a dict. [https://sourceforge.net/tracker/index.php?func=detail&aid=1804011&group_id=12867&atid=112867 bug] [https://dev.archer.edu.au/projects/kepler/changeset/149?format=diff&new=149 django patch]
 * Jython doesn't recognize {{{__unicode__}}} methods assigned to instances.
    * But, this is the only {{{__*__}}} method where CPython allows this, and it's not documented anywhere. So, it's a implementation detail and should be fixed on Django. [http://code.djangoproject.com/ticket/5560 django patch]

=== Already Fixed ===

 * Jython does not have {{{sys.stdout.isatty}}}. Jython should get added to the exclusions around that call in {{{django/core/management.py}}} (win32 and 'Pocket PC' are already excluded).
   * Fixed in [http://code.djangoproject.com/changeset/6032 Django changeset 6032]
 * stringmap (or the {{{__dict__}}} implementation) needs a {{{pop(o)}}} method.
 * Jython lists and tuples don't have {{{__iter__}}} .
   * Fixed in [http://code.djangoproject.com/changeset/6211 Django changeset 6211]
 * Jython does not have {{{os.getpid()}}}.
   * Django workarounds it now.
 * Jython does not have {{{os.W_OK}}} needed in {{{django/core/management.py}}}. This probably will not be hard to add this since {{{java.io.File}}} has a {{{canWrite()}}}.
   * {{{os.chmod}}} should be implemented too (After checking for write permissions, Django will try to change them if necessary).
     * That's hard. Maybe Django shouldn't check for permissions if running on Jython.
   * Django don't check or change file permissions when running on Jython now
 * The {{{U}}} (Universal newlines) flag for {{{open()}}} isn't recognized on Jython
 * Unicode string interpolation doesn't work
 * {{{object}}} has a {{{__unicode__}}} attribute (it doesn't on CPython) [https://sourceforge.net/tracker/?func=detail&atid=112867&aid=1800378&group_id=12867 bug] [https://sourceforge.net/tracker/?func=detail&atid=312867&aid=1800381&group_id=12867 patch] -- TristanKing
 * metaclasses need to know the {{{__module__}}} of its classes [http://sourceforge.net/tracker/index.php?func=detail&aid=1781500&group_id=12867&atid=112867 bug] [http://sourceforge.net/tracker/index.php?func=detail&aid=1789137&group_id=12867&atid=312867 patch]
My name is Veronica and I am studying Nutritional Sciences and Hotel Administration at Sant'anna / Italy.

My name is Veronica and I am studying Nutritional Sciences and Hotel Administration at Sant'anna / Italy.

DjangoOnJython (last edited 2014-05-22 23:24:19 by AdamBurke)