jkdaza / gae-pytz Goto Github PK
View Code? Open in Web Editor NEWAutomatically exported from code.google.com/p/gae-pytz
License: MIT License
Automatically exported from code.google.com/p/gae-pytz
License: MIT License
To reproduce:
$ python
Python 2.5.1 (r251:54863, Jun 17 2009, 20:37:34)
[GCC 4.0.1 (Apple Inc. build 5465)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from pytz.gae import pytz
>>> pytz.timezone('Europe/Amsterdam')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "pytz/__init__.py", line 171, in timezone
_tzinfo_cache[zone] = build_tzinfo(zone, open_resource(zone))
File "pytz/__init__.py", line 86, in open_resource
return loader.open_resource(name)
File "pytz/gae.py", line 69, in open_resource
zonedata = memcache.get(cache_key)
TypeError: unbound method get() must be called with memcache instance as first
argument (got str instance instead)
Expected output is:
>>> pytz.timezone('Europe/Amsterdam')
<DstTzInfo 'Europe/Amsterdam' AMT+0:20:00 STD>
The fix is at the top of pytz/gae.py, to add in @classmethod in two places:
try:
from google.appengine.api import memcache
except ImportError:
# This means that we're not running under the SDK, likely a script
class memcache(object):
@classmethod
def add(*args, **kwargs):
pass
@classmethod
def get(*args, **kwargs):
return None
Original issue reported on code.google.com by [email protected]
on 17 Sep 2010 at 6:12
While implementing i18n and timezone in the project I am working at
(JobTracker), my solution was to fetch (and cache) at:
http://json-time.appspot.com/
which implements the complete pytz returning in json format.
Reference:
http://code.google.com/p/jobtracker/
(modules.queries.get_tz_utc_offset)
BR,
Original issue reported on code.google.com by [email protected]
on 1 Mar 2010 at 2:16
on windows, gae-pytz can't read zipped zoneinfo.
Original issue reported on code.google.com by surgo.jp
on 14 Mar 2010 at 11:11
Attachments:
Currently the caching is done per timezone, and ends up in around ~500
``memcache.get()`` queries, which slows down performance a lot.
I would propose caching all timezone info in one memcache record.
Original issue reported on code.google.com by [email protected]
on 9 Jan 2013 at 7:27
When calling "appcfg update_cron", the cron update fails when a timezone is
used in cron.yaml:
$ bin/appcfg update_cron app
Application: ******
Host: appengine.google.com
Error parsing yaml file:
Unable to assign value 'Europe/Berlin' to attribute 'timezone':
timezone 'Europe/Berlin' is unknown
in "app/cron.yaml", line 5, column 13
This error seems to be thrown at
google_appengine/google/appengine/api/croninfo.py:91
in the app engine SDK 1.5.1
I'm using gaepytz-2011h.
Original issue reported on code.google.com by [email protected]
on 20 Jul 2011 at 12:19
I'm trying to load gae-pytz with the following command:
from pytz.gae import pytz
When that happens I get the following import error below. Is this a setuptools
issue? Any ideas?
ERROR:root:
Traceback (most recent call last):
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\runtime\wsgi.py", line 193, in Handle
result = handler(self._environ, self._StartResponse)
File "C:\Users\speedplane\Documents\Work\2010 - 2011\Programs\DocketUpdater\django\contrib\staticfiles\handlers.py", l
ine 68, in __call__
return self.application(environ, start_response)
File "C:\Users\speedplane\Documents\Work\2010 - 2011\Programs\DocketUpdater\django\core\handlers\wsgi.py", line 250, i
n __call__
self.load_middleware()
File "C:\Users\speedplane\Documents\Work\2010 - 2011\Programs\DocketUpdater\django\core\handlers\base.py", line 45, in
load_middleware
mod = import_module(mw_module)
File "C:\Users\speedplane\Documents\Work\2010 - 2011\Programs\DocketUpdater\django\utils\importlib.py", line 35, in im
port_module
__import__(name)
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\dev_appserver_import_hook.py", line 676, i
n Decorate
return func(self, *args, **kwargs)
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\dev_appserver_import_hook.py", line 1845,
in load_module
return self.FindAndLoadModule(submodule, fullname, search_path)
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\dev_appserver_import_hook.py", line 676, i
n Decorate
return func(self, *args, **kwargs)
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\dev_appserver_import_hook.py", line 1717,
in FindAndLoadModule
description)
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\dev_appserver_import_hook.py", line 676, i
n Decorate
return func(self, *args, **kwargs)
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\dev_appserver_import_hook.py", line 1660,
in LoadModuleRestricted
description)
File "C:\Users\speedplane\Documents\Work\2010 - 2011\Programs\DocketUpdater\autoload\middleware.py", line 8, in <modul
e>
import_module('%s.models' % (app))
File "C:\Users\speedplane\Documents\Work\2010 - 2011\Programs\DocketUpdater\django\utils\importlib.py", line 35, in im
port_module
__import__(name)
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\dev_appserver_import_hook.py", line 676, i
n Decorate
return func(self, *args, **kwargs)
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\dev_appserver_import_hook.py", line 1845,
in load_module
return self.FindAndLoadModule(submodule, fullname, search_path)
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\dev_appserver_import_hook.py", line 676, i
n Decorate
return func(self, *args, **kwargs)
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\dev_appserver_import_hook.py", line 1717,
in FindAndLoadModule
description)
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\dev_appserver_import_hook.py", line 676, i
n Decorate
return func(self, *args, **kwargs)
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\dev_appserver_import_hook.py", line 1660,
in LoadModuleRestricted
description)
File "C:\Users\speedplane\Documents\Work\2010 - 2011\Programs\DocketUpdater\updater\models.py", line 4, in <module>
from pytz.gae import pytz
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\dev_appserver_import_hook.py", line 676, i
n Decorate
return func(self, *args, **kwargs)
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\dev_appserver_import_hook.py", line 1845,
in load_module
return self.FindAndLoadModule(submodule, fullname, search_path)
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\dev_appserver_import_hook.py", line 676, i
n Decorate
return func(self, *args, **kwargs)
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\dev_appserver_import_hook.py", line 1717,
in FindAndLoadModule
description)
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\dev_appserver_import_hook.py", line 676, i
n Decorate
return func(self, *args, **kwargs)
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\dev_appserver_import_hook.py", line 1660,
in LoadModuleRestricted
description)
File "C:\Users\speedplane\Documents\Work\2010 - 2011\Programs\DocketUpdater\libs\pytz\__init__.py", line 34, in <modul
e>
from pkg_resources import resource_stream
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\dev_appserver_import_hook.py", line 676, i
n Decorate
return func(self, *args, **kwargs)
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\dev_appserver_import_hook.py", line 1845,
in load_module
return self.FindAndLoadModule(submodule, fullname, search_path)
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\dev_appserver_import_hook.py", line 676, i
n Decorate
return func(self, *args, **kwargs)
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\dev_appserver_import_hook.py", line 1717,
in FindAndLoadModule
description)
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\dev_appserver_import_hook.py", line 676, i
n Decorate
return func(self, *args, **kwargs)
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\dev_appserver_import_hook.py", line 1642,
in LoadModuleRestricted
return source_file.load_module(submodule_fullname)
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\dist\py_zipimport.py", line 246, in load_module
submodname, is_package, fullpath, source = self._get_source(fullmodname)
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\dist\py_zipimport.py", line 207, in _get_source
source = self.zipfile.read(relpath.replace(os.sep, '/'))
File "C:\Python27\lib\zipfile.py", line 867, in read
return self.open(name, "r", pwd).read()
File "C:\Python27\lib\zipfile.py", line 882, in open
zef_file = open(self.filename, 'rb')
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\dev_appserver_import_hook.py", line 592, i
n __init__
raise IOError(errno.EACCES, 'file not accessible', filename)
IOError: [Errno 13] file not accessible:
'C:\\Python27\\lib\\site-packages\\setuptools-0.6c11-py2.7.egg'
INFO:root:"GET /invoice/ HTTP/1.1" 500 -
ERROR:root:
Traceback (most recent call last):
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\runtime\wsgi.py", line 193, in Handle
result = handler(self._environ, self._StartResponse)
File "C:\Users\speedplane\Documents\Work\2010 - 2011\Programs\DocketUpdater\django\contrib\staticfiles\handlers.py", l
ine 68, in __call__
return self.application(environ, start_response)
File "C:\Users\speedplane\Documents\Work\2010 - 2011\Programs\DocketUpdater\django\core\handlers\wsgi.py", line 250, i
n __call__
self.load_middleware()
File "C:\Users\speedplane\Documents\Work\2010 - 2011\Programs\DocketUpdater\django\core\handlers\base.py", line 45, in
load_middleware
mod = import_module(mw_module)
File "C:\Users\speedplane\Documents\Work\2010 - 2011\Programs\DocketUpdater\django\utils\importlib.py", line 35, in im
port_module
__import__(name)
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\dev_appserver_import_hook.py", line 676, i
n Decorate
return func(self, *args, **kwargs)
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\dev_appserver_import_hook.py", line 1845,
in load_module
return self.FindAndLoadModule(submodule, fullname, search_path)
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\dev_appserver_import_hook.py", line 676, i
n Decorate
return func(self, *args, **kwargs)
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\dev_appserver_import_hook.py", line 1717,
in FindAndLoadModule
description)
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\dev_appserver_import_hook.py", line 676, i
n Decorate
return func(self, *args, **kwargs)
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\dev_appserver_import_hook.py", line 1660,
in LoadModuleRestricted
description)
File "C:\Users\speedplane\Documents\Work\2010 - 2011\Programs\DocketUpdater\autoload\middleware.py", line 8, in <modul
e>
import_module('%s.models' % (app))
File "C:\Users\speedplane\Documents\Work\2010 - 2011\Programs\DocketUpdater\django\utils\importlib.py", line 35, in im
port_module
__import__(name)
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\dev_appserver_import_hook.py", line 676, i
n Decorate
return func(self, *args, **kwargs)
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\dev_appserver_import_hook.py", line 1845,
in load_module
return self.FindAndLoadModule(submodule, fullname, search_path)
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\dev_appserver_import_hook.py", line 676, i
n Decorate
return func(self, *args, **kwargs)
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\dev_appserver_import_hook.py", line 1717,
in FindAndLoadModule
description)
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\dev_appserver_import_hook.py", line 676, i
n Decorate
return func(self, *args, **kwargs)
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\dev_appserver_import_hook.py", line 1660,
in LoadModuleRestricted
description)
File "C:\Users\speedplane\Documents\Work\2010 - 2011\Programs\DocketUpdater\updater\models.py", line 4, in <module>
from pytz.gae import pytz
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\dev_appserver_import_hook.py", line 676, i
n Decorate
return func(self, *args, **kwargs)
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\dev_appserver_import_hook.py", line 1845,
in load_module
return self.FindAndLoadModule(submodule, fullname, search_path)
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\dev_appserver_import_hook.py", line 676, i
n Decorate
return func(self, *args, **kwargs)
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\dev_appserver_import_hook.py", line 1717,
in FindAndLoadModule
description)
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\dev_appserver_import_hook.py", line 676, i
n Decorate
return func(self, *args, **kwargs)
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\dev_appserver_import_hook.py", line 1660,
in LoadModuleRestricted
description)
File "C:\Users\speedplane\Documents\Work\2010 - 2011\Programs\DocketUpdater\libs\pytz\__init__.py", line 34, in <modul
e>
from pkg_resources import resource_stream
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\dev_appserver_import_hook.py", line 676, i
n Decorate
return func(self, *args, **kwargs)
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\dev_appserver_import_hook.py", line 1845,
in load_module
return self.FindAndLoadModule(submodule, fullname, search_path)
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\dev_appserver_import_hook.py", line 676, i
n Decorate
return func(self, *args, **kwargs)
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\dev_appserver_import_hook.py", line 1717,
in FindAndLoadModule
description)
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\dev_appserver_import_hook.py", line 676, i
n Decorate
return func(self, *args, **kwargs)
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\dev_appserver_import_hook.py", line 1642,
in LoadModuleRestricted
return source_file.load_module(submodule_fullname)
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\dist\py_zipimport.py", line 246, in load_module
submodname, is_package, fullpath, source = self._get_source(fullmodname)
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\dist\py_zipimport.py", line 207, in _get_source
source = self.zipfile.read(relpath.replace(os.sep, '/'))
File "C:\Python27\lib\zipfile.py", line 867, in read
return self.open(name, "r", pwd).read()
File "C:\Python27\lib\zipfile.py", line 882, in open
zef_file = open(self.filename, 'rb')
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\dev_appserver_import_hook.py", line 592, i
n __init__
raise IOError(errno.EACCES, 'file not accessible', filename)
IOError: [Errno 13] file not accessible:
'C:\\Python27\\lib\\site-packages\\setuptools-0.6c11-py2.7.egg'
INFO:root:"GET /invoice/ HTTP/1.1" 500 -
Original issue reported on code.google.com by [email protected]
on 3 Apr 2012 at 2:27
Could you update gae-pytz to include the 2012 timezones? Or would this be easy
to do? In that case, I maybe could do it myself.
Original issue reported on code.google.com by [email protected]
on 14 Mar 2012 at 9:29
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.