[pypy-issue] Issue #2632: dateutil: tz.tzwinlocal from datetime not working with pypy (pypy/pypy)

Frank Odignal issues-reply at bitbucket.org
Mon Aug 14 16:30:44 EDT 2017

New issue 2632: dateutil: tz.tzwinlocal from datetime not working with pypy

Frank Odignal:

When I try to use tz.tzwinlocal from datetime, I get the following error:

Python 2.7.13 (c925e7381036, Jun 06 2017, 05:28:16)
[PyPy 5.8.0 with MSC v.1500 32 bit] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>>> from dateutil import tz
>>>> x = tz.tzwinlocal()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "c:\pypy2-v5.8.0-win32\site-packages\dateutil\tz\win.py", line 241, in __init__
    keydict = valuestodict(tzlocalkey)
  File "c:\pypy2-v5.8.0-win32\site-packages\dateutil\tz\win.py", line 330, in valuestodict
    value = tz_res.name_from_string(value)
  File "c:\pypy2-v5.8.0-win32\site-packages\dateutil\tz\win.py", line 113, in name_from_string
    return self.load_name(offset)
  File "c:\pypy2-v5.8.0-win32\site-packages\dateutil\tz\win.py", line 82, in load_name
    nchar = self.LoadStringW(self._tzres._handle, offset, lpBuffer, 0)
  File "c:\pypy2-v5.8.0-win32\lib_pypy\_ctypes\function.py", line 349, in __call__
    self._convert_args(argtypes, args, kwargs))
  File "c:\pypy2-v5.8.0-win32\lib_pypy\_ctypes\function.py", line 577, in _convert_args
    raise ArgumentError(str(e))
ArgumentError: expected c_void_p instance instead of alt.WinDLL
Above code works fine with a standard Python 2.7.13 installation (Python 2.7.13 (v2.7.13:a06454b1afa1, Dec 17 2016, 20:42:59) [MSC v.1500 32 bit (Intel)] on win32).
My machine runs Windows Server 2008 R2 64-bit.

More information about the pypy-issue mailing list