Python(PyPy)times.to_universal()不';我不能在Alpine linux上工作

Python(PyPy)times.to_universal()不';我不能在Alpine linux上工作,python,time,alpine,pypy,Python,Time,Alpine,Pypy,我在Alpine linux容器中使用时间转换器时遇到问题,无论我指定的时区是什么,它都会导致相同的时间。与我的本地主机Ubuntu相比,结果是相同的时间版本的不同事件 两种系统上的时间==0.7 在Alpine Docker容器上,我安装了tzdata,并将时区正确地设置为CET以及localhost。它显示与date命令相同的日期/时间 alpine pypy:3.6-7-alpine3.9容器,root用户 Python 3.6.1 (de061d87e39c7df4e436974096d

我在Alpine linux容器中使用时间转换器时遇到问题,无论我指定的时区是什么,它都会导致相同的时间。与我的本地主机Ubuntu相比,结果是相同的
时间
版本的不同事件

两种系统上的
时间==0.7

在Alpine Docker容器上,我安装了
tzdata
,并将时区正确地设置为CET以及localhost。它显示与
date
命令相同的日期/时间

alpine pypy:3.6-7-alpine3.9容器,root用户

Python 3.6.1 (de061d87e39c7df4e436974096d7982c676a859d, Mar 25 2019, 18:43:49)
[PyPy 7.1.0-beta0 with GCC 8.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
And now for something completely different: ``I might, but nobody respects me''
>>>> import times
>>>> from datetime import datetime
>>>> times.to_universal(datetime(2017, 12, 24, 13, 50, 24, 124), 'CET')
datetime.datetime(2017, 12, 24, 13, 50, 24, 124)
>>>> times.to_universal(datetime(2017, 12, 24, 13, 50, 24, 124), 'Japan')
datetime.datetime(2017, 12, 24, 13, 50, 24, 124)
>>>> times.to_universal(datetime(2017, 12, 24, 13, 50, 24, 124))
    datetime.datetime(2017, 12, 24, 13, 50, 24, 124)
在本地主机Ubuntu20.04上,pypy3

Python 3.6.9 (7.3.2+dfsg-2~ppa1~ubuntu20.04, Sep 26 2020, 22:37:47)
[PyPy 7.3.2 with GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>> import times;from datetime import datetime
>>>> times.to_universal(datetime(2017, 12, 24, 13, 50, 24, 124), 'CET')
datetime.datetime(2017, 12, 24, 12, 50, 24, 124)
>>>> times.to_universal(datetime(2017, 12, 24, 13, 50, 24, 124), 'Japan')
datetime.datetime(2017, 12, 24, 4, 50, 24, 124)
>>>> times.to_universal(datetime(2017, 12, 24, 13, 50, 24, 124))
datetime.datetime(2017, 12, 24, 13, 50, 24, 124)
要复制的Dockerfile

FROM jamiehewland/alpine-pypy:3.6-7-alpine3.9
#FROM python:3.7.9-alpine3.11

ENV TZ CET

RUN apk update && apk upgrade \
    && apk add bash libxml2-dev libxslt-dev build-base tzdata \
    && ln -snf /usr/share/zoneinfo/$TZ /etc/localtime \
    && echo $TZ > /etc/timezone

RUN pip install --upgrade pip setuptools

RUN pip install times==0.7

有什么建议吗?

你对CPython而不是Pypy有相同的行为吗?是的,对python有相同的结果:3.7.9-alpine3.11。在这种情况下,我会在两台机器上使用
pdb
逐步遍历
times
模块的代码。这应该很快就能找到区别。你用CPython而不是Pypy得到相同的行为吗?是的,在python上得到相同的结果:3.7.9-alpine3.11。在这种情况下,我将使用
pdb
在两台机器上逐步遍历
times
模块的代码。这应该会很快发现区别。