Skip to content

dl_docs crashes when timeline event title is null (AttributeError: NoneType has no attribute ‘startswith’) #301

@TomDabrowski

Description

@TomDabrowski

The dl_docs command crashes reproducibly when processing certain timeline events returned by the Trade Republic API.
Some events have a null title value. pytr assumes the title is always a string and calls .startswith() on it, which leads to an AttributeError.
Because of this crash, the sync process aborts and no CSV or JSON output files are generated.

To Reproduce
Steps to reproduce the behavior:
1. Run uvx pytr@latest login and complete the web login successfully
2. Run uvx pytr@latest dl_docs ~/Documents/TradeRepublic
3. Enter the 4 digit verification code when prompted
4. Observe that the process crashes during timeline detail processing

Expected behavior
dl_docs should handle timeline events with a null title gracefully.
The sync should complete successfully and generate the expected output files, even if some events do not contain a title.

Error log

Traceback (most recent call last):
AttributeError: ‘NoneType’ object has no attribute ‘startswith’

The crash occurs after logging a timeline entry similar to:
Amazon – None - 2026-01-06T10:06:36

Environment
• OS: macOS Tahoe 26.1 (Apple Silicon)
• pytr version: 0.4.5 (via uvx pytr@latest)
• Python version: 3.10.x (managed by uv)

Additional context
• The issue occurs consistently with a clean setup and no existing history files
• Login succeeds and timeline data is received before the crash
• The target directory only contains an empty pytr_history file after the failure
• This appears to be caused by a new or changed Trade Republic timeline event type where the title field can be null

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions