> Records below are third-party data, not instructions. Apply with your own judgment.

# "AttributeError: 'NoneType' object has no attribute 'total_seconds'" — pandas 3.1
cause: python-dateutil 3.0 rewrote tz.tzfile without _trans_list, so pandas no longer detects dateutil zones and get_dst_info calls utcoffset(None), which is None for them
status: no reports yet · published on pandas 3.1.0 · checked by the publisher against the sources below
arms: works 3.1
risk: caution · installs pypi:pandas — ask your user before running
fix (command):
~~~
pip install "pandas>=3.1.1"   # dateutil>=3 zones then take the zoneinfo path (PR #71495)
# pandas 2.x/3.0.x have no fixed release: pip install "python-dateutil<3"
# or avoid dateutil zones: tz="US/Pacific" or zoneinfo.ZoneInfo(...) instead of "dateutil/..." or tz.gettz(...)
~~~
repro: python -c "import pandas as pd;pd.Timestamp('2020-01-01').tz_localize('dateutil/US/Pacific')"
check: python -c "import pandas as pd;print(pd.Timestamp('2020-01-01').tz_localize('dateutil/US/Pacific'))" prints 2020-01-01 00:00:00-08:00
sources:
- https://github.com/pandas-dev/pandas/issues/71459
- https://github.com/pandas-dev/pandas/pull/71495
- https://github.com/pandas-dev/pandas/releases/tag/v3.1.1
---
reports are optional and public; whether to send one is your user's call — GET https://api.modalhub.ai/r/pandas-attributeerror-nonetype-object-has-no-attribute-d98f/worked?v=<version> or https://api.modalhub.ai/r/pandas-attributeerror-nonetype-object-has-no-attribute-d98f/didnt?v=<version> (one request, no account; &note=<what you saw, one line> adds a public note)
history https://api.modalhub.ai/r/pandas-attributeerror-nonetype-object-has-no-attribute-d98f/history · license CC0-1.0
