[BUG] bundle cannot handle binary files

John Arbash Meinel john at arbash-meinel.com
Sat Jul 8 15:36:39 BST 2006


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

Alexander Belchenko wrote:
> Alexander Belchenko пишет:

...

> split lines of patch by '\n' and '\r' *also*. And therefore this
> function breaks normal diff into malformed diff.
> 
> So, yes, I agree, it's win32-specific bug in string.splitlines().
> 
> In [3]: 'aaaa\rbbbb\r\nccc\nddd'.splitlines(True)
> Out[3]: ['aaaa\r', 'bbbb\r\n', 'ccc\n', 'ddd']

I see your comment here, but string.splitlines(True) works the same way
on linux. So it is still a mystery why your patch is failing on windows,
but not failing on Linux.

The above does indeed look like it would be a problem. Since we probably
assume each line ends with \n.

We should set up some tests in test_bundle.py that check for files that
have an interior '\r' character.

> 
> BTW, in bundle_data.py inside function def _get_inventory() (approx.
> line 645) there is also potentially non-cross-platforming statement:
> 
> from os.path import dirname, basename
> 
> -- 
> Alexander


This is actually fine. dirname/basename are safe on all platforms
because they only cut up the path they are given. They don't add things
to the path. (like abspath/realpath/normpath).

John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFEr8L2JdeBCYSNAAMRAkw9AJ48t3DfClmSzN0wkM5Ni/TYzmfCwACgk4MC
/hfOkv9LKpdIeh5mmfcN/lc=
=d5Lz
-----END PGP SIGNATURE-----




More information about the bazaar mailing list