Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#30252 closed defect (fixed)

tar mangles (some?) non-ascii characters in paths when extracting images

Reported by: justin.holewinski@… Owned by: macports-tickets@…
Priority: Normal Milestone: MacPorts 2.0.0
Component: base Version: 2.0.99
Keywords: lion Cc: nerdling (Jeremy Lavergne)
Port: py27-py2app

Description

While attempting to install py27-matplotlib, I discovered that the dependency py27-py2app does not activate.

Installation (after uninstall/clean from original failure):

$ sudo port install py27-py2app
--->  Computing dependencies for py27-py2app
--->  Fetching archive for py27-py2app
--->  Fetching py27-py2app
--->  Verifying checksum(s) for py27-py2app
--->  Extracting py27-py2app
--->  Configuring py27-py2app
--->  Building py27-py2app
--->  Staging py27-py2app into destroot
--->  Installing py27-py2app @0.6.3_0
--->  Activating py27-py2app @0.6.3_0
Error: Target org.macports.activate returned: Image error: Source file /tmp/mpextractNvluKOE2/opt/local/share/examples/py27-py2app/PyObjC/TinyTinyEdit/dist.€/TinyTinyEdit.app/Contents/Frameworks/Python.framework/Versions/3.2/Python does not appear to exist (cannot lstat it).  Unable to activate port py27-py2app.
Log for py27-py2app is at: /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_python_py27-py2app/py27-py2app/main.log
Error: Status 1 encountered during processing.
To report a bug, see <http://guide.macports.org/#project.tickets>

Log attached.

I'm not sure why it's trying to find Python 3.2 libraries for the Python 2.7 version...

OS: OS X Lion 10.7 (retail) XCode: 4.1 (retail)

Attachments (1)

py2app.log (220.7 KB) - added by justin.holewinski@… 13 years ago.
port build log

Download all attachments as: .zip

Change History (15)

Changed 13 years ago by justin.holewinski@…

Attachment: py2app.log added

port build log

comment:1 Changed 13 years ago by justin.holewinski@…

Cc: justin.holewinski@… added

Cc Me!

comment:2 Changed 13 years ago by nerdling (Jeremy Lavergne)

Cc: snc@… added

What's your default version of python?

comment:3 Changed 13 years ago by justin.holewinski@…

Python 2.7 (from MacPorts, not OS X) is the current default. I also installed Python 3.2 to see if it would magically pick up the needed frameworks, but no luck.

comment:4 Changed 13 years ago by jmroot (Joshua Root)

Cc: justin.holewinski@… removed
Owner: changed from macports-tickets@… to jmr@…
Port: py27-py2app added
Status: newassigned

Please remember to fill in the Port field and cc the maintainer. You do not need to be in cc when you are the reporter.

comment:5 Changed 13 years ago by justin.holewinski@…

I invested this further, and the problem appears to be an incompatibility between a directory name in the py2app sources, and the archiver MacPorts uses to activate ports. Specifically, the py2app package has a directory named

py2app-0.6.3/examples/PyObjC/TinyTinyEdit/dist.€

(Note the €). When inflating the package during activation, that symbol appears to be morphed into a sequence of character escapes (see original log), which confuses MacPorts.

As a work-around, I manually changed the "dist.€" directory to just "dist" in the py2app source archive and forced MacPorts to use the new archive instead of the one on PyPI. With this change, the installation is successful. I'm not sure how best to handle this in general, but a simple patch that just renames that directory would suffice in the short term.

Though, this could also just be an upstream issue. I'm not sure why you would intentionally put a € in a directory name like that.

comment:6 Changed 13 years ago by nerdling (Jeremy Lavergne)

Component: portsbase

comment:7 Changed 13 years ago by nerdling (Jeremy Lavergne)

If we're not respecting encodings in file names it'll only become a bigger issue as time goes on.

comment:8 in reply to:  5 Changed 13 years ago by wicentowski@…

Replying to justin.holewinski@…:

As a work-around, I manually changed the "dist.€" directory to just "dist" in the py2app source archive and forced MacPorts to use the new archive instead of the one on PyPI. With this change, the installation is successful. I'm not sure how best to handle this in general, but a simple patch that just renames that directory would suffice in the short term.

Can you give some tips on how you did this?

comment:9 Changed 13 years ago by jmroot (Joshua Root)

Owner: changed from jmr@… to macports-tickets@…
Status: assignednew
Summary: py27-py2app 0.6.3 activation failuretar mangles (some?) non-ascii characters in paths when extracting images

Workaround added to py2app in r80927. This definitely sounds like a tar bug, so I'm not really sure what we can do about it.

comment:10 Changed 13 years ago by jmroot (Joshua Root)

Keywords: lion added

comment:11 in reply to:  9 Changed 13 years ago by wicentowski@…

Replying to jmr@…:

Workaround added to py2app in r80927. This definitely sounds like a tar bug, so I'm not really sure what we can do about it.

The new Portfile worked for me. Thanks.

comment:12 Changed 13 years ago by jmroot (Joshua Root)

Actually, it looks like tar is now obeying the locale environment vars in Lion, and assuming "C" when they're not set.

comment:13 Changed 13 years ago by jmroot (Joshua Root)

Milestone: MacPorts 2.0.0
Resolution: fixed
Status: newclosed

comment:14 Changed 13 years ago by justin.holewinski@…

That makes me a bit more confused now.

The non-ASCII character is present in the original archive, and gets extracted correctly (I believe). Everything builds fine, but the re-archiving is what shows a change in the encoding. Both use tar, so why is it correct in one case and not in the other? Does MacPorts modify the locale at some point during installation?

Note: See TracTickets for help on using tickets.