python / cpython

The Python programming language
https://www.python.org/
Other
60.47k stars 29.23k forks source link

preconvert AppleSingle resource files #36974

Closed ronaldoussoren closed 21 years ago

ronaldoussoren commented 21 years ago
BPO 590456
Nosy @jackjansen, @ronaldoussoren

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields: ```python assignee = 'https://github.com/jackjansen' closed_at = created_at = labels = ['OS-mac'] title = 'preconvert AppleSingle resource files' updated_at = user = 'https://github.com/ronaldoussoren' ``` bugs.python.org fields: ```python activity = actor = 'jackjansen' assignee = 'jackjansen' closed = True closed_date = None closer = None components = ['macOS'] creation = creator = 'ronaldoussoren' dependencies = [] files = [] hgrepos = [] issue_num = 590456 keywords = [] message_count = 2.0 messages = ['11813', '11814'] nosy_count = 2.0 nosy_names = ['jackjansen', 'ronaldoussoren'] pr_nums = [] priority = 'normal' resolution = 'fixed' stage = None status = 'closed' superseder = None type = None url = 'https://bugs.python.org/issue590456' versions = ['Python 2.3'] ```

ronaldoussoren commented 21 years ago

IDLE fails to start when using a recent Python 2.3 snapshot because it tries to write files in the Python.framework, which is not writeable by normal users.

A traceback:

IOError: [Errno 13] Permission denied: '/Library/Frameworks/
Python.framework/Versions/2.3/Mac/Tools/IDE/Widgets.rsrc.
df.rsrc'
Traceback (most recent call last):
  File "./Mac/Tools/IDE/PythonIDE.py", line 35, in ?
  File "./Mac/Tools/IDE/PythonIDE.py", line 23, in init
  File "/Library/Frameworks/Python.framework/Versions/2.3/Mac/
Lib/macresource.py"
, line 64, in need
    refno = open_pathname(pathname)
  File "/Library/Frameworks/Python.framework/Versions/2.3/Mac/
Lib/macresource.py"
, line 92, in open_pathname
    pathname = _decode(pathname)
  File "/Library/Frameworks/Python.framework/Versions/2.3/Mac/
Lib/macresource.py"
, line 104, in _decode
    applesingle.decode(pathname, newpathname, resonly=1)
  File "/Library/Frameworks/Python.framework/Versions/2.3/Mac/
Lib/applesingle.py"
, line 74, in decode
    fp = open(output, 'wb')
IOError: [Errno 13] Permission denied: '/Library/Frameworks/
Python.framework/Versions/2.3/Mac/Tools/IDE/Widgets.rsrc.
df.rsrc'
Traceback (most recent call last):
  File "./Mac/Tools/IDE/PythonIDE.py", line 35, in ?
  File "./Mac/Tools/IDE/PythonIDE.py", line 23, in init
  File "/Library/Frameworks/Python.framework/Versions/2.3/Mac/
Lib/macresource.py"
, line 64, in need
    refno = open_pathname(pathname)
  File "/Library/Frameworks/Python.framework/Versions/2.3/Mac/
Lib/macresource.py"
, line 92, in open_pathname
    pathname = _decode(pathname)
  File "/Library/Frameworks/Python.framework/Versions/2.3/Mac/
Lib/macresource.py"
, line 104, in _decode
    applesingle.decode(pathname, newpathname, resonly=1)
  File "/Library/Frameworks/Python.framework/Versions/2.3/Mac/
Lib/applesingle.py"
, line 74, in decode
    fp = open(output, 'wb')

Initial reaction from Jack:

Ah! That's an interesting problem...

Here's what's going on, maybe someone here has good ideas on how to solve it.

The ".rsrc" files in the CVS tree aren't actually resource files: they're resource files encoded as AppleSingle. This is the way MacCVS manages to store two-fork files on a CVS server that is blissfully unaware of this Apple-ism. The macresourced module is aware that a .rsrc file can be either a bona-fide resource file or an AppleSingle file. In the latter case it decodes the file and caches the result as a ".rsrc.df.rsrc" file, with the resources in the data fork. But: if you can't write the directory where the .rsrc resides this fails.

Storing the files as datafork-based .rsrc files in CVS will make life miserable for me when building on OS9.

Checking the files out with MacCVS will make the standard unix tarball distribution non-functional on OSX.

Hmm, I could probably pre-convert the files while installing, similar to the precompilation step for .pyc and .pyo files....

Could you file a sourceforge bug report for this, please, so I won't forget?

jackjansen commented 21 years ago

Logged In: YES user_id=45365

Fixed in Mac/OSX/Makefile rev 1.21. We also repcompile the .py files now.