-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Em 08-08-2013 22:05, Ricardo Pedroso escreveu:
> 
> On Thu, Aug 8, 2013 at 9:22 PM, Carlos Correia <car...@memoriapersistente.pt
> <mailto:car...@memoriapersistente.pt>> wrote:
> 
>     -----BEGIN PGP SIGNED MESSAGE-----
>     Hash: SHA1
> 
>     Em 08-08-2013 20:23, Ricardo Pedroso escreveu:
>     > On Thu, Aug 8, 2013 at 2:36 PM, Carlos Correia
>     <car...@memoriapersistente.pt <mailto:car...@memoriapersistente.pt>
>     > <mailto:car...@memoriapersistente.pt
>     <mailto:car...@memoriapersistente.pt>>> wrote:
>     >
>     >     -----BEGIN PGP SIGNED MESSAGE-----
>     >     Hash: SHA1
>     >
>     >     Hi,
>     >
>     >     I'm facing a bug when I redirect to another controller, that 
> redirects
>     the user
>     >     to the login prompt, after having been authenticated.
>     >
>     >
>     > It's hard to tell what the problem is but for me it seems that web2py is
>     failing
>     > to load the
>     > session data.
>     > If you dont mind to tweak your gluon/globals.py you could add a raise
>     statement
>     > to reraise some exceptions that are been swallowed when web2py tries to
>     load the
>     > session data.
> 
>     And where/how should I do that?
> 
> 
> Depends on what kind of sessions you use, supposing you are using file 
> sessions:
> in gluon/globals.py around line 674 you have this:
> 
> ....
>                 try:
>                     response.session_file = \
>                         open(response.session_filename, 'rb+')
>                     try:
>                         portalocker.lock(response.session_file,
>                                          portalocker.LOCK_EX)
>                         response.session_locked = True
>                         self.update(cPickle.load(response.session_file))
>                         response.session_file.seek(0)
>                         oc = response.session_filename.split('/')[-1]\
>                             .split('-')[0]
>                         if check_client and client != oc:
>                             raise Exception("cookie attack")
>                     except:
>                         response.session_id = None
>                     finally:
>                         pass
>                         #This causes admin login to break. Must find out why.
>                         #self._close(response)
>                 except:
>                     response.session_file = None
>             if not response.session_id:
> 
> 
> After those two except's append a line with raise
> eg:
> 
>     except:
>         raise
> 
> This will reraise any exception that may happen.
> 
> 
Thank you VERY much :)

I've already found it, though only in the server.

Is there a way to force this exception to be raised when I run it locally?


[Thu Aug 08 22:27:05 2013] [error]   File
"applications/belmiro/modules/belmiro/db/models/doc_evol_fin_trigger.py", line
3, in <module>
[Thu Aug 08 22:27:05 2013] [error]     from belmiro.db.models.ent_doc_type
import EntDocTypeModel
[Thu Aug 08 22:27:05 2013] [error]   File
"/home/beeweb/sites/take5/web2py/current/gluon/custom_import.py", line 292, in
__call__
[Thu Aug 08 22:27:05 2013] [error]     globals, locals, fromlist, level)
[Thu Aug 08 22:27:05 2013] [error]   File
"/home/beeweb/sites/take5/web2py/current/gluon/custom_import.py", line 80, in
__call__
[Thu Aug 08 22:27:05 2013] [error]     level)
[Thu Aug 08 22:27:05 2013] [error]   File
"applications/belmiro/modules/belmiro/db/models/ent_doc_type.py", line 12, in
<module>
[Thu Aug 08 22:27:05 2013] [error]     T = current.T
[Thu Aug 08 22:27:05 2013] [error] AttributeError: 'thread._local' object has no
attribute 'T'
[Thu Aug 08 22:27:05 2013] [error] *** in applications/belmiro/models/db.py:32:

- -- 
Com os melhores cumprimentos,

Carlos Correia
=========================
MEMÓRIA PERSISTENTE
Tel.: 219 291 591 - GSM:  917 157 146 / 967 511 762
e-mail: ge...@memoriapersistente.pt - URL: http://www.memoriapersistente.pt
Jabber: m...@jabber.org
GnuPG: wwwkeys.eu.pgp.net
URL Suporte: https://t5.m16e.com/gps
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
Comment: Using GnuPG with undefined - http://www.enigmail.net/

iEYEARECAAYFAlIEHWoACgkQ90uzwjA1SJXfEwCdGddRO5BydCELRe3za2Nd8X1/
9kEAnivePFNg8IV/eUI3gV3N/OZ3tnBI
=x5eG
-----END PGP SIGNATURE-----

-- 

--- 
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/groups/opt_out.

Reply via email to