Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rework of the send_file exception handling #1822

Merged
merged 2 commits into from
Dec 11, 2024

Conversation

UlrichB22
Copy link
Collaborator

Related to #1820.

Comment on lines 144 to 146
file.seek(0, 2) # seek to EOF
try:
fsize = file.tell() # tell position
except Exception:
pass
fsize = file.tell() # tell position
file.seek(0, 0) # seek to start of file
Copy link
Member

Choose a reason for hiding this comment

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

if it succeeds with seek, fails with tell, it will not seek back to start of file.

but, it will log a warning AND CONTINUE PROCESSING (and malfunction, because it is at EOF position).

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Added a final seek.

Copy link
Member

@ThomasWaldmann ThomasWaldmann left a comment

Choose a reason for hiding this comment

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

LGTM.

@UlrichB22 UlrichB22 merged commit 267c839 into moinwiki:master Dec 11, 2024
6 checks passed
@UlrichB22 UlrichB22 deleted the send_file branch December 11, 2024 16:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants