Commit 6ce06c7
committed
Remove absolute paths from compiled modules
.pyc files store the absolute paths of their original .py files for displaying on tracebacks. See:
https://stackoverflow.com/questions/11191680/why-do-python-pyc-files-contain-the-absolute-path-of-their-source-code
https://bugs.python.org/issue1051638
The `ddir` option, documented on the link below, can override the prepended path:
http://docs.python.org/library/compileall#cmdoption-compileall-d
Avoids exposing the username on the compiling machine in tracebacks in case an exception occurs. For record, here's how PyInstaller dealt with this problem:
pyinstaller/pyinstaller#10591 parent e666d2c commit 6ce06c7
1 file changed
+16
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| 29 | + | |
29 | 30 | | |
30 | 31 | | |
31 | 32 | | |
| |||
74 | 75 | | |
75 | 76 | | |
76 | 77 | | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
77 | 90 | | |
78 | 91 | | |
79 | 92 | | |
| |||
90 | 103 | | |
91 | 104 | | |
92 | 105 | | |
93 | | - | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
94 | 109 | | |
95 | 110 | | |
96 | 111 | | |
| |||
0 commit comments