eb96e43252
That python bug cause problems when libreoffice is on a read-only media... which is very common for Mac as the dmg used to package the produce is seens as a read only volume. This patch the bug 15833 for MacOSX only since that is the platform that is most likely to be impacted, and because of bug 15431 that make patching on Windows more complex/dangerous. Change-Id: Ie7406c1c75748d38c871b3b544560caa62e9d838 Reviewed-on: https://gerrit.libreoffice.org/1934 Reviewed-by: Norbert Thiebaud <nthiebaud@gmail.com> Tested-by: Norbert Thiebaud <nthiebaud@gmail.com>
25 lines
1.2 KiB
Groff
25 lines
1.2 KiB
Groff
iff --git a/Lib/importlib/_bootstrap.py b/Lib/importlib/_bootstrap.py
|
|
--- a/Lib/importlib/_bootstrap.py
|
|
+++ b/Lib/importlib/_bootstrap.py
|
|
@@ -1066,17 +1066,17 @@ class SourceFileLoader(FileLoader, Sourc
|
|
except FileExistsError:
|
|
# Probably another Python process already created the dir.
|
|
continue
|
|
- except PermissionError:
|
|
- # If can't get proper access, then just forget about writing
|
|
- # the data.
|
|
+ except OSError as exc:
|
|
+ # Could be a permission error, read-only filesystem: just forget
|
|
+ # about writing the data.
|
|
+ _verbose_message('could not create {!r}: {!r}', parent, exc)
|
|
return
|
|
try:
|
|
_write_atomic(path, data, _mode)
|
|
_verbose_message('created {!r}', path)
|
|
- except (PermissionError, FileExistsError):
|
|
- # Don't worry if you can't write bytecode or someone is writing
|
|
- # it at the same time.
|
|
- pass
|
|
+ except OSError as exc:
|
|
+ # Same as above: just don't write the bytecode.
|
|
+ _verbose_message('could not create {!r}: {!r}', path, exc)
|