Merge lp:~ericmoritz/bzr/488519-walkdirs-encoding-bug into lp:bzr
Proposed by
Eric Moritz
Status: | Merged |
---|---|
Approved by: | Vincent Ladeuil |
Approved revision: | no longer in the source branch. |
Merged at revision: | 5302 |
Proposed branch: | lp:~ericmoritz/bzr/488519-walkdirs-encoding-bug |
Merge into: | lp:bzr |
Diff against target: |
194 lines (+74/-13) 4 files modified
bzrlib/errors.py (+3/-3) bzrlib/osutils.py (+25/-9) bzrlib/tests/__init__.py (+11/-0) bzrlib/tests/test_osutils.py (+35/-1) |
To merge this branch: | bzr merge lp:~ericmoritz/bzr/488519-walkdirs-encoding-bug |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Martin Packman (community) | Approve | ||
John A Meinel | Approve | ||
Martin Pool | Pending | ||
Eric Moritz | Pending | ||
Review via email: mp+27006@code.launchpad.net |
This proposal supersedes a proposal from 2010-06-08.
Description of the change
A fix for bug #488519
To post a comment you must log in.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Andrew Bennetts wrote:
> You have been requested to review the proposed merge of lp:~ericmoritz/bzr/488519-walkdirs-encoding-bug into lp:bzr.
>
> A fix for bug #488519
>
>
This is the 'walkdirs' code and not the '_walkdirs_utf8' code, the
latter being the more performance critical code. And he is correct that
we are already casting everything to Unicode, except for what Python
cannot cast based on fs_encoding. And the only way we can determine that
is by checking the type of the string. As such, I think his change is
reasonable.
I will note that:
a) I prefer "if type(filename) is unicode" versus the isinstance check,
but it shouldn't be a huge difference. (isinstance has to check the
inheritance heirarchy, but I would assume that being exact 99.9% of the
time means it would still be fast.)
b) I expect that if we get a string, then the decode will fail. That is
sort of the crux of the problem (python listdir() failed to decode it,
so it just returns a string, I don't know why we would expect to find
differently.)
c) It would be better to put ByteStreamedNam edFilesystem into tests/features. py and call it "byte_stream_ named_filesyste m". But
bzrlib/
maybe not since the other ones like UTF8Filesystem are still in this
location.
The rest seems ok as long as the other reviewers are happy.
review: approve
John
=:->
-----BEGIN PGP SIGNATURE----- enigmail. mozdev. org/
On90ACgkQJdeBCY SNAAObeACgqq60D J3Jy3T3MnZ4ZSER L4gK dCoYL1c4MEmEQzi e42y
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://
iEYEARECAAYFAkw
X4YAoMH9WydE+
=Ctuq
-----END PGP SIGNATURE-----