[Zope-dev] re: DateTime stftime and TAI based timezone is broken or is it?
I think adding right/EST5EDT tzfile info to DateTimeZone.py might solve my problem. Can someone email me the .py script used to create the DateTimeZone.py file? -- Brad Clements,[EMAIL PROTECTED] (315)268-1000 http://www.murkworks.com (315)268-9812 Fax http://www.wecanstopspam.org/ AOL-IM: BKClements ___ Zope-Dev maillist - [EMAIL PROTECTED] http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
[Zope-dev] DateTime stftime and TAI based timezone is broken or is it?
Yesterday I switched my Linux machines to use clockspeed 0.62 and therefore had to switch to the right/EST5EDT timezone. Today my client calls rather upset that lots of data has disappeared from his database, etc.. So while I have found and fixed a bunch of timezone conversion problems in my code, I'm stumped by DateTime.strftime(). I'm working with Zope 2.6.0 but the code is the same in 2.7.0b2 Basically, I get this situation: >>> dx '2003-12-01 00:00:00' >>> y = DateTime.DateTime(dx) >>> y DateTime('2003/12/01') >>> y.strftime("%a %b. %d") 'Sun Nov. 30' >>> y.strftime("%a %b %d %H:%M:%S") 'Sun Nov 30 23:59:38' >>> y.Time() '00:00:00' So, the DateTime object knows the correct year, month and day, it's mishandling of 'diff' in strftime is a problem. I can't quite figure out what the regex does in the code below, but diff is 22 seconds off from the "regular timezone offset". That's will be lost in the divide by 36. The timezone offset that _tzoffset calculates is wrong: >>> DateTime._tzoffset(y._tz, y._t) -18000 Because >>> y._tz 'US/Eastern' (but it should be 'right/EST5EDT') What's the best way for me to fix this? I'll submit a patch if I can get a clue. Btw, the timezone right/EST5EDT isn't in DateTime's timezone listing. Shouldn't Zope get this data from Python? I'll remark that Python doesn't know about the 'correct' offset either. >>> import time >>> time.tzname ('EST', 'EDT') >>> time.timezone 18000 Well now I'm stuck, I've set /etc/localtime and /usr/share/zoneinfo/posixrules correctly, and "date" returns the correct time. However even forcing TZ with Python 2.3 doesn't work correctly. sh-2.05b$ TZ="right/EST5EDT" python2.3 Python 2.3.2 (#2, Nov 6 2003, 10:44:39) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import os >>> os.environ['TZ'] 'right/EST5EDT' >>> import time >>> time.timezone 18000 >>> time.tzname ('EST', 'EDT') >>> time.tzset() >>> time.tzname ('EST', 'EDT') >>> time.timezone 18000 How does time.localtime() know the correct timezone offset, but time.timezone is not correct? >>> time.localtime(); os.system('date') (2003, 12, 1, 12, 55, 25, 0, 335, 0) Mon Dec 1 12:55:25 EST 2003 - DateTime.py def strftime(self, format): # Format the date/time using the *current timezone representation*. diff = _tzoffset(self._tz, self._t) format = re.sub('(^\|[^%])%z', '\\1%+05d' % (diff / 36), format) return strftime(format, safegmtime(self.timeTime() + diff)) -- Brad Clements,[EMAIL PROTECTED] (315)268-1000 http://www.murkworks.com (315)268-9812 Fax http://www.wecanstopspam.org/ AOL-IM: BKClements ___ Zope-Dev maillist - [EMAIL PROTECTED] http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] New-style ExtensionClass
Dieter Maurer schrieb: Jim Fulton wrote at 2003-10-20 11:55 -0400: > ... > Speaking of Zope 2.8, Jeremy Hylton has suggested that, perhaps, Zope 2.8 > should be a release that provides *only*: > > - New-style ExtensionClass, and > > - ZODB 3.3, featuring multi-version concurrency control, > > plus any features that have been added to the head since the Zope 2.7 > branch was created. > > This idea is pretty appealing to me. I wonder what others think of it. +1 +10 Tino ___ Zope-Dev maillist - [EMAIL PROTECTED] http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
[Zope-dev] Re: Heads up: about to merge new-style ExtensionClass and ZODB 3.3 into Zope 2 head
Hi Jim! Jim Fulton wrote: I tested CMF with Zope HEAD. 1.) "from ZODB import Persistent, PersistentMapping" doesn't work anymore 2.) assignment to class dictionaries doesn't work anymore These two are now fixed in CMF HEAD. So whoever wants to have a look at the other issues: Tests and Zope are running again with CMF installed. 3.) 'rebinding by assignment' doesn't work anymore [...] This is consistent with standard Python behavior: [...] So I'm inclined to consider the new behavior correct. Correct or not: This is a backwards compatibility issue. I also found this one: http://localhost:8080/Control_Panel/Database/main/manage_main unbound method db_name() must be called with ApplicationManager instance as first argument (got nothing instead) You already didn't switch to the new mro to make migration easier. If it is possible to give newstyle ExtensionClasses the old rebinding behavior I'd vote for that. If not, people need some advice how to update their products: - How do I find code depending on the old behavior? - How do I fix that code? (I know I can copy 'n' paste the code I want to reuse from other classes, but is there a better way to reuse code without subclassing?) 4.) some objects publishable in Zope 2.7 aren't publishable anymore Can you give any specifics? Zope Core: http://localhost:8080/temp_folder http://localhost:8080/Control_Panel/DavLocks CMF: http://localhost:8080/myCMFSite/portal_skins/zpt_generic http://localhost:8080/myCMFSite/portal_workflow/default_workflow No big deal to add docstrings, but what's the policy change? For better or worse, it has always been policy not to publish objects without non-empty doc strings. That's what I thought. But it seems like Zope 2.7 doesn't catch them all. Cheers, Yuppie ___ Zope-Dev maillist - [EMAIL PROTECTED] http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )