Hmmm. I have a Windows machine on my desk, and the only linux boxes I have access to (through SSH) don't have internet access.
So I browsed to the link you had in the hg clone command, and downloaded from the zip file at the left of the page. I then extracted and copied the contents onto a linux machine, cd'd in and ran ant. The build failed, I have attached the output. Did I do something wrong? Or is there a problem with what I downloaded? Or is something missing/incorrect on the machine I'm trying to compile on? From: sqlalchemy@googlegroups.com [mailto:sqlalchemy@googlegroups.com] On Behalf Of Cam Jackson Sent: Thursday, 17 November 2011 8:56 PM To: sqlalchemy@googlegroups.com Cc: Michael Bayer Subject: Re: [sqlalchemy] Trouble getting started with SQLAlchemy on Jython Wow, that was quick! Wish I'd come to the mailing list before I spent my whole day baffled over this! Thanks a lot guys, will have to look into getting the fix. Although I've never used mercurial or ant before. On Thu, Nov 17, 2011 at 5:59 PM, Philip Jenvey <pjen...@underboss.org<mailto:pjen...@underboss.org>> wrote: On Nov 16, 2011, at 10:27 PM, Michael Bayer wrote: > > On Nov 17, 2011, at 1:04 AM, CamJackson wrote: > >> (First time poster here, sorry if I break any rules. I tried to find >> info on formatting code etc, but failed.) >> >> >> However if I try to run the above code on Jython, with the only >> modification being to change the string passed to create_engine() to >> "postgresql+zxjdbc://jacksonc:abc123@localhost:5432/testdb", it >> doesn't work. I get the following output when the User class is >> declared: >> raise AttributeError( >> AttributeError: Module sqlalchemy.orm.mapperlib has no attribute >> 'Mapper' > > This is a known bug in the current version of Jython - not an easy one to > come across but nevertheless one that breaks with SQLA's current import > scheme. I've given a test case to Philip Jenvey who's been looking into it. > I'm not really sure what the workaround is at the moment, its possible that > importing things in a certain order might be the trick to make it work. > I've CC'ed him on this in case there's some more detail. The import bug ( http://bugs.jython.org/issue1811 ) is already fixed for the upcoming Jython 2.5.3 release (coming soon). In the meantime you'll have to build your own Jython from the 2.5 maintenance branch to workaround this. Basically: hg clone http://hg.python.org/jython#2.5 jython-2.5 cd jython-2.5 ant -- Philip Jenvey -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to sqlalchemy@googlegroups.com<mailto:sqlalchemy@googlegroups.com>. To unsubscribe from this group, send email to sqlalchemy+unsubscr...@googlegroups.com<mailto:sqlalchemy%2bunsubscr...@googlegroups.com>. For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en. -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to sqlalchemy@googlegroups.com. To unsubscribe from this group, send email to sqlalchemy+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en. ------------------------------------------------------------------------- DISCLAIMER: This e-mail transmission and any documents, files and previous e-mail messages attached to it are private and confidential. They may contain proprietary or copyright material or information that is subject to legal professional privilege. They are for the use of the intended recipient only. Any unauthorised viewing, use, disclosure, copying, alteration, storage or distribution of, or reliance on, this message is strictly prohibited. No part may be reproduced, adapted or transmitted without the written permission of the owner. If you have received this transmission in error, or are not an authorised recipient, please immediately notify the sender by return email, delete this message and all copies from your e-mail system, and destroy any printed copies. Receipt by anyone other than the intended recipient should not be deemed a waiver of any privilege or protection. Thales Australia does not warrant or represent that this e-mail or any documents, files and previous e-mail messages attached are error or virus free. ------------------------------------------------------------------------- -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to sqlalchemy@googlegroups.com. To unsubscribe from this group, send email to sqlalchemy+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en.
bash-3.00$ ant Buildfile: build.xml init: needed-check: clean-if-antlr-needed: init: clean-checkout-dir: clean: [delete] /home/jacksonc/Jython/jython-c280db0483aa/build not found. [delete] /home/jacksonc/Jython/jython-c280db0483aa/dist not found. prepare-output: [mkdir] Created dir: /home/jacksonc/Jython/jython-c280db0483aa/build/classes [mkdir] Created dir: /home/jacksonc/Jython/jython-c280db0483aa/build/gensrc/org/python/antlr [mkdir] Created dir: /home/jacksonc/Jython/jython-c280db0483aa/build/exposed [mkdir] Created dir: /home/jacksonc/Jython/jython-c280db0483aa/dist antlr_gen: [java] warning(105): /home/jacksonc/Jython/jython-c280db0483aa/grammar/Python.g:1231:10: no lexer rule corresponding to token: DEDENT [java] warning(105): /home/jacksonc/Jython/jython-c280db0483aa/grammar/Python.g:1224:15: no lexer rule corresponding to token: INDENT [java] warning(200): /home/jacksonc/Jython/jython-c280db0483aa/grammar/Python.g:1942:59: Decision can match input such as "COMMA BACKQUOTE" using multiple alternatives: 1, 2 [java] As a result, alternative(s) 2 were disabled for that input [java] warning(200): /home/jacksonc/Jython/jython-c280db0483aa/grammar/Python.g:1942:62: Decision can match input such as "COMMA" using multiple alternatives: 1, 2 [java] As a result, alternative(s) 2 were disabled for that input [java] warning(200): /home/jacksonc/Jython/jython-c280db0483aa/grammar/Python.g:2312:7: Decision can match input such as "'"'" using multiple alternatives: 1, 2 [java] As a result, alternative(s) 2 were disabled for that input [java] warning(200): /home/jacksonc/Jython/jython-c280db0483aa/grammar/Python.g:2318:7: Decision can match input such as "'\''" using multiple alternatives: 1, 2 [java] As a result, alternative(s) 2 were disabled for that input [java] warning(200): /home/jacksonc/Jython/jython-c280db0483aa/grammar/Python.g:2331:37: Decision can match input such as "{'\t', ' '}" using multiple alternatives: 1, 2 [java] As a result, alternative(s) 2 were disabled for that input [java] Semantic predicates were present but were hidden by actions. [java] warning(105): /home/jacksonc/Jython/jython-c280db0483aa/grammar/PythonPartial.g:727:19: no lexer rule corresponding to token: TRAILBACKSLASH [java] warning(105): /home/jacksonc/Jython/jython-c280db0483aa/grammar/PythonPartial.g:549:33: no lexer rule corresponding to token: DEDENT [java] warning(105): /home/jacksonc/Jython/jython-c280db0483aa/grammar/PythonPartial.g:549:17: no lexer rule corresponding to token: INDENT [java] warning(105): /home/jacksonc/Jython/jython-c280db0483aa/grammar/PythonPartial.g:689:7: no lexer rule corresponding to token: TRAILBACKSLASH [java] warning(105): /home/jacksonc/Jython/jython-c280db0483aa/grammar/PythonPartial.g:548:18: no lexer rule corresponding to token: DEDENT [java] warning(200): /home/jacksonc/Jython/jython-c280db0483aa/grammar/PythonPartial.g:175:27: Decision can match input such as "NEWLINE" using multiple alternatives: 1, 2 [java] As a result, alternative(s) 2 were disabled for that input [java] warning(200): /home/jacksonc/Jython/jython-c280db0483aa/grammar/PythonPartial.g:802:39: Decision can match input such as "COMMA BACKQUOTE" using multiple alternatives: 1, 2 [java] As a result, alternative(s) 2 were disabled for that input [java] warning(200): /home/jacksonc/Jython/jython-c280db0483aa/grammar/PythonPartial.g:802:42: Decision can match input such as "COMMA" using multiple alternatives: 1, 2 [java] As a result, alternative(s) 2 were disabled for that input [java] warning(200): /home/jacksonc/Jython/jython-c280db0483aa/grammar/PythonPartial.g:1061:38: Decision can match input such as "'\\''\n'{'\t', ' '}'#''\\''\n'" using multiple alternatives: 1, 3 [java] As a result, alternative(s) 3 were disabled for that input [java] warning(200): /home/jacksonc/Jython/jython-c280db0483aa/grammar/PythonPartial.g:1061:38: Decision can match input such as "'\\''\n'{'\t', ' '}'#''\\''\r''\n'" using multiple alternatives: 1, 3 [java] As a result, alternative(s) 3 were disabled for that input [java] warning(200): /home/jacksonc/Jython/jython-c280db0483aa/grammar/PythonPartial.g:1062:40: Decision can match input such as "'\\''\n'{'\t', ' '}'#''\\''\r''\n'" using multiple alternatives: 1, 3 [java] As a result, alternative(s) 3 were disabled for that input [java] warning(200): /home/jacksonc/Jython/jython-c280db0483aa/grammar/PythonPartial.g:1062:40: Decision can match input such as "'\\''\n'{'\t', ' '}'#''\\''\n'" using multiple alternatives: 1, 3 [java] As a result, alternative(s) 3 were disabled for that input [java] warning(200): /home/jacksonc/Jython/jython-c280db0483aa/grammar/PythonPartial.g:1070:7: Decision can match input such as "'"'" using multiple alternatives: 1, 2 [java] As a result, alternative(s) 2 were disabled for that input [java] warning(200): /home/jacksonc/Jython/jython-c280db0483aa/grammar/PythonPartial.g:1076:7: Decision can match input such as "'\''" using multiple alternatives: 1, 2 [java] As a result, alternative(s) 2 were disabled for that input [java] warning(200): /home/jacksonc/Jython/jython-c280db0483aa/grammar/PythonPartial.g:1092:37: Decision can match input such as "{'\t', ' '}" using multiple alternatives: 1, 2 [java] As a result, alternative(s) 2 were disabled for that input [java] Semantic predicates were present but were hidden by actions. check-hg: hg-branch: hg-tag: hg-version: hg-id: brand-version: [mkdir] Created dir: /home/jacksonc/Jython/jython-c280db0483aa/build/classes/org/python compile: [javac] Compiling 751 source files to /home/jacksonc/Jython/jython-c280db0483aa/build/classes [javac] /home/jacksonc/Jython/jython-c280db0483aa/src/org/python/util/NameUnionAntType.java:10: cannot find symbol [javac] symbol : class ResourceCollection [javac] location: package org.apache.tools.ant.types [javac] import org.apache.tools.ant.types.ResourceCollection; [javac] ^ [javac] /home/jacksonc/Jython/jython-c280db0483aa/src/org/python/util/NameUnionAntType.java:11: package org.apache.tools.ant.types.resources does not exist [javac] import org.apache.tools.ant.types.resources.BaseResourceCollectionContainer; [javac] ^ [javac] /home/jacksonc/Jython/jython-c280db0483aa/src/org/python/util/NameUnionAntType.java:16: cannot find symbol [javac] symbol: class BaseResourceCollectionContainer [javac] public class NameUnionAntType extends BaseResourceCollectionContainer { [javac] ^ [javac] /home/jacksonc/Jython/jython-c280db0483aa/src/com/ziclix/python/sql/Jython22DataHandler.java:258: warning: [deprecation] getBigDecimal(int,int) in java.sql.ResultSet has been deprecated [javac] bd = set.getBigDecimal(col, set.getMetaData().getPrecision(col)); [javac] ^ [javac] /home/jacksonc/Jython/jython-c280db0483aa/src/com/ziclix/python/sql/Jython22DataHandler.java:260: warning: [deprecation] getBigDecimal(int,int) in java.sql.ResultSet has been deprecated [javac] bd = set.getBigDecimal(col, 10); [javac] ^ [javac] /home/jacksonc/Jython/jython-c280db0483aa/src/com/ziclix/python/sql/Jython22DataHandler.java:349: warning: [deprecation] getBigDecimal(int,int) in java.sql.CallableStatement has been deprecated [javac] BigDecimal bd = stmt.getBigDecimal(col, 10); [javac] ^ [javac] /home/jacksonc/Jython/jython-c280db0483aa/src/org/python/core/util/StringUtil.java:44: warning: [deprecation] String(byte[],int,int,int) in java.lang.String has been deprecated [javac] return new String(buf, 0, off, len); [javac] ^ [javac] /home/jacksonc/Jython/jython-c280db0483aa/src/org/python/modules/zipimport/zipimporter.java:458: warning: [deprecation] getYear() in java.util.Date has been deprecated [javac] int year = d.getYear() + 1900; [javac] ^ [javac] /home/jacksonc/Jython/jython-c280db0483aa/src/org/python/modules/zipimport/zipimporter.java:462: warning: [deprecation] getMonth() in java.util.Date has been deprecated [javac] return (year - 1980) << 9 | (d.getMonth() + 1) << 5 | d.getDate() << 0; [javac] ^ [javac] /home/jacksonc/Jython/jython-c280db0483aa/src/org/python/modules/zipimport/zipimporter.java:462: warning: [deprecation] getDate() in java.util.Date has been deprecated [javac] return (year - 1980) << 9 | (d.getMonth() + 1) << 5 | d.getDate() << 0; [javac] ^ [javac] /home/jacksonc/Jython/jython-c280db0483aa/src/org/python/modules/zipimport/zipimporter.java:474: warning: [deprecation] getHours() in java.util.Date has been deprecated [javac] return d.getHours() << 11 | d.getMinutes() << 5 | d.getSeconds() >> 1; [javac] ^ [javac] /home/jacksonc/Jython/jython-c280db0483aa/src/org/python/modules/zipimport/zipimporter.java:474: warning: [deprecation] getMinutes() in java.util.Date has been deprecated [javac] return d.getHours() << 11 | d.getMinutes() << 5 | d.getSeconds() >> 1; [javac] ^ [javac] /home/jacksonc/Jython/jython-c280db0483aa/src/org/python/modules/zipimport/zipimporter.java:474: warning: [deprecation] getSeconds() in java.util.Date has been deprecated [javac] return d.getHours() << 11 | d.getMinutes() << 5 | d.getSeconds() >> 1; [javac] ^ [javac] /home/jacksonc/Jython/jython-c280db0483aa/src/org/python/modules/zipimport/zipimporter.java:487: warning: [deprecation] Date(int,int,int,int,int,int) in java.util.Date has been deprecated [javac] Date d = new Date(((dosDate >> 9) & 0x7f) + 80, [javac] ^ [javac] /home/jacksonc/Jython/jython-c280db0483aa/src/org/python/util/NameUnionAntType.java:20: cannot find symbol [javac] symbol : class ResourceCollection [javac] location: class org.python.util.NameUnionAntType [javac] List<ResourceCollection> collections = getResourceCollections(); [javac] ^ [javac] /home/jacksonc/Jython/jython-c280db0483aa/src/org/python/util/NameUnionAntType.java:20: cannot find symbol [javac] symbol : method getResourceCollections() [javac] location: class org.python.util.NameUnionAntType [javac] List<ResourceCollection> collections = getResourceCollections(); [javac] ^ [javac] /home/jacksonc/Jython/jython-c280db0483aa/src/org/python/util/NameUnionAntType.java:24: cannot find symbol [javac] symbol : class ResourceCollection [javac] location: class org.python.util.NameUnionAntType [javac] for (ResourceCollection rc : collections) { [javac] ^ [javac] /home/jacksonc/Jython/jython-c280db0483aa/src/org/python/util/NameUnionAntType.java:18: method does not override a method from its superclass [javac] @Override [javac] ^ [javac] Note: Some input files use unchecked or unsafe operations. [javac] Note: Recompile with -Xlint:unchecked for details. [javac] 7 errors [javac] 11 warnings BUILD FAILED /home/jacksonc/Jython/jython-c280db0483aa/build.xml:522: Compile failed; see the compiler error output for details. Total time: 1 minute 9 seconds