[web2py] Re: Errors using web2py 2.18.5 , python3 and ssl

2019-06-25 Thread 黄祥
another way around if you want to stick with rocket, and want ssl, think 
you can use another web server to serve it as reverse proxy (nginx, apache, 
etc)
web2py also can be run with another server with anyserver.py, but not sure 
if it's accept the certificate parameter when execute it

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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/74880853-8555-49f8-a4db-3328e5ccba50%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] display the items in list as links in drop down menu

2019-06-25 Thread Quang Lam
 menu =  DIV(UL( LI(A(plot_list[0]py',_id ='plot_context_menu', _href = 
'')), list_string,  
_class = 'dropdown-menu', _role='menu', 
_aria='dropdownMenu', _style = _context_menu_style),
_id = 'contextMenu', _class = 'dropdown')

i try to create a drop down menu for a list of items returned in the 
database as links. list_string is concatenated string ex:  
LI(A(plot_list[0]py',_id ='plot_context_menu', _href = '')), 
LI(A(plot_list[1]py',_id ='plot_context_menu', _href = '')), 
LI(A(plot_list[2]py',_id ='plot_context_menu', _href = '')). 
the reason why i did not do  LI(A(plot_list[0]py',_id ='plot_context_menu', 
_href = '')) for the rest of items in DIV(UL()) tag because the number of 
items in list is unpredictable, so that is why i have to use for loop to 
create a concatenated string stored in list_string and put that variable in 
DIV(UL(list_string)) so that it will create links for every time in the 
drop down menu. i got the string correctly but somehow it does not make 
links, it just show the long concatenated string in drop down menu instead 
of links of items. 

Please Help 

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/f7652bf3-db92-4768-8d0b-46142b00e940%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Errors using web2py 2.18.5 , python3 and ssl

2019-06-25 Thread icodk
Appreciate your effort to help me, tahnks. I  use  Rocket as development 
server, and it served me well with python2 and web2py up to 2.17.1.
Production runs with nginx with ssl on aws. I thought  I will try to 
upgrade my app to python3 and 2.18.5 and the easyest would be Rocket. I 
will try it with http but it is not optimal for me because I have some IoT 
devices that
use https.
Wished somebody could help because it is part of the core functionality of 
web2py development (IMHO) and one of the things that make web2py 
development so easy to get up and running. 

On Tuesday, June 25, 2019 at 9:52:33 PM UTC+2, Dave S wrote:
>
>
>
> On Tuesday, June 25, 2019 at 10:04:39 AM UTC-7, icodk wrote:
>>
>> Now I tried both another Windows 10 machine and ubuntu with similar errors
>> As you can see bellow I used port 8000 on liniux because using port 443 
>> gave the following error:
>>
>> ERROR:Rocket.Errors.Port443:Socket 0.0.0.0:443 in use by other process 
>> and it won't share.
>> WARNING:Rocket.Errors.Port443:Listener started when not ready.
>>
>> However, netstat didn't revile any process using 443 and nc could listen 
>> on this port 
>> $ sudo nc -l  -p 443
>>
>>
>> and receive connections from another machine (telnet 192.168.1.223 443)
>>
>>
>>
> Well, I've used all my rounds.  I have run Rocket on port 443, but that 
> was with a 2.15.4 version on AWS Linux.   And when I renewed the 
> certificates, I got something messed up, couldn't figure it out, and so I 
> finished the move to Nginx.  I don't think Rocket has had many changes, 
> although the Python3 effort may have had to touch it some.
>
> I have not tried 443 on Windows (just 8000, 8080, 8800, ...), and I have 
> not tried the Nginx Windows port (I believe it is still marked 
> "experimental").
>
> As a relatively easy choice of alternate technology, you can do a real 
> simple Node.js server that echos your request.  Mercurial includes a 
> webserver (might not be stand-alone on Windows) and I believe it's in the 
> standard release package, just waiting to be turned on.
>
> Good luck!
>
> /dps
>
>
>> The error from the server on linux
>> $ python3 web2py.py -c cert/ca.crt -k cert/ca.key -a "password" -i 
>> 192.168.1.223 -p 8000
>> web2py Web Framework
>> Created by Massimo Di Pierro, Copyright 2007-2019
>> Version 2.18.5-stable+timestamp.2019.04.07.21.13.59
>> Database drivers available: sqlite3, imaplib, pymysql
>>
>> please visit:
>> https://192.168.1.223:8000/
>> use "kill -SIGTERM 7818" to shutdown the web2py server
>>
>>
>> Exception in thread Thread-2:
>> Traceback (most recent call last):
>>   File "/usr/lib/python3.7/threading.py", line 917, in _bootstrap_inner
>> self.run()
>>   File "/home/ico/web2py/gluon/rocket.py", line 1268, in run
>> conn = Connection(*conn)
>>   File "/home/ico/web2py/gluon/rocket.py", line 105, in __init__
>> self.socket.settimeout(SOCKET_TIMEOUT)
>> OSError: [Errno 9] Bad file descriptor
>>
>> Exception in thread Thread-3:
>> Traceback (most recent call last):
>>   File "/usr/lib/python3.7/threading.py", line 917, in _bootstrap_inner
>> self.run()
>>   File "/home/ico/web2py/gluon/rocket.py", line 1268, in run
>> conn = Connection(*conn)
>>   File "/home/ico/web2py/gluon/rocket.py", line 105, in __init__
>> self.socket.settimeout(SOCKET_TIMEOUT)
>> OSError: [Errno 9] Bad file descriptor
>>
>> Exception in thread Thread-4:
>> Traceback (most recent call last):
>>   File "/usr/lib/python3.7/threading.py", line 917, in _bootstrap_inner
>> self.run()
>>   File "/home/ico/web2py/gluon/rocket.py", line 1268, in run
>> conn = Connection(*conn)
>>   File "/home/ico/web2py/gluon/rocket.py", line 105, in __init__
>> self.socket.settimeout(SOCKET_TIMEOUT)
>> OSError: [Errno 9] Bad file descriptor
>>
>> Exception in thread Thread-5:
>> Traceback (most recent call last):
>>   File "/usr/lib/python3.7/threading.py", line 917, in _bootstrap_inner
>> self.run()
>>   File "/home/ico/web2py/gluon/rocket.py", line 1268, in run
>> conn = Connection(*conn)
>>   File "/home/ico/web2py/gluon/rocket.py", line 105, in __init__
>> self.socket.settimeout(SOCKET_TIMEOUT)
>> OSError: [Errno 9] Bad file descriptor
>>
>> Exception in thread Thread-6:
>> Traceback (most recent call last):
>>   File "/usr/lib/python3.7/threading.py", line 917, in _bootstrap_inner
>> self.run()
>>   File "/home/ico/web2py/gluon/rocket.py", line 1268, in run
>> conn = Connection(*conn)
>>   File "/home/ico/web2py/gluon/rocket.py", line 105, in __init__
>> self.socket.settimeout(SOCKET_TIMEOUT)
>> OSError: [Errno 9] Bad file descriptor
>>
>> Exception in thread Thread-7:
>> Traceback (most recent call last):
>>   File "/usr/lib/python3.7/threading.py", line 917, in _bootstrap_inner
>> self.run()
>>   File "/home/ico/web2py/gluon/rocket.py", line 1268, in run
>> conn = Connection(*conn)
>>   File "/home/ico/web2py/gluon/rocket.py", line 105, in __init__
>> self.socket.settimeout(SOCK

[web2py] Re: Errors using web2py 2.18.5 , python3 and ssl

2019-06-25 Thread Dave S


On Tuesday, June 25, 2019 at 10:04:39 AM UTC-7, icodk wrote:
>
> Now I tried both another Windows 10 machine and ubuntu with similar errors
> As you can see bellow I used port 8000 on liniux because using port 443 
> gave the following error:
>
> ERROR:Rocket.Errors.Port443:Socket 0.0.0.0:443 in use by other process 
> and it won't share.
> WARNING:Rocket.Errors.Port443:Listener started when not ready.
>
> However, netstat didn't revile any process using 443 and nc could listen 
> on this port 
> $ sudo nc -l  -p 443
>
>
> and receive connections from another machine (telnet 192.168.1.223 443)
>
>
>
Well, I've used all my rounds.  I have run Rocket on port 443, but that was 
with a 2.15.4 version on AWS Linux.   And when I renewed the certificates, 
I got something messed up, couldn't figure it out, and so I finished the 
move to Nginx.  I don't think Rocket has had many changes, although the 
Python3 effort may have had to touch it some.

I have not tried 443 on Windows (just 8000, 8080, 8800, ...), and I have 
not tried the Nginx Windows port (I believe it is still marked 
"experimental").

As a relatively easy choice of alternate technology, you can do a real 
simple Node.js server that echos your request.  Mercurial includes a 
webserver (might not be stand-alone on Windows) and I believe it's in the 
standard release package, just waiting to be turned on.

Good luck!

/dps


> The error from the server on linux
> $ python3 web2py.py -c cert/ca.crt -k cert/ca.key -a "password" -i 
> 192.168.1.223 -p 8000
> web2py Web Framework
> Created by Massimo Di Pierro, Copyright 2007-2019
> Version 2.18.5-stable+timestamp.2019.04.07.21.13.59
> Database drivers available: sqlite3, imaplib, pymysql
>
> please visit:
> https://192.168.1.223:8000/
> use "kill -SIGTERM 7818" to shutdown the web2py server
>
>
> Exception in thread Thread-2:
> Traceback (most recent call last):
>   File "/usr/lib/python3.7/threading.py", line 917, in _bootstrap_inner
> self.run()
>   File "/home/ico/web2py/gluon/rocket.py", line 1268, in run
> conn = Connection(*conn)
>   File "/home/ico/web2py/gluon/rocket.py", line 105, in __init__
> self.socket.settimeout(SOCKET_TIMEOUT)
> OSError: [Errno 9] Bad file descriptor
>
> Exception in thread Thread-3:
> Traceback (most recent call last):
>   File "/usr/lib/python3.7/threading.py", line 917, in _bootstrap_inner
> self.run()
>   File "/home/ico/web2py/gluon/rocket.py", line 1268, in run
> conn = Connection(*conn)
>   File "/home/ico/web2py/gluon/rocket.py", line 105, in __init__
> self.socket.settimeout(SOCKET_TIMEOUT)
> OSError: [Errno 9] Bad file descriptor
>
> Exception in thread Thread-4:
> Traceback (most recent call last):
>   File "/usr/lib/python3.7/threading.py", line 917, in _bootstrap_inner
> self.run()
>   File "/home/ico/web2py/gluon/rocket.py", line 1268, in run
> conn = Connection(*conn)
>   File "/home/ico/web2py/gluon/rocket.py", line 105, in __init__
> self.socket.settimeout(SOCKET_TIMEOUT)
> OSError: [Errno 9] Bad file descriptor
>
> Exception in thread Thread-5:
> Traceback (most recent call last):
>   File "/usr/lib/python3.7/threading.py", line 917, in _bootstrap_inner
> self.run()
>   File "/home/ico/web2py/gluon/rocket.py", line 1268, in run
> conn = Connection(*conn)
>   File "/home/ico/web2py/gluon/rocket.py", line 105, in __init__
> self.socket.settimeout(SOCKET_TIMEOUT)
> OSError: [Errno 9] Bad file descriptor
>
> Exception in thread Thread-6:
> Traceback (most recent call last):
>   File "/usr/lib/python3.7/threading.py", line 917, in _bootstrap_inner
> self.run()
>   File "/home/ico/web2py/gluon/rocket.py", line 1268, in run
> conn = Connection(*conn)
>   File "/home/ico/web2py/gluon/rocket.py", line 105, in __init__
> self.socket.settimeout(SOCKET_TIMEOUT)
> OSError: [Errno 9] Bad file descriptor
>
> Exception in thread Thread-7:
> Traceback (most recent call last):
>   File "/usr/lib/python3.7/threading.py", line 917, in _bootstrap_inner
> self.run()
>   File "/home/ico/web2py/gluon/rocket.py", line 1268, in run
> conn = Connection(*conn)
>   File "/home/ico/web2py/gluon/rocket.py", line 105, in __init__
> self.socket.settimeout(SOCKET_TIMEOUT)
> OSError: [Errno 9] Bad file descriptor
>
> Exception in thread Thread-9:
> Traceback (most recent call last):
>   File "/usr/lib/python3.7/threading.py", line 917, in _bootstrap_inner
> self.run()
>   File "/home/ico/web2py/gluon/rocket.py", line 1268, in run
> conn = Connection(*conn)
>   File "/home/ico/web2py/gluon/rocket.py", line 105, in __init__
> self.socket.settimeout(SOCKET_TIMEOUT)
> OSError: [Errno 9] Bad file descriptor
>
> Exception in thread Thread-10:
> Traceback (most recent call last):
>   File "/usr/lib/python3.7/threading.py", line 917, in _bootstrap_inner
> self.run()
>   File "/home/ico/web2py/gluon/rocket.py", line 1268, in run
> conn = Connection(*conn)
>   File "/home/ico/web2py/gluon/rocket.py"

[web2py] Re: Errors using web2py 2.18.5 , python3 and ssl

2019-06-25 Thread icodk
Now I tried both another Windows 10 machine and ubuntu with similar errors
As you can see bellow I used port 8000 on liniux because using port 443 
gave the following error:

ERROR:Rocket.Errors.Port443:Socket 0.0.0.0:443 in use by other process and 
it won't share.
WARNING:Rocket.Errors.Port443:Listener started when not ready.

However, netstat didn't revile any process using 443 and nc could listen on 
this port 
$ sudo nc -l  -p 443


and receive connections from another machine (telnet 192.168.1.223 443)



The error from the server on linux
$ python3 web2py.py -c cert/ca.crt -k cert/ca.key -a "password" -i 
192.168.1.223 -p 8000
web2py Web Framework
Created by Massimo Di Pierro, Copyright 2007-2019
Version 2.18.5-stable+timestamp.2019.04.07.21.13.59
Database drivers available: sqlite3, imaplib, pymysql

please visit:
https://192.168.1.223:8000/
use "kill -SIGTERM 7818" to shutdown the web2py server


Exception in thread Thread-2:
Traceback (most recent call last):
  File "/usr/lib/python3.7/threading.py", line 917, in _bootstrap_inner
self.run()
  File "/home/ico/web2py/gluon/rocket.py", line 1268, in run
conn = Connection(*conn)
  File "/home/ico/web2py/gluon/rocket.py", line 105, in __init__
self.socket.settimeout(SOCKET_TIMEOUT)
OSError: [Errno 9] Bad file descriptor

Exception in thread Thread-3:
Traceback (most recent call last):
  File "/usr/lib/python3.7/threading.py", line 917, in _bootstrap_inner
self.run()
  File "/home/ico/web2py/gluon/rocket.py", line 1268, in run
conn = Connection(*conn)
  File "/home/ico/web2py/gluon/rocket.py", line 105, in __init__
self.socket.settimeout(SOCKET_TIMEOUT)
OSError: [Errno 9] Bad file descriptor

Exception in thread Thread-4:
Traceback (most recent call last):
  File "/usr/lib/python3.7/threading.py", line 917, in _bootstrap_inner
self.run()
  File "/home/ico/web2py/gluon/rocket.py", line 1268, in run
conn = Connection(*conn)
  File "/home/ico/web2py/gluon/rocket.py", line 105, in __init__
self.socket.settimeout(SOCKET_TIMEOUT)
OSError: [Errno 9] Bad file descriptor

Exception in thread Thread-5:
Traceback (most recent call last):
  File "/usr/lib/python3.7/threading.py", line 917, in _bootstrap_inner
self.run()
  File "/home/ico/web2py/gluon/rocket.py", line 1268, in run
conn = Connection(*conn)
  File "/home/ico/web2py/gluon/rocket.py", line 105, in __init__
self.socket.settimeout(SOCKET_TIMEOUT)
OSError: [Errno 9] Bad file descriptor

Exception in thread Thread-6:
Traceback (most recent call last):
  File "/usr/lib/python3.7/threading.py", line 917, in _bootstrap_inner
self.run()
  File "/home/ico/web2py/gluon/rocket.py", line 1268, in run
conn = Connection(*conn)
  File "/home/ico/web2py/gluon/rocket.py", line 105, in __init__
self.socket.settimeout(SOCKET_TIMEOUT)
OSError: [Errno 9] Bad file descriptor

Exception in thread Thread-7:
Traceback (most recent call last):
  File "/usr/lib/python3.7/threading.py", line 917, in _bootstrap_inner
self.run()
  File "/home/ico/web2py/gluon/rocket.py", line 1268, in run
conn = Connection(*conn)
  File "/home/ico/web2py/gluon/rocket.py", line 105, in __init__
self.socket.settimeout(SOCKET_TIMEOUT)
OSError: [Errno 9] Bad file descriptor

Exception in thread Thread-9:
Traceback (most recent call last):
  File "/usr/lib/python3.7/threading.py", line 917, in _bootstrap_inner
self.run()
  File "/home/ico/web2py/gluon/rocket.py", line 1268, in run
conn = Connection(*conn)
  File "/home/ico/web2py/gluon/rocket.py", line 105, in __init__
self.socket.settimeout(SOCKET_TIMEOUT)
OSError: [Errno 9] Bad file descriptor

Exception in thread Thread-10:
Traceback (most recent call last):
  File "/usr/lib/python3.7/threading.py", line 917, in _bootstrap_inner
self.run()
  File "/home/ico/web2py/gluon/rocket.py", line 1268, in run
conn = Connection(*conn)
  File "/home/ico/web2py/gluon/rocket.py", line 105, in __init__
self.socket.settimeout(SOCKET_TIMEOUT)
OSError: [Errno 9] Bad file descriptor

Exception in thread Thread-11:
Traceback (most recent call last):
  File "/usr/lib/python3.7/threading.py", line 917, in _bootstrap_inner
self.run()
  File "/home/ico/web2py/gluon/rocket.py", line 1268, in run
conn = Connection(*conn)
  File "/home/ico/web2py/gluon/rocket.py", line 105, in __init__
self.socket.settimeout(SOCKET_TIMEOUT)
OSError: [Errno 9] Bad file descriptor

Exception in thread Thread-8:
Traceback (most recent call last):
  File "/usr/lib/python3.7/threading.py", line 917, in _bootstrap_inner
self.run()
  File "/home/ico/web2py/gluon/rocket.py", line 1268, in run
conn = Connection(*conn)
  File "/home/ico/web2py/gluon/rocket.py", line 105, in __init__
self.socket.settimeout(SOCKET_TIMEOUT)
OSError: [Errno 9] Bad file descriptor




On Tuesday, June 25, 2019 at 11:26:55 AM UTC+2, icodk wrote:
>
> yes and it is python.exe that own the prort. Also the server serves the 
> index.html page but then it

Re: [web2py] Re: Tip to remove L from interger 750L when exporting json to view?

2019-06-25 Thread António Ramos
Better.
Thank you  all :)

Em ter, 25 de jun de 2019 às 17:14, Leonel Câmara 
escreveu:

> Just return the dict as is on the controller and then in the view you can
> do something like:
>
> {{from gluon import serializers}}
> {{=XML(serializers.json(spendData ), sanitize=False)}}
>
> Another alternative is to use the ASSIGNJS helper if you want this in a
> javascript variable:
> http://web2py.com/books/default/chapter/29/05/the-views#ASSIGNJS
>
> --
> 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.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/web2py/a3e2cbb5-867c-482c-8083-b61b45903dde%40googlegroups.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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/CAEM0BxMXgXO-KEEAj_eZVuYkFVkVN0WVS1vU1o%3D70%2BTB6p-r1A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Tip to remove L from interger 750L when exporting json to view?

2019-06-25 Thread Leonel Câmara
Just return the dict as is on the controller and then in the view you can 
do something like:

{{from gluon import serializers}}
{{=XML(serializers.json(spendData ), sanitize=False)}}

Another alternative is to use the ASSIGNJS helper if you want this in a 
javascript variable:
http://web2py.com/books/default/chapter/29/05/the-views#ASSIGNJS

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/a3e2cbb5-867c-482c-8083-b61b45903dde%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Tip to remove L from interger 750L when exporting json to view?

2019-06-25 Thread António Ramos
That is where i tried first..

first my controller
return response.json(myvar)
it returned the json to the view correctly.

Then i need to return a dict to use it in my view.

ret= response.json(myvar)
return dict(ret=ret)
then in the view i just had
{{extend 'layout.html'}}
{{=ret}}

It does not work.
All my html is not interpreted and is dumpled like bellow...
[image: image.png]




Em ter, 25 de jun de 2019 às 15:42, Val K  escreveu:

> How do you convert dict to json? I believe that json.dumps or
> response.json produces json strings without L suffix
>
> --
> 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.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/web2py/cad32539-a4c4-4d49-a964-4243a008a534%40googlegroups.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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/CAEM0BxP3t63Kim3cxNuTdAiQh-CKpMcH0M8yemEYX2qCzdggfQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Tip to remove L from interger 750L when exporting json to view?

2019-06-25 Thread Val K
How do you convert dict to json? I believe that json.dumps or response.json 
produces json strings without L suffix

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/cad32539-a4c4-4d49-a964-4243a008a534%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Tip to remove L from interger 750L when exporting json to view?

2019-06-25 Thread Leonel Câmara
That just means it's a long (python 2 has integers and longs). How are you 
putting that dict in the view? I would just serialize it using json.

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/2b46ed2b-09fd-4dee-aaca-47430680dbb7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Tip to remove L from interger 750L when exporting json to view?

2019-06-25 Thread António Ramos
Hello i have a dict like
var spendData = [
{'exist': 7250L, 'lote': 'F0523E103S'},
{'exist': 23100L, 'lote': 'F0609F103S'}, ...]

when in the view i get an error
Uncaught SyntaxError: Invalid or unexpected token

i guess its the "L" and the end of 7250
how can i eliminate it  before passing the dict to the view?

regards
António

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/CAEM0BxMOym-_a%2Bg4YLTEUiY8S9F3uRmE2gU33DPnscidKqV8Sw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Errors using web2py 2.18.5 , python3 and ssl

2019-06-25 Thread icodk
yes and it is python.exe that own the prort. Also the server serves the 
index.html page but then it hangs


On Tuesday, June 25, 2019 at 5:14:50 AM UTC+2, Dave S wrote:
>
>
>
> On Monday, June 24, 2019 at 2:37:32 PM UTC-7, icodk wrote:
>>
>> yes. I run it in  Administrator Command prompt. 
>> What else could I be missing ?
>> Will try on another Windows 10  machine  and linux.
>>
>>
> Did you check if port 443 was already in use?  Try
> netstat -ab
> (note the dash)
>
> /dps
>  
>
>> On Monday, June 24, 2019 at 10:27:05 PM UTC+2, Dave S wrote:
>>>
>>>
>>>
>>> On Sunday, June 23, 2019 at 4:19:41 AM UTC-7, icodk wrote:

 plan web2py 2.18.5 installation on windows from source on Windows 10 
 running the welcome application without errors.
 However trying to run it with SSL gives the following errors:
 Command :
 C:\Python37\python.exe C:\temp\web2py\web2py.py -c C:\temp\web2py\cert\
 ca.crt -k C:\temp\web2py\cert\ca.key -a "password" -i 192.168.1.100 -p 
 443


>>> Are you running with elevated privilege (i.e., opening cmd.exe with "Run 
>>> as Administrator") ?
>>>
>>> Port 443  requires privilege on Linux, and it wouldn't be a surprise if 
>>> that was the case on Windows.
>>>
>>>
>>> Errors:

 C:\Temp\web2py>C:\Python37\python.exe C:\temp\web2py\web2py.py -c 
 C:\temp\web2py\cert\ca.crt -k C:\temp\web2py\cert\ca.key -a "password" -i 
 192.168.1.100 -p 443
 web2py Web Framework
 Created by Massimo Di Pierro, Copyright 2007-2019
 Version 2.18.5-stable+timestamp.2019.04.07.21.13.59
 Database drivers available: sqlite3, psycopg2, imaplib, pymysql, pyodbc

 please visit:
 https://192.168.1.100:443/
 use "taskkill /f /pid 13408" to shutdown the web2py server


 Exception in thread Thread-2:
 Traceback (most recent call last):
   File "C:\Python37\lib\threading.py", line 917, in _bootstrap_inner
 self.run()
   File "C:\temp\web2py\gluon\rocket.py", line 1268, in run
 conn = Connection(*conn)
   File "C:\temp\web2py\gluon\rocket.py", line 105, in __init__
 self.socket.settimeout(SOCKET_TIMEOUT)
 OSError: [WinError 10038] An operation was attempted on something that 
 is not a socket

 Exception in thread Thread-3:
 Traceback (most recent call last):
   File "C:\Python37\lib\threading.py", line 917, in _bootstrap_inner
 self.run()
   File "C:\temp\web2py\gluon\rocket.py", line 1268, in run
 conn = Connection(*conn)
   File "C:\temp\web2py\gluon\rocket.py", line 105, in __init__
 self.socket.settimeout(SOCKET_TIMEOUT)
 OSError: [WinError 10038] An operation was attempted on something that 
 is not a socket

 Exception in thread Thread-5:
 Traceback (most recent call last):
   File "C:\Python37\lib\threading.py", line 917, in _bootstrap_inner
 self.run()
   File "C:\temp\web2py\gluon\rocket.py", line 1268, in run
 conn = Connection(*conn)
   File "C:\temp\web2py\gluon\rocket.py", line 105, in __init__
 self.socket.settimeout(SOCKET_TIMEOUT)
 OSError: [WinError 10038] An operation was attempted on something that 
 is not a socket

 Exception in thread Thread-6:
 Traceback (most recent call last):
   File "C:\Python37\lib\threading.py", line 917, in _bootstrap_inner
 self.run()
   File "C:\temp\web2py\gluon\rocket.py", line 1268, in run
 conn = Connection(*conn)
   File "C:\temp\web2py\gluon\rocket.py", line 105, in __init__
 self.socket.settimeout(SOCKET_TIMEOUT)
 OSError: [WinError 10038] An operation was attempted on something that 
 is not a socket

 Exception in thread Thread-7:
 Traceback (most recent call last):
   File "C:\Python37\lib\threading.py", line 917, in _bootstrap_inner
 self.run()
   File "C:\temp\web2py\gluon\rocket.py", line 1268, in run
 conn = Connection(*conn)
   File "C:\temp\web2py\gluon\rocket.py", line 105, in __init__
 self.socket.settimeout(SOCKET_TIMEOUT)
 OSError: [WinError 10038] An operation was attempted on something that 
 is not a socket

 Exception in thread Thread-8:
 Traceback (most recent call last):
   File "C:\Python37\lib\threading.py", line 917, in _bootstrap_inner
 self.run()
   File "C:\temp\web2py\gluon\rocket.py", line 1268, in run
 conn = Connection(*conn)
   File "C:\temp\web2py\gluon\rocket.py", line 105, in __init__
 self.socket.settimeout(SOCKET_TIMEOUT)
 OSError: [WinError 10038] An operation was attempted on something that 
 is not a socket

 Exception in thread Thread-9:
 Traceback (most recent call last):
   File "C:\Python37\lib\threading.py", line 917, in _bootstrap_inner
 self.run()
   File "C:\temp\web2py\gluon\rocket.py", line 1268, in run
 conn = Connection(*conn)
   File "C:\temp\web2py\