Re: [web2py] Re: request.requires_https() Python 3 bug

2019-03-15 Thread Lovedie JC
You could backup the web2py folder, the try the new web2py 2.18.4 then
revert in case it doesn't work.
Life is about taking risks.
Regards

On Sat, 16 Mar 2019, 01:08 Yi Liu  wrote:

> Thanks for replying. Sorry, Massimo, I am reluctant to upgrade on my
> server. I experience a major bug on my local web2py with 2.18 series, re: 
> Logger
> message 
> error.
>
> I have decided to stay with 2.17.2 for now, on both local and server.
>
> On Thursday, March 14, 2019 at 8:51:04 PM UTC-7, Massimo Di Pierro wrote:
>>
>> can you please try 2.18.4?
>>
>> On Monday, 11 March 2019 18:16:25 UTC-7, Yi Liu wrote:
>>>
>>> I think this is a python 3 bug:
>>>
>>> I have
>>>
>>> request.requires_https()
>>>
>>> in a model file 1_server.py
>>>
>>> Then after I switch to Py3 recently, I start to collect these errors:
>>>
>>> Ticket ID
>>>
>>> 221.2.44.75.2019-03-10.23-16-34.b272289e-a41d-4c91-a730-2346995d4bdb
>>>
>>>  write() argument must be str, not bytes
>>> Version
>>> web2py™ Version 2.17.2-stable+timestamp.2018.10.06.18.54.02
>>> Python Python 3.7.1: /usr/local/pyenv/versions/miniconda3-latest/bin/uwsgi
>>> (prefix: /usr/local/pyenv/versions/miniconda3-latest)
>>>
>>> Traceback
>>>
>>> 1.
>>> 2.
>>> 3.
>>> 4.
>>> 5.
>>> 6.
>>> 7.
>>> 8.
>>> 9.
>>> 10.
>>> 11.
>>> 12.
>>> 13.
>>> 14.
>>> 15.
>>> 16.
>>> 17.
>>> 18.
>>> 19.
>>> 20.
>>> 21.
>>> 22.
>>>
>>> Traceback (most recent call last):
>>>   File "/home/www-data/web2py/gluon/restricted.py", line 219, in restricted
>>> exec(ccode, environment)
>>>   File 
>>> "/home/www-data/web2py/applications/trialert/compiled/models.1_server.py", 
>>> line 2, in 
>>>   File "/home/www-data/web2py/gluon/globals.py", line 366, in requires_https
>>> redirect(URL(scheme='https', args=self.args, vars=self.vars))
>>>   File "/home/www-data/web2py/gluon/globals.py", line 316, in vars
>>> self.parse_all_vars()
>>>   File "/home/www-data/web2py/gluon/globals.py", line 287, in parse_all_vars
>>> for key, value in iteritems(self.post_vars):
>>>   File "/home/www-data/web2py/gluon/globals.py", line 308, in post_vars
>>> self.parse_post_vars()
>>>   File "/home/www-data/web2py/gluon/globals.py", line 244, in 
>>> parse_post_vars
>>> dpost = cgi.FieldStorage(fp=body, environ=env, keep_blank_values=1)
>>>   File "/usr/local/pyenv/versions/miniconda3-latest/lib/python3.7/cgi.py", 
>>> line 486, in __init__
>>> self.read_single()
>>>   File "/usr/local/pyenv/versions/miniconda3-latest/lib/python3.7/cgi.py", 
>>> line 665, in read_single
>>> self.read_binary()
>>>   File "/usr/local/pyenv/versions/miniconda3-latest/lib/python3.7/cgi.py", 
>>> line 687, in read_binary
>>> self.file.write(data)
>>> TypeError: write() argument must be str, not bytes
>>>
>>>
>>> TypeError(write() argument must be str, not bytes)
>>>
>>>
>>>
>>> --
> 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.
>

-- 
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: Web2py install script python 3/Apache/Ubuntu

2019-03-15 Thread 黄祥
might we know which script that you used ?

check script is with python2
https://github.com/web2py/web2py/blob/master/scripts/setup-web2py-nginx-uwsgi-ubuntu.sh

check script is with python3
https://github.com/web2py/web2py/blob/master/scripts/setup-web2py-ubuntu.sh

best regards,
stifan

-- 
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] Web2py install script python 3/Apache/Ubuntu

2019-03-15 Thread Mamisoa Andriantafika
Hi,

I can't seem to find how to modify the one-step installation script so that 
web2py uses python 3.
I tried pip3 venv on wen2py directory without success. It still shows 
(Running on Apache/2.4.29 (Ubuntu), Python 2.7.15rc1. 

Server is a fresh ubuntu server 18.04.

any ideas?



-- 
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: request.requires_https() Python 3 bug

2019-03-15 Thread Yi Liu
Thanks for replying. Sorry, Massimo, I am reluctant to upgrade on my 
server. I experience a major bug on my local web2py with 2.18 series, re: 
Logger 
message  error.

I have decided to stay with 2.17.2 for now, on both local and server.

On Thursday, March 14, 2019 at 8:51:04 PM UTC-7, Massimo Di Pierro wrote:
>
> can you please try 2.18.4?
>
> On Monday, 11 March 2019 18:16:25 UTC-7, Yi Liu wrote:
>>
>> I think this is a python 3 bug:
>>
>> I have 
>>
>> request.requires_https()
>>
>> in a model file 1_server.py
>>
>> Then after I switch to Py3 recently, I start to collect these errors:
>>
>> Ticket ID
>>
>> 221.2.44.75.2019-03-10.23-16-34.b272289e-a41d-4c91-a730-2346995d4bdb
>>
>>  write() argument must be str, not bytes
>> Version  
>> web2py™ Version 2.17.2-stable+timestamp.2018.10.06.18.54.02
>> Python Python 3.7.1: /usr/local/pyenv/versions/miniconda3-latest/bin/uwsgi 
>> (prefix: /usr/local/pyenv/versions/miniconda3-latest)
>>
>> Traceback
>>
>> 1.
>> 2.
>> 3.
>> 4.
>> 5.
>> 6.
>> 7.
>> 8.
>> 9.
>> 10.
>> 11.
>> 12.
>> 13.
>> 14.
>> 15.
>> 16.
>> 17.
>> 18.
>> 19.
>> 20.
>> 21.
>> 22.
>>
>> Traceback (most recent call last):
>>   File "/home/www-data/web2py/gluon/restricted.py", line 219, in restricted
>> exec(ccode, environment)
>>   File 
>> "/home/www-data/web2py/applications/trialert/compiled/models.1_server.py", 
>> line 2, in 
>>   File "/home/www-data/web2py/gluon/globals.py", line 366, in requires_https
>> redirect(URL(scheme='https', args=self.args, vars=self.vars))
>>   File "/home/www-data/web2py/gluon/globals.py", line 316, in vars
>> self.parse_all_vars()
>>   File "/home/www-data/web2py/gluon/globals.py", line 287, in parse_all_vars
>> for key, value in iteritems(self.post_vars):
>>   File "/home/www-data/web2py/gluon/globals.py", line 308, in post_vars
>> self.parse_post_vars()
>>   File "/home/www-data/web2py/gluon/globals.py", line 244, in parse_post_vars
>> dpost = cgi.FieldStorage(fp=body, environ=env, keep_blank_values=1)
>>   File "/usr/local/pyenv/versions/miniconda3-latest/lib/python3.7/cgi.py", 
>> line 486, in __init__
>> self.read_single()
>>   File "/usr/local/pyenv/versions/miniconda3-latest/lib/python3.7/cgi.py", 
>> line 665, in read_single
>> self.read_binary()
>>   File "/usr/local/pyenv/versions/miniconda3-latest/lib/python3.7/cgi.py", 
>> line 687, in read_binary
>> self.file.write(data)
>> TypeError: write() argument must be str, not bytes
>>
>>
>> TypeError(write() argument must be str, not bytes)
>>   
>>
>>
>>

-- 
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] Using lambda in Field constructor for default

2019-03-15 Thread Vlad
I am missing something very simple here, but can't unstuck myself: 

This is what I want to have in the Field constructor (though it's obviously 
incorrect):

Field('link', default=lambda link, row: URL('podcast', 'episode/' + row.id, 
scheme=True, host=True))

I simply want one field to be determined by the other, in this case the 
constructed link field should depend on the id field. 

How do I accomplish this correctly? 

-- 
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.


Re: [web2py] error 'module' object has no attribute 'pbkdf2_hmac' when trying to add user (Ver 2.18.4)

2019-03-15 Thread Stephan
I can't access appadmin under python 3:
 'ascii' codec can't decode byte 0xea in 
position 1: ordinal not in range(128)
web2py™ Version 2.18.4-stable+timestamp.2019.03.13.05.27.54
Python Python 3.5.2: /usr/local/bin/uwsgi (prefix: /usr)Traceback

1.
2.
3.
4.
5.
6.
7.
8.
9.
10.

Traceback (most recent call last):
  File "/home/rexwuff/web2py/gluon/restricted.py", line 219, in restricted
exec(ccode, environment)
  File "/home/rexwuff/web2py/applications/admin/controllers/default.py" 
, 
line 2012, in 
  File "/home/rexwuff/web2py/gluon/globals.py", line 421, in 
self._caller = lambda f: f()
  File "/home/rexwuff/web2py/applications/admin/controllers/default.py" 
, 
line 1618, in errors
error = pickle.load(fullpath_file)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xea in position 1: ordinal 
not in range(128)

Error snapshot [image: help] 


UnicodeDecodeError('ascii' codec can't decode byte 0xea in position 1: 
ordinal not in range(128))


Code listing

1613.
1614.
1615.
1616.
1617.
1618.
1619.
1620.
1621.
1622.

if not os.path.isfile(fullpath):
continue
try:
fullpath_file = safe_open(fullpath, 'rb')
try:
error = pickle.load(fullpath_file)
finally:
fullpath_file.close()
except IOError:
continue

Am Freitag, 15. März 2019 18:06:13 UTC+1 schrieb Kevin Keller:
>
> Can you also test it with python3 please? 
>
> On Fri, Mar 15, 2019 at 5:11 PM Stephan > 
> wrote:
>
>> Hello there,
>>
>>
>> when trying to add a user in the empty user table via appadmin, I get 
>> this error: *'module' object has no attribute 'pbkdf2_hmac'*
>> Seems to be related to password encryption?
>>
>>
>> Function argument list
>>
>> (data='!xb2qwtze', salt='b2dfc4f426ee1bbd', iterations=1000, keylen=20, 
>> hashfunc=)
>> Code listing
>>
>> 2781.
>> 2782.
>> 2783.
>> 2784.
>> 2785.
>> 2786.
>> 2787.
>> 2788.
>> 2789.
>> 2790.
>>
>> return v
>>
>>
>> def pbkdf2_hex(data, salt, iterations=1000, keylen=24, hashfunc=None):
>> hashfunc = hashfunc or sha1
>> hmac = hashlib.pbkdf2_hmac(hashfunc().name, to_bytes(data),
>>to_bytes(salt), iterations, keylen)
>> return binascii.hexlify(hmac)
>>
>> Variables
>> global hmac 
>> salt 'b2dfc4f426ee1bbd'
>> data '!xb2qwtze'
>> hashlib.pbkdf2_hmac undefined
>> ).name undefined
>> global hashlib 
>> iterations 1000
>> global to_bytes 
>> hashfunc 
>> keylen 20
>>
>>
>>
>>  'module' object has no attribute 
>> 'pbkdf2_hmac'Version
>> web2py™ Version 2.18.4-stable+timestamp.2019.03.13.05.27.54
>> Python Python 2.7.6: /usr/local/bin/uwsgi (prefix: /usr)Traceback
>>
>> 1.
>> 2.
>> 3.
>> 4.
>> 5.
>> 6.
>> 7.
>> 8.
>> 9.
>> 10.
>> 11.
>> 12.
>> 13.
>> 14.
>> 15.
>> 16.
>> 17.
>> 18.
>> 19.
>> 20.
>> 21.
>> 22.
>> 23.
>> 24.
>> 25.
>> 26.
>> 27.
>> 28.
>> 29.
>> 30.
>> 31.
>> 32.
>> 33.
>> 34.
>> 35.
>> 36.
>> 37.
>> 38.
>>
>> Traceback (most recent call last):
>>   File "/home/rexwuff/web2py/gluon/restricted.py", line 219, in restricted
>> exec(ccode, environment)
>>   File "/home/rexwuff/web2py/applications/babsi/controllers/appadmin.py" 
>> ,
>>  line 674, in 
>>   File "/home/rexwuff/web2py/gluon/globals.py", line 421, in 
>> self._caller = lambda f: f()
>>   File "/home/rexwuff/web2py/applications/babsi/controllers/appadmin.py" 
>> ,
>>  line 154, in insert
>> if form.accepts(request.vars, session):
>>   File "/home/rexwuff/web2py/gluon/sqlhtml.py", line 1962, in accepts
>> self.vars.id = self.table.insert(**fields)
>>   File "/home/rexwuff/web2py/gluon/packages/dal/pydal/objects.py", line 754, 
>> in insert
>> ret = self._db._adapter.insert(self, row.op_values())
>>   File "/home/rexwuff/web2py/gluon/packages/dal/pydal/adapters/base.py", 
>> line 480, in insert
>> query = self._insert(table, fields)
>>   File "/home/rexwuff/web2py/gluon/packages/dal/pydal/adapters/base.py", 
>> line 476, in _insert
>> ','.join(self.expand(v, f.type) for f, v in fields))
>>   File "/home/rexwuff/web2py/gluon/packages/dal/pydal/adapters/base.py", 
>> line 476, in 
>> ','.join(self.expand(v, f.type) for f, v in fields))
>>   File "/home/rexwuff/web2py/gluon/packages/dal/pydal/adapters/base.py", 
>> line 445, in _expand
>> rv = self.represent(expression, field_type)
>>   File "/home/rexwuff/web2py/gluon/packages/dal/pydal/adapters/base.py", 
>> line 382, in represent
>> return super(SQLAdapter, self).represent(obj, field_type)
>>   

Re: [web2py] error 'module' object has no attribute 'pbkdf2_hmac' when trying to add user (Ver 2.18.4)

2019-03-15 Thread Kevin Keller
Can you also test it with python3 please?

On Fri, Mar 15, 2019 at 5:11 PM Stephan  wrote:

> Hello there,
>
>
> when trying to add a user in the empty user table via appadmin, I get this
> error: *'module' object has no attribute 'pbkdf2_hmac'*
> Seems to be related to password encryption?
>
>
> Function argument list
>
> (data='!xb2qwtze', salt='b2dfc4f426ee1bbd', iterations=1000, keylen=20,
> hashfunc=)
> Code listing
>
> 2781.
> 2782.
> 2783.
> 2784.
> 2785.
> 2786.
> 2787.
> 2788.
> 2789.
> 2790.
>
> return v
>
>
> def pbkdf2_hex(data, salt, iterations=1000, keylen=24, hashfunc=None):
> hashfunc = hashfunc or sha1
> hmac = hashlib.pbkdf2_hmac(hashfunc().name, to_bytes(data),
>to_bytes(salt), iterations, keylen)
> return binascii.hexlify(hmac)
>
> Variables
> global hmac 
> salt 'b2dfc4f426ee1bbd'
> data '!xb2qwtze'
> hashlib.pbkdf2_hmac undefined
> ).name undefined
> global hashlib 
> iterations 1000
> global to_bytes 
> hashfunc 
> keylen 20
>
>
>
>  'module' object has no attribute
> 'pbkdf2_hmac'Version
> web2py™ Version 2.18.4-stable+timestamp.2019.03.13.05.27.54
> Python Python 2.7.6: /usr/local/bin/uwsgi (prefix: /usr)Traceback
>
> 1.
> 2.
> 3.
> 4.
> 5.
> 6.
> 7.
> 8.
> 9.
> 10.
> 11.
> 12.
> 13.
> 14.
> 15.
> 16.
> 17.
> 18.
> 19.
> 20.
> 21.
> 22.
> 23.
> 24.
> 25.
> 26.
> 27.
> 28.
> 29.
> 30.
> 31.
> 32.
> 33.
> 34.
> 35.
> 36.
> 37.
> 38.
>
> Traceback (most recent call last):
>   File "/home/rexwuff/web2py/gluon/restricted.py", line 219, in restricted
> exec(ccode, environment)
>   File "/home/rexwuff/web2py/applications/babsi/controllers/appadmin.py" 
> ,
>  line 674, in 
>   File "/home/rexwuff/web2py/gluon/globals.py", line 421, in 
> self._caller = lambda f: f()
>   File "/home/rexwuff/web2py/applications/babsi/controllers/appadmin.py" 
> ,
>  line 154, in insert
> if form.accepts(request.vars, session):
>   File "/home/rexwuff/web2py/gluon/sqlhtml.py", line 1962, in accepts
> self.vars.id = self.table.insert(**fields)
>   File "/home/rexwuff/web2py/gluon/packages/dal/pydal/objects.py", line 754, 
> in insert
> ret = self._db._adapter.insert(self, row.op_values())
>   File "/home/rexwuff/web2py/gluon/packages/dal/pydal/adapters/base.py", line 
> 480, in insert
> query = self._insert(table, fields)
>   File "/home/rexwuff/web2py/gluon/packages/dal/pydal/adapters/base.py", line 
> 476, in _insert
> ','.join(self.expand(v, f.type) for f, v in fields))
>   File "/home/rexwuff/web2py/gluon/packages/dal/pydal/adapters/base.py", line 
> 476, in 
> ','.join(self.expand(v, f.type) for f, v in fields))
>   File "/home/rexwuff/web2py/gluon/packages/dal/pydal/adapters/base.py", line 
> 445, in _expand
> rv = self.represent(expression, field_type)
>   File "/home/rexwuff/web2py/gluon/packages/dal/pydal/adapters/base.py", line 
> 382, in represent
> return super(SQLAdapter, self).represent(obj, field_type)
>   File "/home/rexwuff/web2py/gluon/packages/dal/pydal/adapters/base.py", line 
> 336, in represent
> return self.representer.represent(obj, field_type)
>   File 
> "/home/rexwuff/web2py/gluon/packages/dal/pydal/representers/__init__.py", 
> line 251, in represent
> rv = self.get_representer_for_type(field_type)(rv, field_type)
>   File 
> "/home/rexwuff/web2py/gluon/packages/dal/pydal/representers/__init__.py", 
> line 209, in _default
> return self.adapt(value)
>   File 
> "/home/rexwuff/web2py/gluon/packages/dal/pydal/representers/__init__.py", 
> line 227, in adapt
> value = str(value)
>   File "/home/rexwuff/web2py/gluon/packages/dal/pydal/validators.py", line 
> 2880, in __str__
> hashed = simple_hash(self.password, key, salt, digest_alg)
>   File "/home/rexwuff/web2py/gluon/packages/dal/pydal/validators.py", line 
> 2803, in simple_hash
> int(keylen), get_digest(alg)))
>   File "/home/rexwuff/web2py/gluon/packages/dal/pydal/validators.py", line 
> 2786, in pbkdf2_hex
> hmac = hashlib.pbkdf2_hmac(hashfunc().name, to_bytes(data),
> AttributeError: 'module' object has no attribute 'pbkdf2_hmac'
>
>
> Thanks for your help,
>
> Stephan
>
> --
> 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.
>

-- 
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 

[web2py] error 'module' object has no attribute 'pbkdf2_hmac' when trying to add user (Ver 2.18.4)

2019-03-15 Thread Stephan
Hello there,


when trying to add a user in the empty user table via appadmin, I get this 
error: *'module' object has no attribute 'pbkdf2_hmac'*
Seems to be related to password encryption?


Function argument list

(data='!xb2qwtze', salt='b2dfc4f426ee1bbd', iterations=1000, keylen=20, 
hashfunc=)
Code listing

2781.
2782.
2783.
2784.
2785.
2786.
2787.
2788.
2789.
2790.

return v


def pbkdf2_hex(data, salt, iterations=1000, keylen=24, hashfunc=None):
hashfunc = hashfunc or sha1
hmac = hashlib.pbkdf2_hmac(hashfunc().name, to_bytes(data),
   to_bytes(salt), iterations, keylen)
return binascii.hexlify(hmac)

Variables
global hmac 
salt 'b2dfc4f426ee1bbd'
data '!xb2qwtze'
hashlib.pbkdf2_hmac undefined
).name undefined
global hashlib 
iterations 1000
global to_bytes 
hashfunc 
keylen 20



 'module' object has no attribute 
'pbkdf2_hmac'Version
web2py™ Version 2.18.4-stable+timestamp.2019.03.13.05.27.54
Python Python 2.7.6: /usr/local/bin/uwsgi (prefix: /usr)Traceback

1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
32.
33.
34.
35.
36.
37.
38.

Traceback (most recent call last):
  File "/home/rexwuff/web2py/gluon/restricted.py", line 219, in restricted
exec(ccode, environment)
  File "/home/rexwuff/web2py/applications/babsi/controllers/appadmin.py" 
, 
line 674, in 
  File "/home/rexwuff/web2py/gluon/globals.py", line 421, in 
self._caller = lambda f: f()
  File "/home/rexwuff/web2py/applications/babsi/controllers/appadmin.py" 
, 
line 154, in insert
if form.accepts(request.vars, session):
  File "/home/rexwuff/web2py/gluon/sqlhtml.py", line 1962, in accepts
self.vars.id = self.table.insert(**fields)
  File "/home/rexwuff/web2py/gluon/packages/dal/pydal/objects.py", line 754, in 
insert
ret = self._db._adapter.insert(self, row.op_values())
  File "/home/rexwuff/web2py/gluon/packages/dal/pydal/adapters/base.py", line 
480, in insert
query = self._insert(table, fields)
  File "/home/rexwuff/web2py/gluon/packages/dal/pydal/adapters/base.py", line 
476, in _insert
','.join(self.expand(v, f.type) for f, v in fields))
  File "/home/rexwuff/web2py/gluon/packages/dal/pydal/adapters/base.py", line 
476, in 
','.join(self.expand(v, f.type) for f, v in fields))
  File "/home/rexwuff/web2py/gluon/packages/dal/pydal/adapters/base.py", line 
445, in _expand
rv = self.represent(expression, field_type)
  File "/home/rexwuff/web2py/gluon/packages/dal/pydal/adapters/base.py", line 
382, in represent
return super(SQLAdapter, self).represent(obj, field_type)
  File "/home/rexwuff/web2py/gluon/packages/dal/pydal/adapters/base.py", line 
336, in represent
return self.representer.represent(obj, field_type)
  File 
"/home/rexwuff/web2py/gluon/packages/dal/pydal/representers/__init__.py", line 
251, in represent
rv = self.get_representer_for_type(field_type)(rv, field_type)
  File 
"/home/rexwuff/web2py/gluon/packages/dal/pydal/representers/__init__.py", line 
209, in _default
return self.adapt(value)
  File 
"/home/rexwuff/web2py/gluon/packages/dal/pydal/representers/__init__.py", line 
227, in adapt
value = str(value)
  File "/home/rexwuff/web2py/gluon/packages/dal/pydal/validators.py", line 
2880, in __str__
hashed = simple_hash(self.password, key, salt, digest_alg)
  File "/home/rexwuff/web2py/gluon/packages/dal/pydal/validators.py", line 
2803, in simple_hash
int(keylen), get_digest(alg)))
  File "/home/rexwuff/web2py/gluon/packages/dal/pydal/validators.py", line 
2786, in pbkdf2_hex
hmac = hashlib.pbkdf2_hmac(hashfunc().name, to_bytes(data),
AttributeError: 'module' object has no attribute 'pbkdf2_hmac'


Thanks for your help,

Stephan

-- 
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.


Re: [web2py] Re: Web2py binaries

2019-03-15 Thread Nico Zanferrari
Hi all,

I've was successful in making the experimental Mac app, too, with python3.
Grab it from https://github.com/nicozanf/web2py-pyinstaller  , where there
are also all the instructions in order to build it by yourself ;-)

A private feedback is appreciated.

Nico

Il giorno ven 15 mar 2019 alle ore 04:56 Massimo Di Pierro <
massimo.dipie...@gmail.com> ha scritto:

> The official version is currently broken.
>
> On Wednesday, 13 March 2019 15:53:09 UTC-7, Nico Zanferrari wrote:
>>
>> Hi,
>>
>> I've just updated the experimental Windows binary version with python
>> 3.7.2 to web2py 2.18.4 . Also, now there is in addition the no_console
>> binary and there is the python-ldap module included. Grab it from
>> https://github.com/nicozanf/web2py-pyinstaller : please test it and give
>> me a feedback.
>>
>> I'm still playing with the Mac version. Could someone confirm that the
>> current official binary version is really working? After typing the
>> password I've got the error 'module object has no attribute pbkdf2 hmac' -
>> maybe for the python version included. According to this
>> 
>>  it
>> should have at least 2.7.8 but it seems with 2.7.3.
>>
>> Cheers,
>> Nico
>>
> --
> 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.
>

-- 
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: Geometry fields and validators

2019-03-15 Thread Leonel Câmara
I think that's perfectly fine, I would just make a validator to wrap it so 
you can use it more easily.

-- 
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: Geometry fields and validators

2019-03-15 Thread David Orme
Thanks Leonel,

I'd actually seen that solution, but that is specifically validating that 
the coordinates of a Point(X Y) WKT string are in the domain of a 
geographic coordinate system. I'm interested in the more general assessment 
of whether an alleged WKT string is well formatted - could be any of the 
geometry types.

My solution doesn't actually work without importing the Exception - and 
those are specific to backends. This fixes it, but is this the best way to 
catch the error in a general way?


if geometry is not None:
try:
geo_wkb = db.executesql("select 
st_geomfromtext('{}');".format(geometry))
except db._adapter.driver.ProgrammingError:
raise HTTP(404, "Invalid WKT Geometry")

Cheers,
David



On Friday, 15 March 2019 13:21:43 UTC, David Orme wrote:
>
>
> Hi,
>
> I'm looking for an approach to validate a user provided WKT geometry. The 
> obvious answer is to let the spatial backend do the validation, so this 
> works:
>
> if geometry is not None:
> try:
> geometry = db.executesql("select 
> st_geomfromtext('{}');".format(geometry))
> except ProgrammingError:
> raise HTTP(404, "Invalid WKT Geometry")
>
> I suspect that is probably pretty robust across backends but am I missing 
> something more general?
>
> Cheers,
> David
>
>
>

-- 
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: Geometry fields and validators

2019-03-15 Thread Leonel Câmara
This is the validator I use for my geometry fields

import re
from pydal.validators import Validator, ValidationError

class IS_GEOLOCATION(Validator):
""" 
Validate that the input is a location within latitude and longitude
constraints.
"""
regex_geopoint = re.compile(r"""POINT *\((?P-?[\d\.]+) 
(?P-?[\d\.]+)\)""")

def __init__(self, minlat=-90, maxlat=90, 
   minlng=-180, maxlng=180,
error_message='Invalid coordinates'):
self.minlat = minlat
self.maxlat = maxlat
self.minlng = minlng
self.maxlng = maxlng
self.error_message = error_message

@staticmethod
def parse_geopoint(value):
""" Returns a tuple (lat, lng) from a POINT (lat lng) """
match = IS_GEOLOCATION.regex_geopoint.search(value)
return float(match.group('lat')), float(match.group('lng'))

def __call__(self, value):
try:
lat, lng = self.parse_geopoint(value)
if (self.minlat <= lat <= self.maxlat) and (self.minlng <= lng 
<= self.maxlng):
return (value, None)
else:
raise ValidationError(self.translator(self.error_message))
except:
raise ValidationError(self.translator(self.error_message))

-- 
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: Mysql-Web2py connection failure

2019-03-15 Thread learthurjoly
Hi !
Thank you very much for taking time to answer me !
I have deployed my debian with web2py again and install MariaDB. It works 
 I have no connection problem anymore !
Thanks a lot for your help.


Le mercredi 13 mars 2019 11:28:00 UTC+1, Leonel Câmara a écrit :
>
> That's a pymysql problem caused by MySQL changes. I would switch to 
> MariaDB. Alternatively update your pymysql and see if it solves your 
> problem I think they fixed it.
>
>
>

-- 
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] Geometry fields and validators

2019-03-15 Thread David Orme

Hi,

I'm looking for an approach to validate a user provided WKT geometry. The 
obvious answer is to let the spatial backend do the validation, so this 
works:

if geometry is not None:
geometry = db.executesql("select 
st_geomfromtext('{}');".format(geometry))
except ProgrammingError:
raise HTTP(404, "Invalid WKT Geometry")

I suspect that is probably pretty robust across backends but am I missing 
something more general?

Cheers,
David


-- 
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: I would like to allow the user to change the language, but I can't find why it isn't complying

2019-03-15 Thread João Matos
It worked, thanks.

sexta-feira, 15 de Março de 2019 às 12:02:38 UTC, Leonel Câmara escreveu:
>
> This is how I do it in one of my websites
>
> in model:
>
> SUPPORTED_LANGUAGES = ('en', 'pt') # or just load this from config
>
> def pick_lang():
> twoletter = session.lang or T.accepted_language[:2]
> if twoletter in SUPPORTED_LANGUAGES:
> T.force(twoletter)
> return twoletter
> else:
> T.force('en')
> return 'en'
> LANG = pick_lang()
>
>
> Then default.py
>
> def language():
> """ Switch the site language """
> if request.args(0) in SUPPORTED_LANGUAGES:
> session.lang = request.args(0)
> redirect(request.vars._next)
>
>
> In layout.html on the footer
>
> 
>}}>
> PT
>   
>}}>
> EN
>   
> 
>
>
>
>
>
>

-- 
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: I would like to allow the user to change the language, but I can't find why it isn't complying

2019-03-15 Thread Leonel Câmara
This is how I do it in one of my websites

in model:

SUPPORTED_LANGUAGES = ('en', 'pt') # or just load this from config

def pick_lang():
twoletter = session.lang or T.accepted_language[:2]
if twoletter in SUPPORTED_LANGUAGES:
T.force(twoletter)
return twoletter
else:
T.force('en')
return 'en'
LANG = pick_lang()


Then default.py

def language():
""" Switch the site language """
if request.args(0) in SUPPORTED_LANGUAGES:
session.lang = request.args(0)
redirect(request.vars._next)


In layout.html on the footer


  
PT
  
  
EN
  






-- 
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] I would like to allow the user to change the language, but I can't find why it isn't complying

2019-03-15 Thread João Matos
Hello,

I copied the code from admin\views\layout.html to 
myapp\views\default\user.html and made 2 small changes to only allow 'en' 
and 'pt' and to the path.

{{if hasattr(T,'get_possible_languages_info'):}}
  
   {{for langinfo in sorted([(code,info[1]) for code, info in 
iteritems(T.get_possible_languages_info()) if code != 'default' and code in 
['pt', 'en']]):}}
  {{=langinfo[1]}}
{{pass}}
  
{{pass}}

The page does not refresh and does not change language. The selection 
sticks.

If I change the path to /, like it is in the admin\views\layout.html, the 
page refreshes but the selection always returns to 'en' and the page is 
always in 'en'.

I tried this code (modified) in db.py from another article in the forum:

if 'adminlanguage' in request.cookies and request.cookies['adminlanguage'] 
is not None:
print('in cookie')
T.force(request.cookies['adminlanguage'].value)
else:
print('force en')
T.force('en')

but I always get 'force en' in the console.

I've tried with IE and Firefox and checked the option to allow cookies and 
even added the addresses of my machine (both http://192.168.255.1 and 
http://192.168.255.1:8000) to always allow cookies section.

Nothing worked.

Thanks,

JM

-- 
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: Is it possible to make a form field depend on another form field without submiting the form?

2019-03-15 Thread Leonel Câmara
Here's an example I made long ago, I would do things differently nowadays 
but it shows how it can be done.

https://groups.google.com/forum/#!topic/web2py/z_lGYsO6LKE 

-- 
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: Is it possible to make a form field depend on another form field without submiting the form?

2019-03-15 Thread Leonel Câmara
It's possible but you need to use ajax to change the options in the 
invoices field. Basically you need to listen for change in client_id and 
when that happens you fire an ajax call and ask web2py for the new options 
and put them in the invoices field.

-- 
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: Is it possible to make a form field depend on another form field without submiting the form?

2019-03-15 Thread João Matos
I want the values shown in field form.invoices to be loaded from a db query 
(that uses the value of form.client_id) but only after the user selects the 
form.client_id and before the form is submited.
Is this possible?

sexta-feira, 15 de Março de 2019 às 10:44:53 UTC, Leonel Câmara escreveu:
>
> Like a computed value? I don't think I'm understanding. What exactly are 
> you trying to do?
>

-- 
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: "NameError: name 'pydal' is not defined" when function has typing type in def

2019-03-15 Thread João Matos
Apparently when importing the module, pydal is not loaded, but when running 
the function it is.
Is this the correct behavior of web2py?

sexta-feira, 8 de Março de 2019 às 18:39:36 UTC, João Matos escreveu:
>
> I'm using Python 3.7.1. Can that explain this strange situation?
> I'm calling web2py with the -e command line option to see the errors and 
> there are none.
>
> sexta-feira, 8 de Março de 2019 às 18:30:48 UTC, Leonel Câmara escreveu:
>>
>> web2py doesn't do that. This is weird. Both those lines should give you 
>> errors.
>>
>

-- 
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: Is it possible to make a form field depend on another form field without submiting the form?

2019-03-15 Thread Leonel Câmara
Like a computed value? I don't think I'm understanding. What exactly are 
you trying to do?

-- 
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.


Re: [web2py] Re: Web2py online book page is returning an error

2019-03-15 Thread João Matos
Yes, now it's working.


sexta-feira, 15 de Março de 2019 às 10:24:33 UTC, Nico Zanferrari escreveu:
>
> I had the ticket even on the main page, but it worked fine some hours 
> later. Now I cannot see any problem at all.
>
> Nico
>
>
>
> Il giorno ven 15 mar 2019 alle ore 09:46 João Matos  > ha scritto:
>
>> http://web2py.com/books/default/search/29?search=signature
>>
>> sexta-feira, 15 de Março de 2019 às 03:54:07 UTC, Massimo Di Pierro 
>> escreveu:
>>>
>>> which page?
>>>
>>> On Wednesday, 13 March 2019 02:12:32 UTC-7, João Matos wrote:

 Web2py online book page is returning an error

 Internal errorTicket issued: 
 books/178.166.36.79.2019-03-13.09-10-57.75ae8466-170e-4585-92bb-608882e50879
  
 

 -- 
>> 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+un...@googlegroups.com .
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
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.


Re: [web2py] Re: Web2py online book page is returning an error

2019-03-15 Thread Nico Zanferrari
I had the ticket even on the main page, but it worked fine some hours
later. Now I cannot see any problem at all.

Nico



Il giorno ven 15 mar 2019 alle ore 09:46 João Matos  ha
scritto:

> http://web2py.com/books/default/search/29?search=signature
>
> sexta-feira, 15 de Março de 2019 às 03:54:07 UTC, Massimo Di Pierro
> escreveu:
>>
>> which page?
>>
>> On Wednesday, 13 March 2019 02:12:32 UTC-7, João Matos wrote:
>>>
>>> Web2py online book page is returning an error
>>>
>>> Internal errorTicket issued:
>>> books/178.166.36.79.2019-03-13.09-10-57.75ae8466-170e-4585-92bb-608882e50879
>>> 
>>>
>>> --
> 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.
>

-- 
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: Is it possible to make a form field depend on another form field without submiting the form?

2019-03-15 Thread João Matos
Sorry. I didn't explain myself correctly.
What I meant was depend one field values (db search) depend on another 
field value.
Something like this pseudo code:

if form client_id:
  form.invoices = db(db.invoice(client_id == form.client_id)).select()

Is this possible without submitting the form?


sexta-feira, 15 de Março de 2019 às 00:11:19 UTC, Leonel Câmara escreveu:
>
> Sort of, you can use show_if
>
>
> http://web2py.com/books/default/chapter/29/07/forms-and-validators#Conditional-fields
>

-- 
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: Web2py online book page is returning an error

2019-03-15 Thread João Matos
http://web2py.com/books/default/search/29?search=signature

sexta-feira, 15 de Março de 2019 às 03:54:07 UTC, Massimo Di Pierro 
escreveu:
>
> which page?
>
> On Wednesday, 13 March 2019 02:12:32 UTC-7, João Matos wrote:
>>
>> Web2py online book page is returning an error
>>
>> Internal errorTicket issued: 
>> books/178.166.36.79.2019-03-13.09-10-57.75ae8466-170e-4585-92bb-608882e50879 
>> 
>>
>>

-- 
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: web2py 2.18.4 is OUT

2019-03-15 Thread Константин Комков
I think I saved error in my app and after that I have error in web2py.
 invalid syntax (, line 14)Версия
web2py™ Version 2.18.4-stable+timestamp.2019.03.13.05.27.54
Python Python 2.7.10: C:\Python27\python.exe (prefix: C:\Python27)Traceback

1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.

Traceback (most recent call last):
  File ".\gluon\restricted.py", line 219, in restricted
exec(ccode, environment)
  File "C:\inetpub\wwwroot\applications\admin\controllers/default.py", line 
2012, in 
  File ".\gluon\globals.py", line 421, in 
self._caller = lambda f: f()
  File "C:\inetpub\wwwroot\applications\admin\controllers/default.py", line 
1130, in design
items = find_exposed_functions(data)
  File ".\gluon\compileapp.py", line 520, in find_exposed_functions
parsed = ast.parse(data)
  File "C:\Python27\lib\ast.py", line 37, in parse
return compile(source, filename, mode, PyCF_ONLY_AST)
  File "", line 14
import time, datetime, random, string, json
 ^
SyntaxError: invalid syntax

-- 
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.