Skip to content

release_date deserialization errors when upload-time metadata is missing #27

@barometz

Description

@barometz

Hi! I'm trying to get simple-repository-browser to work with Artifactory's PyPI repositories. Searching and loading projects works fine, but at some point the application tries to retrieve project info from its cache and I get

  File "/home/user/pybrow/.venv/lib/python3.11/site-packages/simple_repository_browser/controller.py", line 112, in search
    response = await self.model.project_query(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/user/pybrow/.venv/lib/python3.11/site-packages/simple_repository_browser/model.py", line 154, in project_query
    results = cursor.execute(sql_query, params).fetchall()
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/user/.local/share/uv/python/cpython-3.11.13-linux-x86_64-gnu/lib/python3.11/sqlite3/dbapi2.py", line 68, in convert_timestamp
    hours, minutes, seconds = map(int, timepart_full[0].split(b":"))
    ^^^^^^^^^^^^^^^^^^^^^^^
ValueError: invalid literal for int() with base 10: b'00+00'
2025-09-26 14:37:50,083 [uvicorn.access] INFO:     127.0.0.1:37454 - "GET /search?query=simple-repository-browser HTTP/1.1" 500 Internal Server Error

(full session logs at tz-stacktrace.txt)

The exception seems to be caused by an unexpected UTC offset in the release_date timestamp in projects.sqlite. When I open the cache, all the timestamps are 1970-01-01 00:00:00+00:00. As far as I can tell the upload_time attribute is never set, so the timestamp gets default-inserted in a way that includes the UTC offset, while normally the cache would use naive timestamps.

I'd like to work on this, but I'm having a hard time seeing where the upload-time is supposed to come from when not using the JSON format.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions