censor/Censor
1
37
Fork
You've already forked Censor
3

fix: allow repeated saving to same file path #92

Merged
mahlzahn merged 1 commit from mahlzahn/fix_repeated_saving into main 2026年02月27日 20:38:28 +01:00 AGit

Saving repeatedly to the same file path overwriting an existing file
failed due to PyMuPDF raising a ValueError

Traceback (most recent call last):
 File "/app/share/censor/censor/window.py", line 237, in on_save_response
 self.save_file(file)
 ~~~~~~~~~~~~~~^^^^^^
 File "/app/share/censor/censor/window.py", line 241, in save_file
 self.document.save(file.get_path())
 ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
 File "/app/share/censor/censor/document.py", line 123, in save
 mupdf_document.save(path)
 ~~~~~~~~~~~~~~~~~~~^^^^^^
 File "/app/lib/python3.13/site-packages/pymupdf/__init__.py", line 6511, in save
 raise ValueError("save to original must be incremental")
ValueError: save to original must be incremental

Closes: #78
Closes #90

Saving repeatedly to the same file path overwriting an existing file failed due to PyMuPDF raising a ValueError ``` Traceback (most recent call last): File "/app/share/censor/censor/window.py", line 237, in on_save_response self.save_file(file) ~~~~~~~~~~~~~~^^^^^^ File "/app/share/censor/censor/window.py", line 241, in save_file self.document.save(file.get_path()) ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^ File "/app/share/censor/censor/document.py", line 123, in save mupdf_document.save(path) ~~~~~~~~~~~~~~~~~~~^^^^^^ File "/app/lib/python3.13/site-packages/pymupdf/__init__.py", line 6511, in save raise ValueError("save to original must be incremental") ValueError: save to original must be incremental ``` Closes: #78 Closes #90
fix: allow repeated saving to same file path
All checks were successful
/ build-start (pull_request_target) Successful in 12s
/ checks (pull_request) Successful in 23s
/ merge-conditions (pull_request) Successful in 8s
/ release-publish (pull_request_target) Has been skipped
7ae4bc0d56
Saving repeatedly to the same file path overwriting an existing file
failed due to PyMuPDF raising a ValueError
```
Traceback (most recent call last):
 File "/app/share/censor/censor/window.py", line 237, in on_save_response
 self.save_file(file)
 ~~~~~~~~~~~~~~^^^^^^
 File "/app/share/censor/censor/window.py", line 241, in save_file
 self.document.save(file.get_path())
 ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
 File "/app/share/censor/censor/document.py", line 123, in save
 mupdf_document.save(path)
 ~~~~~~~~~~~~~~~~~~~^^^^^^
 File "/app/lib/python3.13/site-packages/pymupdf/__init__.py", line 6511, in save
 raise ValueError("save to original must be incremental")
ValueError: save to original must be incremental
```
Closes: #78
Closes #90 
mahlzahn added this to the v0.4.0 milestone 2026年02月27日 15:24:37 +01:00
censor-bot left a comment
Copy link

Note

The build job for 7ae4bc0d56 finished with status success. Install and test the build with:

curl https://gitlab.gnome.org/mahlzahn/censor-ci/-/jobs/6212525/artifacts/raw/censor-dev.flatpak -o censor-dev.flatpak
flatpak install --user censor-dev.flatpak
flatpak run --user page.codeberg.censor.Censor.Devel
> **Note** > The [build job](https://gitlab.gnome.org/mahlzahn/censor-ci/-/jobs/6212525) for 7ae4bc0d569ce3f0100f26cfe27e4220ddec05c6 finished with status **success**. Install and test the build with: > > curl https://gitlab.gnome.org/mahlzahn/censor-ci/-/jobs/6212525/artifacts/raw/censor-dev.flatpak -o censor-dev.flatpak > flatpak install --user censor-dev.flatpak > flatpak run --user page.codeberg.censor.Censor.Devel
Contributor
Copy link

@mahlzahn: downloaded as instructed on x86_64. Perfect!
Errors gone.

@mahlzahn: downloaded as instructed on x86_64. Perfect! Errors gone.
Author
Owner
Copy link

@martin762green wrote in #92 (comment):

@mahlzahn: downloaded as instructed on x86_64. Perfect! Errors gone.

Thanks for testing!

@martin762green wrote in https://codeberg.org/censor/Censor/pulls/92#issuecomment-11061449: > @mahlzahn: downloaded as instructed on x86_64. Perfect! Errors gone. Thanks for testing!
Sign in to join this conversation.
No reviewers
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
censor/Censor!92
Reference in a new issue
censor/Censor
No description provided.
Delete branch "mahlzahn/fix_repeated_saving"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?