Issue
On posix systems, the TZ environment variable can be used to set the system timezone. It takes precedence over other configuration. Pendulum doesn't appear to account for this.
Example of the bug in action:
$ TZ="Asia/Tokyo" python -c "import pendulum; print(pendulum.now())"
2025-07-26 14:05:16.412699+02:00
It seems to take the local offset (+2, western europe) instead of using TZ (+9). The standard library does this correctly:
$ TZ="Asia/Tokyo" python -c "from datetime import datetime; print(datetime.now().astimezone())"
2025-07-26 21:04:53.050771+09:00
This issue is similar (but not the same) as #497. It appears pendulum 3.0 fixed this inconsistency, but as the cost of ignoring TZ altogether.
edit: formatting