From: Nick H. <nic...@ho...> - 2013-12-26 12:14:21
|
On 26/12/13 10:25, Enno Borgsteede wrote: >> Here are my results on Win7 Prof 64 bit German: >> > >> >python -S >> > >> >Python 2.7.6 (default, Nov 10 2013, 19:24:18) [MSC v.1500 32 bit >> >(Intel)] on win32 >> > >>> import string; print [hex(ord(c)) for c in string.whitespace] >> >['0x9', '0xa', '0xb', '0xc', '0xd', '0x20'] > Weird, isn't it? No 0xa0 to be seen. Had the same here. Results are > different though when you add > > print ([hex(ord(c)) for c in string.whitespace]) > > to libgedcom.py. I did that, at the start of __merge_address, and if you > do the same, you will probably see that the 0xa0 is there, at position 6. I don't think we should be using string.whitespace. As I mentioned in my last post, strip() without the chars argument should work and is clearer. We must also test the code in python3 for gramps40. To make maintenance easier in the future I suggest: 1. Import unicode_literals. This can be done to any file. 2. Use the io module instead of the built-in file object. Nick. |