Merge lp:~myfreeweb/bzr/osx-unicode-paths-fix into lp:bzr

Proposed by myfreeweb
Status: Work in progress
Proposed branch: lp:~myfreeweb/bzr/osx-unicode-paths-fix
Merge into: lp:bzr
Diff against target: 12 lines (+1/-1)
1 file modified
bzrlib/osutils.py (+1/-1)
To merge this branch: bzr merge lp:~myfreeweb/bzr/osx-unicode-paths-fix
Reviewer Review Type Date Requested Status
John A Meinel Needs Fixing
Review via email: mp+24988@code.launchpad.net

Description of the change

Please merge this. It is a fix for #172383 and #102935

To post a comment you must log in.
Revision history for this message
myfreeweb (myfreeweb) wrote :

So, now it's
 [myfreeweb@grigorijs-mac-mini ~/test] $ bzr add
 adding "yéah"

fine. Without this fix, it would throw a KeyError.

Revision history for this message
John A Meinel (jameinel) wrote :

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

MyFreeWeb wrote:
> MyFreeWeb has proposed merging lp:~lol2fast4u/bzr/osx-unicode-paths-fix into lp:bzr.
>
> Requested reviews:
> bzr-core (bzr-core)
>
>
> Please merge this. It is a fix for #172383 and #102935
>

 review: needs_fixing

At a minimum this will break the test suite which checks the return of
the function you are modifying.

  bzrlib/tests/test_osutils.py should be where the update is needed

  bzr selftest -s bt.test_osutils

Is a way to easily run those tests.

However, there is a larger logical concern. The original goal of the
code you are changing was to handle the differences in how Mac handles
filenames. Specifically Mac normalizes filenames on disk, and does so
differently than the 'standard' way people create files on most platforms.

For example, most systems use NFC characters, such as u'\xe1', while Mac
will rewrite that to u'a\0u0301' (which is considered to be the same
effective character, with NFD normalization)

I certainly agree that today the normalization code is broken. The
question is whether the fix is to remove it completely, or whether to
get it working. Your patch is a step towards removing it (albeit
incomplete). There are people that would rather we make it work, which
would make this a step in the wrong direction.

I don't think we (as a project) have decided which route we want to
take, so we should discuss this on the bzr mailing list.

John
=:->

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkvoFUMACgkQJdeBCYSNAAOPvQCbBiOEj4xgRS05CcfJmdPQo+Mf
pb0AoMrPuSIfqdi1ocMvaE4b/uqF6Uns
=AxV8
-----END PGP SIGNATURE-----

review: Needs Fixing

Unmerged revisions

5219. By myfreeweb

Fixed OS X Unicode normalization

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bzrlib/osutils.py'
2--- bzrlib/osutils.py 2010-05-05 14:11:13 +0000
3+++ bzrlib/osutils.py 2010-05-10 12:43:23 +0000
4@@ -1359,7 +1359,7 @@
5 can be accessed by that path.
6 """
7
8- return unicodedata.normalize('NFC', unicode(path)), True
9+ return unicode(path), True
10
11
12 def _inaccessible_normalized_filename(path):