*** [Arfrever] has quit IRC | 00:50 | |
*** [Arfrever] has joined #zope | 00:52 | |
*** Arfrever has quit IRC | 00:59 | |
*** J1m has quit IRC | 01:16 | |
*** freedom01 has quit IRC | 03:22 | |
*** MatthewWilkes has quit IRC | 03:35 | |
*** MatthewWilkes has joined #zope | 03:39 | |
*** freedom01 has joined #zope | 04:08 | |
*** freedom01 has quit IRC | 05:13 | |
*** freedom01 has joined #zope | 05:41 | |
*** freedom01 has quit IRC | 09:26 | |
*** alecm has quit IRC | 09:28 | |
*** alecm has joined #zope | 09:32 | |
*** alecm has joined #zope | 09:32 | |
*** freedom01 has joined #zope | 10:02 | |
*** El_Rolando has joined #zope | 10:08 | |
*** freedom01 has quit IRC | 10:16 | |
*** rp has joined #zope | 10:35 | |
*** rp has left #zope | 10:35 | |
*** freedom01 has joined #zope | 10:49 | |
*** alecm has quit IRC | 11:29 | |
*** alecm has joined #zope | 11:35 | |
*** srichter has quit IRC | 12:20 | |
*** Pumukel has joined #zope | 12:27 | |
*** srichter has joined #zope | 12:52 | |
*** srichter has joined #zope | 12:53 | |
*** srichter_ has joined #zope | 12:55 | |
*** srichter has quit IRC | 12:58 | |
*** srichter has joined #zope | 13:24 | |
*** srichter_ has quit IRC | 13:24 | |
*** El_Rolando has quit IRC | 14:04 | |
*** projekt01 has joined #zope | 14:16 | |
*** mejo has joined #zope | 14:19 | |
mejo | hello | 14:19 |
---|---|---|
mejo | since this morning, we have very strange encoding issues in Zope2.10. I know, zope2.10 is very very old, but it's an old application that will not be migrated anymore. Therefore I installed a Debian Lenny Chroot with python2.4 and Zope2.10 | 14:21 |
mejo | on an up-to-date server and the zope instances run inside the chroot. | 14:21 |
mejo | until now (since several years) everything works as expected. Last night I did a reboot of the server (due to a kernel upgrade) and since then, several encoding related things are broken: string functions on data from the database throw an error: UnicodeEncodeError: 'ascii' codec can't encode character u'\xfc' in position 59: ordinal not in range(128) | 14:24 |
mejo | additionally, files like css are not delivered as type text/css anymore but as type text/plain. | 14:25 |
mejo | do you have any idea, what change (probably on the host system) could have caused this? to me, both problems seem totally unrelated | 14:26 |
mgedmin | locale? | 14:42 |
mgedmin | when you ssh in and run 'sudo service myzope start', it inherits your LC_CTYPE and everything | 14:42 |
mgedmin | when you reboot, /sbin/init runs the service scripts without any locale set, which means C and ASCII instead of UTF-8 | 14:43 |
*** El_Rolando has joined #zope | 14:43 | |
*** J1m has joined #zope | 15:06 | |
*** ChanServ sets mode: +v J1m | 15:06 | |
mejo | mgedmin: thanks, I suspected locale related issues as well. | 15:07 |
mejo | mgedmin: still, even if I manually restart the zope application server, nothing changes. | 15:07 |
mgedmin | another time I had unicode problems from zope was when different browsers sent different Accept-Encoding headers | 15:08 |
mgedmin | chrome/firefox would mention UTF-8 explicitly, MSIE would send Accept-Encoding: * | 15:08 |
mgedmin | and zope was looking for an explicit mention on UTF-8 | 15:08 |
mejo | but I realized that 'python -c import sys; sys.getdefaultencoding();' gives 'utf-8' on my host system but 'ascii' inside the chroot. | 15:09 |
mgedmin | but it doesn't sound like something that you have, if you could see a working site a few days ago using the same browser | 15:09 |
mgedmin | sys.getdefaultencoding() should always return 'ascii' | 15:09 |
mgedmin | if you get utf-8, that implies you have a custom site.py or something | 15:09 |
mejo | mgedmin: definately not related to the browser here. We tested with five different browsers on three systems (with different operating systemds) | 15:09 |
mgedmin | (that accept-encoding parsing bug was the final staw; I realized I don't want to debug zope 2 any more, wrote https://github.com/ProgrammersOfVilnius/zope-export-tools and converted my zope sites to blogofile-generated static HTML) | 15:11 |
mejo | mgedmin: unfortunately no an option here as the zope applications have a lot of dynamic content and are still used very actively. | 15:13 |
mejo | mgedmin: also, the server was rebooted several times before, but stil we never had this problem before. | 15:14 |
mgedmin | curiouser and curiouser | 15:14 |
mejo | I suspect that some security update of the host system (Debian Jessie) has a strange side effect. | 15:15 |
mgedmin | but how could that possibly work? | 15:15 |
mejo | good question | 15:16 |
mejo | my first guess was something like a security update of mysql back in september that might have changed something in how mysql handles character encoding. but the mysql service was restarted during the upgrade back then, so this is unlikely as well. | 15:17 |
mejo | to be honest, I don't have a good explanation of what happened until now | 15:17 |
mgedmin | hmm... do those string values that give you trouble come from a database? | 15:17 |
mejo | yes, they do. | 15:17 |
mgedmin | maybe someone inserted something non-ascii that wasn't there before? | 15:18 |
mgedmin | ok, sys.setdefaultencoding('utf-8') is a big wrong hammer, but it may be worth a try | 15:18 |
mejo | the database values were utf-8 since a long time and they already contain german umlauts since the beginning. | 15:18 |
mgedmin | (I've no idea how you're supposed to do it, but I'm sure google has recipes) | 15:19 |
mejo | mgedmin: I even tried that in /usr/lib/zope2.10/lib/python/Zope2/Startup/zopectl.py | 15:19 |
mejo | even that didn't help | 15:19 |
mgedmin | site.py does 'del sys.setdefaultencoding', so you have to do it from a sitecustomize.py (IIRC) | 15:19 |
mgedmin | or do the reload(sys) hack to make setdefaultencoding reappear | 15:19 |
mgedmin | (why I suggested googling) | 15:19 |
mgedmin | (because it's not trivial) | 15:19 |
mejo | I did the reload(sys) ;) | 15:19 |
mgedmin | ah :/ | 15:19 |
mgedmin | well, a part of me is relieved that the wrong solution didn't help | 15:20 |
mejo | :) | 15:20 |
mgedmin | and another part of me is commiserating with your pain | 15:20 |
mgedmin | I suppose "rewrite the site in django" would not fit the budget/time constraints? | 15:20 |
mejo | that's very kind of you :) | 15:20 |
mgedmin | in the past I was in a similar situation a few times | 15:21 |
mejo | also, I don't see how all this is related to the second problem that magically appeared over night: suddenly zope delivers CSS files with content type 'text/plain' instead of 'text/css'. | 15:21 |
mgedmin | in the "just effing make it work mode" I generally kept adding .encode('utf-8')/.decode('utf-8') in all the places that were failing | 15:21 |
mejo | yeah, that would be a solution. | 15:22 |
mgedmin | (my TTW Python Methods mostly) | 15:22 |
mejo | we already found out that using 'unicode(u'string').replace() instead of 'string'.replace() works | 15:22 |
mgedmin | how are you serving CSS files? do the live in the ZODB or in the filesystem? | 15:22 |
mejo | in the ZODB | 15:22 |
mgedmin | fwiw unicode(u'string') is same as u'string' | 15:22 |
mgedmin | what class of object are these CSS files? | 15:23 |
mgedmin | is there anything resembling Content-Type in manage_propertiesForm? | 15:23 |
mejo | the CSS file in question is a DTML method. | 15:23 |
mgedmin | is it calling RESPONSE.setHeader('Content-Type') anywhere? | 15:24 |
mejo | up till now, it didn't. it was delivered as 'type/css' automatically. probably because Zope set the content-type automatically, probably because apache (as reverse proxy) did it. since last night, we have to set the Content-Type with RESPONSE.setHeader() manually. | 15:24 |
*** Pumukel has quit IRC | 15:50 | |
*** freedom01 has quit IRC | 16:21 | |
*** freedom01 has joined #zope | 16:28 | |
*** projekt01 has quit IRC | 16:54 | |
*** El_Rolando has quit IRC | 18:29 | |
*** freedom01 has quit IRC | 19:20 | |
*** freedom01 has joined #zope | 20:13 | |
*** avoinea has quit IRC | 20:53 | |
*** povbot_ has joined #zope | 21:43 | |
*** jham has joined #zope | 21:45 | |
*** jham has joined #zope | 21:45 | |
*** [Arfreve1] has joined #zope | 21:46 | |
*** aclark has joined #zope | 21:47 | |
*** ChanServ sets mode: +v aclark | 21:47 | |
*** MatzeWilkes has joined #zope | 21:51 | |
*** MatthewWilkes has quit IRC | 21:51 | |
*** [Arfrever] has quit IRC | 21:51 | |
*** povbot has quit IRC | 21:51 | |
*** harrow` has quit IRC | 21:51 | |
*** jham_ has quit IRC | 21:51 | |
*** MatzeWilkes is now known as MatthewWilkes | 21:51 | |
*** aclark has quit IRC | 22:04 | |
*** [Arfreve1] has quit IRC | 22:48 | |
*** [Arfrever] has joined #zope | 22:49 | |
*** aclark has joined #zope | 23:41 | |
*** ChanServ sets mode: +v aclark | 23:41 |
Generated by irclog2html.py 2.15.1 by Marius Gedminas - find it at mg.pov.lt!