Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions readthedocs/projects/tasks/builds.py
Original file line number Diff line number Diff line change
Expand Up @@ -668,6 +668,12 @@ def get_valid_artifact_types(self):
# Rename file as "<project_slug>-<version_slug>.<artifact_type>",
# which is the filename that Proxito serves for offline formats.
filename = list_dir[0]
if "." not in filename:
log.warning(
"Skipping artifact file without extension: %s",
filename,
)
continue
Copy link
Copy Markdown
Contributor

@agjohnson agjohnson Apr 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would probably be best to move away from string operations entirely. Pathlib already handles these filename operations -- ie:

Path(list_dir[0]).suffix

There isn't a strong case to skip the file, we just need to be careful about not throwing an exception parsing the file.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be good to get this in today for deploy -- @Bahtya if you have time could you push up the proposed fix, otherwise we should probably just apply the fix to the PR and merge.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to rush a fix here, this bug is really low impact and hard to trigger. It requires a project to output a single file without an file extension to the pdf/epub/htmlzip artifact path.

_, extension = filename.rsplit(".")
path = Path(artifact_directory) / filename
destination = Path(artifact_directory) / f"{self.data.project.slug}.{extension}"
Expand Down