Could someone give me some tip to avoid this error?
----------------------------
return tg.i18n.format_date(value, locale=tg.i18n.get_locale(), date_format=date_format)
File "/home/sf/.VE-SIC.x-x86_64-19.04.2010/lib/python2.6/site-packages/TurboGears-1.1.1-py2.6.egg/turbogears/i18n/utils.py", line 66, in get_locale
locale = get_locale_f()
File "/home/sf/.VE-SIC.x-x86_64-19.04.2010/lib/python2.6/site-packages/TurboGears-1.1.1-py2.6.egg/turbogears/i18n/utils.py", line 80, in _get_locale
locale = cherrypy.session.get(locale_key)
File "/home/sf/.VE-SICER2.x-x86_64-19.04.2010/lib/python2.6/site-packages/cherrypy/filters/sessionfilter.py", line 485, in __getattr__
data = sess.session_storage.load(sess.session_id)
File "/home/sf/.VE-SIC.x-x86_64-19.04.2010/lib/python2.6/site-packages/cherrypy/filters/sessionfilter.py", line 284, in load
data = pickle.load(f)
ValueError: could not convert string to int
-----------------------------
Thanks for any help,
j
I'm not sure, but it looks like that your session data is malformed
(corrupted). Try to delete the session from storage (do you use file
storage?) and request the page again. I had something same before.
2011/2/11 jose soares <jose....@sferacarta.com>:
> --
> You received this message because you are subscribed to the Google Groups
> "TurboGears" group.
> To post to this group, send email to turbo...@googlegroups.com.
> To unsubscribe from this group, send email to
> turbogears+...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/turbogears?hl=en.
>
>
return tg.i18n.format_date(value, locale=tg.i18n.get_locale(), date_format=date_format)
File "/uy/.VE-SICER2.x-x86_64-19.04.2010/lib/python2.6/site-packages/TurboGears-1.1.1-py2.6.egg/turbogears/i18n/utils.py", line 66, in get_locale
locale = get_locale_f()
File "/uy/.VE-SICER2.x-x86_64-19.04.2010/lib/python2.6/site-packages/TurboGears-1.1.1-py2.6.egg/turbogears/i18n/utils.py", line 80, in _get_locale
locale = cherrypy.session.get(locale_key)
File "/uy/.VE-SICER2.x-x86_64-19.04.2010/lib/python2.6/site-packages/cherrypy/filters/sessionfilter.py", line 485, in __getattr__
data = sess.session_storage.load(sess.session_id)
File "/uy/.VE-SICER2.x-x86_64-19.04.2010/lib/python2.6/site-packages/cherrypy/filters/sessionfilter.py", line 284, in load
data = pickle.load(f)
UnicodeDecodeError: 'rawunicodeescape' codec can't decode bytes in position 2561-2562: truncated \uXXXX
I'm going to clean file session as you suggest to see if the error goes
away. I'll let you know.
Thank you for your help.
j
it's me again, a couple of days ago I followed what Pavel suggested to me, and I tried to clean the session files to see if the error went away.
Unfortunately, it came back again.
... File "/home/users/admin/.VE-SICER2.x-x86_64-19.04.2010/lib/python2.6/site-packages/cherrypy/filters/sessionfilter.py", line 284, in load
data = pickle.load(f)
UnicodeDecodeError: 'rawunicodeescape' codec can't decode bytes in position 4053-4055: truncated \uXXXX
and
... File "/home/users/admin/.VE-SICER2.x-x86_64-19.04.2010/lib/python2.6/site-packages/cherrypy/filters/sessionfilter.py", line 284, in load
data = pickle.load(f)
ValueError: insecure string pickle
Anyone have any idea how to fix it?
j
Maybe you are copying session files from a Windows to a Linux machine,
or the disk space for the session files is corrupt or full? If you put
string data in the session, try to use unicode instead.
You can also check if it works better with TG 1.5 (CherryPy 3).
-- Christoph
return tg.i18n.format_date(value, locale=tg.i18n.get_locale(),
date_format=date_format)
File
"/home/sf/.VE-SIC.x-x86_64-19.04.2010/lib/python2.6/site-packages/TurboGears-1.1.1-py2.6.egg/turbogears/i18n/utils.py",
line 66, in get_locale
locale = get_locale_f()
File
"/home/sf/.VE-SIC.x-x86_64-19.04.2010/lib/python2.6/site-packages/TurboGears-1.1.1-py2.6.egg/turbogears/i18n/utils.py",
line 80, in _get_locale
locale = cherrypy.session.get(locale_key)
File
"/home/sf/.VE-SICER2.x-x86_64-19.04.2010/lib/python2.6/site-packages/cherrypy/filters/sessionfilter.py",
line 485, in __getattr__
data = sess.session_storage.load(sess.session_id)
File
"/home/sf/.VE-SIC.x-x86_64-19.04.2010/lib/python2.6/site-packages/cherrypy/filters/sessionfilter.py",
line 284, in load
data = pickle.load(f)
ValueError: could not convert string to int
j
The get_local() call tries to get the locale from the session. It seems
the session file for that session got orrupted for whatever reason, so
when trying to read the session at that point you see this error.
-- Christoph
j
Then has it worked in the past and you're seeing these errors only now?
Maybe all of the installations are saved on the same harddisk partition
that is corrupt or full or reached a quota or there is some kind of hot
backup/restore or sync mechanism active on the session directories?
Or maybe you started to store some strange things in the session which
cause the unplicking to fail?
Do the installations use different directories for storing the sessions?
Do you set session_filter.storage_path in the config?
Btw, if you can't get file based sessions to work, maybe RAM sessions
are an option for you (set session_filter.storage_type=Ram)? And
CherryPy also allows a PostgreSQL database as backend.
Another option are visit based sessions, but I have gested and
documented that only with TG 1.5:
http://docs.turbogears.org/1.5/VisitBasedSessions
-- Christoph
j
--
Jose Soares
Sferacarta Net
Via Bazzanese 69
40033 Casalecchio di Reno
Bologna - Italy
Ph +39051591054
fax +390516131537
web:www.sferacarta.com
Le informazioni contenute nella presente mail ed in ogni eventuale file allegato sono riservate e, comunque, destinate esclusivamente alla persona o ente sopraindicati, ai sensi del decreto legislativo 30 giugno 2003, n. 196. La diffusione, distribuzione e/o copiatura della mail trasmessa, da parte di qualsiasi soggetto diverso dal destinatario, sono vietate. La correttezza, l�integrit� e la sicurezza della presente mail non possono essere garantite. Se avete ricevuto questa mail per errore, Vi preghiamo di contattarci immediatamente e di eliminarla. Grazie.
This communication is intended only for use by the addressee, pursuant to legislative decree 30 June 2003, n. 196. It may contain confidential or privileged information. You should not copy or use it to disclose its contents to any other person. Transmission cannot be guaranteed to be error-free, complete and secure. If you are not the intended recipient and receive this communication unintentionally, please inform us immediately and then delete this message from your system. Thank you.
Le informazioni contenute nella presente mail ed in ogni eventuale file allegato sono riservate e, comunque, destinate esclusivamente alla persona o ente sopraindicati, ai sensi del decreto legislativo 30 giugno 2003, n. 196. La diffusione, distribuzione e/o copiatura della mail trasmessa, da parte di qualsiasi soggetto diverso dal destinatario, sono vietate. La correttezza, l’integrità e la sicurezza della presente mail non possono essere garantite. Se avete ricevuto questa mail per errore, Vi preghiamo di contattarci immediatamente e di eliminarla. Grazie.
This communication is intended only for use by the addressee, pursuant to legislative decree 30 June 2003, n. 196. It may contain confidential or privileged information. You should not copy or use it to disclose its contents to any other person. Transmission cannot be guaranteed to be error-free, complete and secure. If you are not the intended recipient and receive this communication unintentionally, please inform us immediately and then delete this message from your system. Thank you.
* cherrypy.session.get error -reported on 27 Nov 2009, 12:29
* tg_source and tg_exceptions - reported on 25 Feb 2009, 14:41
and I never resolved the question.
> Maybe all of the installations are saved on the same harddisk partition
> that is corrupt or full or reached a quota or there is some kind of hot
> backup/restore or sync mechanism active on the session directories?
>
The servers are different, they are installed in different cities.
The file session-???? is saved in the /tmp/ directory
> Or maybe you started to store some strange things in the session which
> cause the unplicking to fail?
>
!?
> Do the installations use different directories for storing the sessions?
> Do you set session_filter.storage_path in the config?
>
in my app.cfg ha have this:
session_filter.on = True
session_filter.storage_type = 'File'
session_filter.storage_path = '/tmp/'
session_filter.timeout = 60
> Btw, if you can't get file based sessions to work, maybe RAM sessions
> are an option for you (set session_filter.storage_type=Ram)?
> And CherryPy also allows a PostgreSQL database as backend.
>
Is it possible to use PostgreSQL as session storage? Where can I learn
more about it?
> Another option are visit based sessions, but I have gested and
> documented that only with TG 1.5:
> http://docs.turbogears.org/1.5/VisitBasedSessions
>
> -- Christoph
>
>
--
Jose Soares
Sferacarta Net
Via Bazzanese 69
40033 Casalecchio di Reno
Bologna - Italy
Ph +39051591054
fax +390516131537
web:www.sferacarta.com
Le informazioni contenute nella presente mail ed in ogni eventuale file allegato sono riservate e, comunque, destinate esclusivamente alla persona o ente sopraindicati, ai sensi del decreto legislativo 30 giugno 2003, n. 196. La diffusione, distribuzione e/o copiatura della mail trasmessa, da parte di qualsiasi soggetto diverso dal destinatario, sono vietate. La correttezza, l�integrit� e la sicurezza della presente mail non possono essere garantite. Se avete ricevuto questa mail per errore, Vi preghiamo di contattarci immediatamente e di eliminarla. Grazie.
Maxim Oganesyan wrote:
> No, I mean locale of Your operating system.
> Can You start terminal and type "locale"?
>
> Avviare il Terminale e scrivere in esso "locale ". Quali informazioni
> vengono visualizzate?
>
> 2011/2/15 jo <jose....@sferacarta.com
> <mailto:jose....@sferacarta.com>>
>
> Maxim Oganesyan wrote:
>
> Good day, Jose.
> What is Your operating system default locale?
>
>
> Linux josedev 2.6.28-vm64 #2 Thu Mar 12 12:06:51 CET 2009 x86_64
> GNU/Linux
>
>
> j
>
> Maxim
>
> On Feb 15, 3:08 pm, jo <jose.soa...@sferacarta.com
Maybe there is a cron job or something on your server forecefully trying
to clean up your /tmp/ directory or there is some process filling the
temp filesystem from time to time.
Try using a dedicated directory outside of /tmp for the session files.
> Is it possible to use PostgreSQL as session storage? Where can I learn
> more about it?
http://www.cherrypy.org/chrome/common/2.2/docs/book/chunk/ch03.html#backends
-- Christoph
~$ locale
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=
I'm using PostgreSQL to store my session data, seems it works fine. :-)
I'm trying to implement it on Oracle with a monkeypatch, because in some
context I don't have pg installed.
I have a problem of data type, because Oracle hasn't TEXT type, seems
the equivalent is CLOB
infact SQLAlchemy creates the table like this:
name | data_type | nullable | data_default | data_length
--------------- + ------------ + -------- + ------------ + -----------
ID | NVARCHAR2 | N | NULL | 80
DATA | CLOB | Y | NULL | 4000
EXPIRATION_TIME | TIMESTAMP(6) | Y | NULL | 11
but pickle doesn't like it...
...data *=* pickle*.*loads*(*pickled_data*)*|
*TypeError: ('loads() argument 1 must be string, not cx_Oracle.LOB',
<bound method Root.index of <sicer.BASE.controller.Root object at
0x8231f10>>)*
any idea how to solve this?
thank you.
j
If it interest to someone to have this monkeypatch I can send it to him.
I want to say thanks to everybody who helped me to solve this problem. :-)
j
If you switch to TG 1.5 check out this recipe:
http://docs.turbogears.org/1.5/VisitBasedSessions
The idea here is to store the session in the visit table that you're
using anyway, so you won't need a separate database or database connection.
-- Christoph