nakagami/pyfirebirdsql — Issue #22: AttributeError: 'Connection' object has no attribute 'port'
Author: mariuz
Created: 2011-11-14 15:34:41+00:00
State: open

Traceback (most recent call last):
File "example4.py", line 2, in
con = firebirdsql.connect(dsn='/tmp/test.db', user='sysdba', password='masterkey')
File "/usr/local/lib/python2.7/dist-packages/firebirdsql/__init__.py", line 61, in connect
database=database, charset=charset, port=port)
File "/usr/local/lib/python2.7/dist-packages/firebirdsql/fbcore.py", line 683, in __init__
self.sock.connect((self.hostname, self.port))
AttributeError: 'Connection' object has no attribute 'port

import firebirdsql
con = firebirdsql.connect(dsn='/tmp/test.db', user='sysdba', password='masterkey')
cur = con.cursor()
newLanguages = [
('Lisp', 1958),
('Dylan', 1995),
]
cur.executemany("insert into languages (name, year_released) values (?, ?)",newLanguages)
# The changes will not be saved unless the transaction is committed explicitly:
con.commit()