diff --git a/trac/admin/web_ui.py b/trac/admin/web_ui.py
|
a
|
b
|
|
| 429 | 429 | except AttributeError: |
| 430 | 430 | # OS_BINARY not available on every platform |
| 431 | 431 | pass |
| 432 | | target_file = os.fdopen(os.open(target_path, flags), 'w') |
| | 432 | target_file = os.fdopen(os.open(target_path, flags, 0666), 'w') |
| 433 | 433 | try: |
| 434 | 434 | shutil.copyfileobj(upload.file, target_file) |
| 435 | 435 | self.log.info('Plugin %s installed to %s', plugin_filename, |
diff --git a/trac/util/__init__.py b/trac/util/__init__.py
|
a
|
b
|
|
| 77 | 77 | flags = os.O_CREAT + os.O_WRONLY + os.O_EXCL |
| 78 | 78 | if hasattr(os, 'O_BINARY'): |
| 79 | 79 | flags += os.O_BINARY |
| 80 | | return path, os.fdopen(os.open(path, flags), 'w') |
| | 80 | return path, os.fdopen(os.open(path, flags, 0666), 'w') |
| 81 | 81 | except OSError: |
| 82 | 82 | idx += 1 |
| 83 | 83 | # A sanity check |