asyrjasalo / RESTinstance

Robot Framework library for RESTful JSON APIs
https://pypi.org/project/RESTinstance
GNU Lesser General Public License v3.0
205 stars 84 forks source link

UnknownTimeZoneError: 'Can not find any timezone configuration' #74

Closed stdedos closed 5 years ago

stdedos commented 5 years ago

I am trying to do a simple GET URL from a robot testcase, however, I receive:

UnknownTimeZoneError: 'Can not find any timezone configuration'

(no other stacktrace, I don't know how to trigger this while running a Robot test)

Robot is executed in an Alpine Docker container

weichou1229 commented 5 years ago

I fixed this issue with https://wiki.alpinelinux.org/wiki/Setting_the_timezone I add these cmd lines and rebuild the docker image.

stdedos commented 5 years ago

I know how to add the timezone in the container.

I am wondering, why does the library need that 😕

weichou1229 commented 5 years ago

It will generate a timestamp include the local time:

        "timestamp": {
            "utc": "2019-06-13T05:58:05.702626+00:00",
            "local": "2019-06-13T13:58:05.702626+08:00"
        }

You can trace the code, it raises the error when get_localzone. https://github.com/asyrjasalo/RESTinstance/blob/6271807b9152d1f1462f1b6cc2bc94398c571697/src/REST/keywords.py#L1314 https://github.com/regebro/tzlocal/blob/master/tzlocal/unix.py#L157