[web2py] Re: AttributeError: 'SQLite' object has no attribute 'file_open'

2017-09-01 Thread Jitun John
You are totally correct my friend.
I updated gluon\packages\dal\pydal with latest pyDal to resolve the issue.


On Friday, September 1, 2017 at 3:37:53 AM UTC+5:30, Massimo Di Pierro 
wrote:
>
> you have the latest web2py but you have an older pydal.
>
> On Tuesday, 29 August 2017 03:47:39 UTC-5, Jitun John wrote:
>>
>> Hi Massimo,
>>
>> I have the 2.15.3 version installed, but the issue remains.
>> I confirm the same code works on 2.14.6
>>
>>
>>
>> 
>>
>>
>>
>>
>>
>>
>>
>>
>> On Sunday, August 13, 2017 at 2:40:08 AM UTC+5:30, Massimo Di Pierro 
>> wrote:
>>>
>>> Committed c995fd7 that should fix this
>>>
>>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: AttributeError: 'SQLite' object has no attribute 'file_open'

2017-08-31 Thread Massimo Di Pierro
you have the latest web2py but you have an older pydal.

On Tuesday, 29 August 2017 03:47:39 UTC-5, Jitun John wrote:
>
> Hi Massimo,
>
> I have the 2.15.3 version installed, but the issue remains.
> I confirm the same code works on 2.14.6
>
>
>
> 
>
>
>
>
>
>
>
>
> On Sunday, August 13, 2017 at 2:40:08 AM UTC+5:30, Massimo Di Pierro wrote:
>>
>> Committed c995fd7 that should fix this
>>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: AttributeError: 'SQLite' object has no attribute 'file_open'

2017-08-29 Thread Lisandro
John, could you try with the web2py version for testers?
The commit fixed the problem, but I think it will be included in the next 
stable version.

At least that's what I did: I downloaded the "for testers" source code 
version, and it worked ok:
This is the link to the download:
https://mdipierro.pythonanywhere.com/examples/static/nightly/web2py_src.zip

You can find it also in the official webpage:
http://web2py.com/init/default/download

Hope it helps.
Regards,
Lisandro.

El martes, 29 de agosto de 2017, 5:47:39 (UTC-3), Jitun John escribió:
>
> Hi Massimo,
>
> I have the 2.15.3 version installed, but the issue remains.
> I confirm the same code works on 2.14.6
>
>
>
> 
>
>
>
>
>
>
>
>
> On Sunday, August 13, 2017 at 2:40:08 AM UTC+5:30, Massimo Di Pierro wrote:
>>
>> Committed c995fd7 that should fix this
>>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: AttributeError: 'SQLite' object has no attribute 'file_open'

2017-08-29 Thread Jitun John
Hi Massimo,

I have the 2.15.3 version installed, but the issue remains.
I confirm the same code works on 2.14.6











On Sunday, August 13, 2017 at 2:40:08 AM UTC+5:30, Massimo Di Pierro wrote:
>
> Committed c995fd7 that should fix this
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: AttributeError: 'SQLite' object has no attribute 'file_open'

2017-08-12 Thread Massimo Di Pierro
Committed c995fd7 that should fix this

On Tuesday, 8 August 2017 14:40:34 UTC-5, Lisandro wrote:
>
> Same problem here, but using PostgreSQL.
> This is the function that I was using to connect to a database:
>
> def connect_db(db_host, db_name, db_user, db_user_password):
> # gets the table_hash from one of the .table files in the databases 
> folder
> table_hash = None
> for file in os.listdir(databases_folder):
> if archivo.endswith('.table'):
> table_hash = file.split('_')[0]
> break
> return DAL('postgres://%s:%s@%s:5432/%s' % (db_user, db_user_password, 
> db_host, db_name),
>migrate=False,
>folder=databases_folder,
>auto_import=True,
>table_hash=table_hash)
>
>
> But after upgrading to 2.15.3, the function throws this error:
>
> Traceback (most recent call last):
>   File "/home/gonguinguen/medios/gluon/restricted.py", line 219, in restricted
> exec(ccode, environment)
>   File 
> "/home/gonguinguen/medios/applications/webmedios/controllers/admin.py", line 
> 550, in 
>   File "/home/gonguinguen/medios/gluon/globals.py", line 409, in 
> self._caller = lambda f: f()
>   File 
> "/home/gonguinguen/medios/applications/webmedios/controllers/admin.py", line 
> 548, in prueba
> dbs = sitio.conectar_db()
>   File "/home/gonguinguen/medios/gluon/packages/dal/pydal/objects.py", line 
> 2368, in __call__
> return self.method(self.row, *args, **kwargs)
>   File "/home/gonguinguen/medios/applications/webmedios/models/db.py", line 
> 149, in 
> Field.Method('conectar_db', lambda row: sitios_conectar_db(row.sitios)),
>   File "applications/webmedios/modules/virtual_methods.py", line 79, in 
> sitios_conectar_db
> table_hash=table_hash)
>   File "/home/gonguinguen/medios/gluon/packages/dal/pydal/base.py", line 170, 
> in __call__
> obj = super(MetaDAL, cls).__call__(*args, **kwargs)
>   File "/home/gonguinguen/medios/gluon/packages/dal/pydal/base.py", line 500, 
> in __init__
> tables=tables)
>   File "/home/gonguinguen/medios/gluon/packages/dal/pydal/base.py", line 522, 
> in import_table_definitions
> tfile = self._adapter.file_open(filename, 'r')
> AttributeError: 'PostgrePsyco' object has no attribute 'file_open'
>
>
>
> Meanwhile, I'll check if there is an opened issue about this.
> Let me know if there is anything I can do to help you fix the problem.
>
>
> El jueves, 20 de julio de 2017, 18:56:29 (UTC-3), Massimo Di Pierro 
> escribió:
>>
>> Can you please open a PyDAL ticket so we can track. This should work.
>>
>> On Saturday, 15 July 2017 05:13:45 UTC-5, Jitun John wrote:
>>>
>>> Here is a Code that worked fine on 2.14.6 but doesn't on 2.15.1
>>>
>>>
>>> import datetime
>>> import gc
>>> import os
>>> from gluon import *
>>> from current_config import *
>>> from memory_profiler import memory_usage
>>>
>>>
>>> manager_rows = ''
>>>
>>>
>>> dummy_path = os.path.abspath('.') + 
>>> '/applications/enLIGHTen/static/dummy/'
>>>
>>>
>>> def read_alerts_rows():
>>> alerts_db_conn = DAL('sqlite://alerts.sqlite', folder=
>>> get_current_path(), auto_import=True)
>>> global alerts_rows
>>> alerts_rows = alerts_db_conn(alerts_db_conn.alerts_log.id > 0).
>>> select(orderby=alerts_db_conn.alerts_log.datetime)
>>> alerts_db_conn.close()
>>>
>>>
>>> def get_alerts_rows():
>>> return alerts_rows
>>>
>>>
>>> 
>>>
>>>
>>> def add_clear():
>>> dummy_alerts_db_conn = DAL('sqlite://alerts.sqlite', folder=
>>> dummy_path, auto_import=True)
>>> global alerts_rows
>>>
>>>
>>> 
>>>
>>>
>>> Gives the following error.
>>>
>>> File "applications\enLIGHTen\modules\read_logs_to_rows.py", line 141, in 
>>> add_clear
>>>  dummy_alerts_db_conn = DAL('sqlite://alerts.sqlite', folder=dummy_path, 
>>> auto_import=True)
>>>  File 
>>> "E:\Jitun_Backup\Web2py\web2py_win_2.15.1\gluon\packages\dal\pydal\base.py",
>>>  line 170, in __call__
>>>  obj = super(MetaDAL, cls).__call__(*args, **kwargs)
>>>  File 
>>> "E:\Jitun_Backup\Web2py\web2py_win_2.15.1\gluon\packages\dal\pydal\base.py",
>>>  line 500, in __init__
>>>  tables=tables)
>>>  File 
>>> "E:\Jitun_Backup\Web2py\web2py_win_2.15.1\gluon\packages\dal\pydal\base.py",
>>>  line 522, in import_table_definitions
>>>  tfile = self._adapter.file_open(filename, 'r')
>>> AttributeError: 'SQLite' object has no attribute 'file_open'
>>>
>>> Any pointers/help is appreciated.
>>>
>>>
>>>
>>>
>>>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: AttributeError: 'SQLite' object has no attribute 'file_open'

2017-08-08 Thread Lisandro
Same problem here, but using PostgreSQL.
This is the function that I was using to connect to a database:

def connect_db(db_host, db_name, db_user, db_user_password):
# gets the table_hash from one of the .table files in the databases 
folder
table_hash = None
for file in os.listdir(databases_folder):
if archivo.endswith('.table'):
table_hash = file.split('_')[0]
break
return DAL('postgres://%s:%s@%s:5432/%s' % (db_user, db_user_password, 
db_host, db_name),
   migrate=False,
   folder=databases_folder,
   auto_import=True,
   table_hash=table_hash)


But after upgrading to 2.15.3, the function throws this error:

Traceback (most recent call last):
  File "/home/gonguinguen/medios/gluon/restricted.py", line 219, in restricted
exec(ccode, environment)
  File "/home/gonguinguen/medios/applications/webmedios/controllers/admin.py", 
line 550, in 
  File "/home/gonguinguen/medios/gluon/globals.py", line 409, in 
self._caller = lambda f: f()
  File "/home/gonguinguen/medios/applications/webmedios/controllers/admin.py", 
line 548, in prueba
dbs = sitio.conectar_db()
  File "/home/gonguinguen/medios/gluon/packages/dal/pydal/objects.py", line 
2368, in __call__
return self.method(self.row, *args, **kwargs)
  File "/home/gonguinguen/medios/applications/webmedios/models/db.py", line 
149, in 
Field.Method('conectar_db', lambda row: sitios_conectar_db(row.sitios)),
  File "applications/webmedios/modules/virtual_methods.py", line 79, in 
sitios_conectar_db
table_hash=table_hash)
  File "/home/gonguinguen/medios/gluon/packages/dal/pydal/base.py", line 170, 
in __call__
obj = super(MetaDAL, cls).__call__(*args, **kwargs)
  File "/home/gonguinguen/medios/gluon/packages/dal/pydal/base.py", line 500, 
in __init__
tables=tables)
  File "/home/gonguinguen/medios/gluon/packages/dal/pydal/base.py", line 522, 
in import_table_definitions
tfile = self._adapter.file_open(filename, 'r')
AttributeError: 'PostgrePsyco' object has no attribute 'file_open'



Meanwhile, I'll check if there is an opened issue about this.
Let me know if there is anything I can do to help you fix the problem.


El jueves, 20 de julio de 2017, 18:56:29 (UTC-3), Massimo Di Pierro 
escribió:
>
> Can you please open a PyDAL ticket so we can track. This should work.
>
> On Saturday, 15 July 2017 05:13:45 UTC-5, Jitun John wrote:
>>
>> Here is a Code that worked fine on 2.14.6 but doesn't on 2.15.1
>>
>>
>> import datetime
>> import gc
>> import os
>> from gluon import *
>> from current_config import *
>> from memory_profiler import memory_usage
>>
>>
>> manager_rows = ''
>>
>>
>> dummy_path = os.path.abspath('.') + 
>> '/applications/enLIGHTen/static/dummy/'
>>
>>
>> def read_alerts_rows():
>> alerts_db_conn = DAL('sqlite://alerts.sqlite', folder=
>> get_current_path(), auto_import=True)
>> global alerts_rows
>> alerts_rows = alerts_db_conn(alerts_db_conn.alerts_log.id > 0).select
>> (orderby=alerts_db_conn.alerts_log.datetime)
>> alerts_db_conn.close()
>>
>>
>> def get_alerts_rows():
>> return alerts_rows
>>
>>
>> 
>>
>>
>> def add_clear():
>> dummy_alerts_db_conn = DAL('sqlite://alerts.sqlite', folder=
>> dummy_path, auto_import=True)
>> global alerts_rows
>>
>>
>> 
>>
>>
>> Gives the following error.
>>
>> File "applications\enLIGHTen\modules\read_logs_to_rows.py", line 141, in 
>> add_clear
>>  dummy_alerts_db_conn = DAL('sqlite://alerts.sqlite', folder=dummy_path, 
>> auto_import=True)
>>  File 
>> "E:\Jitun_Backup\Web2py\web2py_win_2.15.1\gluon\packages\dal\pydal\base.py", 
>> line 170, in __call__
>>  obj = super(MetaDAL, cls).__call__(*args, **kwargs)
>>  File 
>> "E:\Jitun_Backup\Web2py\web2py_win_2.15.1\gluon\packages\dal\pydal\base.py", 
>> line 500, in __init__
>>  tables=tables)
>>  File 
>> "E:\Jitun_Backup\Web2py\web2py_win_2.15.1\gluon\packages\dal\pydal\base.py", 
>> line 522, in import_table_definitions
>>  tfile = self._adapter.file_open(filename, 'r')
>> AttributeError: 'SQLite' object has no attribute 'file_open'
>>
>> Any pointers/help is appreciated.
>>
>>
>>
>>
>>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: AttributeError: 'SQLite' object has no attribute 'file_open'

2017-08-04 Thread Sarbjit
Any workaround? I am kind of stuck in populating the test database

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: AttributeError: 'SQLite' object has no attribute 'file_open'

2017-07-20 Thread Massimo Di Pierro
Can you please open a PyDAL ticket so we can track. This should work.

On Saturday, 15 July 2017 05:13:45 UTC-5, Jitun John wrote:
>
> Here is a Code that worked fine on 2.14.6 but doesn't on 2.15.1
>
>
> import datetime
> import gc
> import os
> from gluon import *
> from current_config import *
> from memory_profiler import memory_usage
>
>
> manager_rows = ''
>
>
> dummy_path = os.path.abspath('.') + 
> '/applications/enLIGHTen/static/dummy/'
>
>
> def read_alerts_rows():
> alerts_db_conn = DAL('sqlite://alerts.sqlite', folder=get_current_path
> (), auto_import=True)
> global alerts_rows
> alerts_rows = alerts_db_conn(alerts_db_conn.alerts_log.id > 0).select(
> orderby=alerts_db_conn.alerts_log.datetime)
> alerts_db_conn.close()
>
>
> def get_alerts_rows():
> return alerts_rows
>
>
> 
>
>
> def add_clear():
> dummy_alerts_db_conn = DAL('sqlite://alerts.sqlite', folder=dummy_path
> , auto_import=True)
> global alerts_rows
>
>
> 
>
>
> Gives the following error.
>
> File "applications\enLIGHTen\modules\read_logs_to_rows.py", line 141, in 
> add_clear
>  dummy_alerts_db_conn = DAL('sqlite://alerts.sqlite', folder=dummy_path, 
> auto_import=True)
>  File 
> "E:\Jitun_Backup\Web2py\web2py_win_2.15.1\gluon\packages\dal\pydal\base.py", 
> line 170, in __call__
>  obj = super(MetaDAL, cls).__call__(*args, **kwargs)
>  File 
> "E:\Jitun_Backup\Web2py\web2py_win_2.15.1\gluon\packages\dal\pydal\base.py", 
> line 500, in __init__
>  tables=tables)
>  File 
> "E:\Jitun_Backup\Web2py\web2py_win_2.15.1\gluon\packages\dal\pydal\base.py", 
> line 522, in import_table_definitions
>  tfile = self._adapter.file_open(filename, 'r')
> AttributeError: 'SQLite' object has no attribute 'file_open'
>
> Any pointers/help is appreciated.
>
>
>
>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.