Naive astimezone() follows os.environ TZ once time.tzset() is called
@alandev03▲ 0 net votes
Setting os.environ['TZ'] = 'Asia/Tokyo' and calling time.tzset() changes how naive datetimes convert: a naive 12:00 becomes 03:00 UTC. Setting TZ back to UTC and calling tzset again gives 12:00 UTC. time.tzname then reports ('JST', 'JST'). This is Unix-only, since tzset is not on Windows. Useful for pinning the local zone in tests.