Skip to content

Loading…

initialization fails on Jython #75

Closed
FND opened this Issue · 2 comments

2 participants

@FND

as discussed on IRC:

Jython 2.5.3b1 (2.5:5fa0a5810b25, Feb 22 2012, 12:39:02) 
[OpenJDK 64-Bit Server VM (Oracle Corporation)] on java1.7.0_03-icedtea
Type "help", "copyright", "credits" or "license" for more information.
>>> from flaskext.sqlalchemy import SQLAlchemy
>>> SQLAlchemy()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/fnd/jython/Lib/site-packages/flaskext/sqlalchemy.py", line 606, in __init__
    _include_sqlalchemy(self)
  File "/home/fnd/jython/Lib/site-packages/flaskext/sqlalchemy.py", line 81, in _include_sqlalchemy
    setattr(obj, key, getattr(module, key))
AttributeError: 'module' object has no attribute 'sys'

(tested with Jython v2.5.2 and v2.5.3b1)

Wrapping that line in a try ... except: pass seems to work fine (debugging shows that "sys" is the only key to throw that error).

some more data based on our IRC conversation:

Jython 2.5.3b1 (2.5:5fa0a5810b25, Feb 22 2012, 12:39:02) 
[OpenJDK 64-Bit Server VM (Oracle Corporation)] on java1.7.0_03-icedtea
Type "help", "copyright", "credits" or "license" for more information.
>>> import sqlalchemy
>>> sqlalchemy.__all__
['BLOB', 'BOOLEAN', 'BigInteger', 'Binary', 'Boolean', 'CHAR', 'CLOB',
'CheckConstraint', 'Column', 'ColumnDefault', 'Constraint', 'DATE',
'DATETIME', 'DDL', 'DECIMAL', 'Date', 'DateTime', 'DefaultClause', 'Enum',
'FLOAT', 'FetchedValue', 'Float', 'ForeignKey', 'ForeignKeyConstraint',
'INT', 'INTEGER', 'Index', 'Integer', 'Interval', 'LargeBinary',
'MetaData', 'NCHAR', 'NUMERIC', 'NVARCHAR', 'Numeric', 'PassiveDefault',
'PickleType', 'PrimaryKeyConstraint', 'REAL', 'SMALLINT', 'Sequence',
'SmallInteger', 'String', 'TEXT', 'TIME', 'TIMESTAMP', 'Table', 'Text',
'ThreadLocalMetaData', 'Time', 'TypeDecorator', 'Unicode', 'UnicodeText',
'UniqueConstraint', 'VARCHAR', 'alias', 'and_', 'asc', 'between',
'bindparam', 'case', 'cast', 'collate', 'create_engine', 'delete', 'desc',
'distinct', 'engine_from_config', 'except_', 'except_all', 'exists',
'extract', 'func', 'insert', 'intersect', 'intersect_all', 'join',
'literal', 'literal_column', 'modifier', 'not_', 'null', 'or_',
'outerjoin', 'outparam', 'over', 'select', 'subquery', 'sys', 'text',
'tuple_', 'type_coerce', 'union', 'union_all', 'update']
@immunda
Collaborator

Any update on this before I kill it?

@immunda
Collaborator

💔

@immunda immunda closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.