sdispater / pendulum

Python datetimes made easy
https://pendulum.eustace.io
MIT License
6.12k stars 372 forks source link

local_timezone: gracefully handle retrieval errors on Darwin #792

Open tpwrules opened 6 months ago

tpwrules commented 6 months ago

In some sandbox environments, the program may not have permission to access /etc/localtime or it may not exist.

Catch any exceptions accessing and parsing its value and return UTC by default to avoid crashing the program.

Pull Request Check List

codspeed-hq[bot] commented 5 months ago

CodSpeed Performance Report

Merging #792 will not alter performance

Comparing tpwrules:darwin-error-handling (a4d98ce) with master (3e3fec6)

Summary

✅ 1 untouched benchmarks

tpwrules commented 5 months ago

Fixed formatting.