From 2affa83efe280e5ec40045978d633986929daeb4 Mon Sep 17 00:00:00 2001 From: "James R. Barlow" Date: Wed, 29 Nov 2023 23:25:51 -0800 Subject: [PATCH] Remove code that attempted to manage xattrs out of output file Feature requested in issue #1179, but caused #1195. On further review, there is no platform independent way to manage extended attributes and it is not clear copying them through is necessarily the sensible thing to do. Closes #1179. --- src/ocrmypdf/_pipeline.py | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/ocrmypdf/_pipeline.py b/src/ocrmypdf/_pipeline.py index b8795548..0c293218 100644 --- a/src/ocrmypdf/_pipeline.py +++ b/src/ocrmypdf/_pipeline.py @@ -992,10 +992,3 @@ def copy_final( # get the appropriate umask, ownership, etc. with open(output_file, 'w+b') as output_stream: copyfileobj(input_stream, output_stream) - # Attempt to copy file attributes from input to output - if original_file: - with suppress(OSError): - # Copy original file's permissions, ownership, etc. if possible - copystat(original_file, output_file) - # Set output file's modification time to now - Path(output_file).touch(exist_ok=True)