Skip to content

AttributeError #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
tcicit opened this issue Jan 17, 2021 · 5 comments
Closed

AttributeError #3

tcicit opened this issue Jan 17, 2021 · 5 comments

Comments

@tcicit
Copy link

tcicit commented Jan 17, 2021

Hello, pysimplesql is exactly what I was looking for :-). A simple GUI for a small database.
Unfortunately I get the following error when running your sample program.

Traceback (most recent call last):
File "example2.py", line 25, in
db = ss.Database('example2.db', win) # <=== load the database and bind it to the window
File "/home/test-db/pysimplesql.py", line 694, in init
new_database = not os.path.isfile(sqlite3_database)
File "/usr/lib/python3.8/genericpath.py", line 30, in isfile
st = os.stat(path)
TypeError: stat: path should be string, bytes, os.PathLike or integer, not Window
Exception ignored in: <function Database.del at 0x7fd34ee2dca0>
Traceback (most recent call last):
File "/home/test-db/pysimplesql.py", line 725, in del
if self.path!=':memory:':
AttributeError: 'Database' object has no attribute 'path'

@Sprucelass
Copy link

Having this same issue.

@jrwhit1
Copy link

jrwhit1 commented Feb 3, 2021

I've seen that error. This is the one I usually get.

Traceback (most recent call last):
File "C:\Users\Joe\Documents\PythonCode\PySimpleGui\MakeSQLiteDB.py", line 18, in
ss.record_actions('Item', False)
AttributeError: module 'pysimplesql' has no attribute 'record_actions'

@dani-91
Copy link

dani-91 commented Mar 27, 2021

Hi, I'm also currently testing the library. I solved the issue changing following line in pysimplesql.py (line 694):
new_database = not os.path.isfile(sqlite3_database)
TO:
new_database = not os.path.isfile(db_path)

and in example2.py (line 25):
db = ss.Database('example2.db', win, sql_file='example2.sql')
TO:
db = ss.Database('example2.db', win=win, sql_file='example2.sql')

@jrwhit1
Copy link

jrwhit1 commented Mar 27, 2021

Good job, dani-91. I hadn't given up hope that someone would come up with the solution.

@PySimpleSQL
Copy link
Owner

Sorry for the hiatus

Examples have been fixed!
Next step is getting this onto PyPi officially

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants