Crashing Bazaar with a French Windows system :)

John Arbash Meinel john at arbash-meinel.com
Thu Jan 14 18:54:38 GMT 2010


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

Philippe Lhoste wrote:
> Alexander Belchenko wrote:
>> Open a bug, please. It's clearly bug.
> 
> OK, https://bugs.launchpad.net/bzr/+bug/507535
> 
> On 14/01/2010 16:08, John Arbash Meinel wrote:
>> I think it is possible to fix, but we need some real test data, as it is
>> highly platform dependent.
> 
> I can only provide my scenario, a fix has to be tested on some
> non-English system, I think. If you provide precise steps, I can try and
> test a patch.
> 

So to understand what is going on, you can try running

python
>>> import ctypes.wintypes, os, sys
>>> f = open('file.txt', 'wb')
>>> try:
...   os.rename('file.txt', 'new_file.txt')
... except WindowsError, e:
...   pass
>>> e
>>> e.errno
>>> e.winerror
>>> e.strerror
>>> e.args
>>> f = ctypes.windll.kernel32.FormatMessageW
>>> l = ctypes.windll.kernel32.LocalFree
>>> res_buf = ctypes.wintypes.LPWSTR()
>>> f(0x100 | 0x200 | 0x1000, # ALLOCATE_BUFFER | IGNORE_INSERTS | FROM_SYSTEM
...   None, e.winerror, 0x01<<10, # user langage (0x00 is NEUTRAL)
...   ctypes.byref(res_buf), 0, None)
...
>>> res_buf.value
>>> l(res_buf)

What is weird is that Python is calling "FormatMessage" with a char
pointer, and I *thought* that FormatMessage gets turned into
FormatMessageW (it does if UNICODE is defined, but I thought that was
also automatic...) Maybe it has to be defined in errors.c, and Python
doesn't do that.

Anyway, this would tell us what *Bazaar* can do to possibly get a better
formatted error. We'll still probably have problems with 8-bit versus
unicode, but we can try to sort those out on our side.


> PS.: I went to Bazaar page and had a quick look how to report bugs. I
> tried Contribute as it seems to make sense, but a quick look around
> didn't show a reference to this simple contribution task.
> Back to home page, I found the tiny "Report a bug" link at the bottom of
> the page, which is fine, but I suggest to add it too to the Contribute
> page.
> 

Sounds reasonable, though it really does fall more under the Support option.

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

iEYEARECAAYFAktPaG4ACgkQJdeBCYSNAAN6QwCeOdDEtNCqMhKMItIO4S5oidOe
6soAnR/YvdvLSt1mwiti5gvExqNautcJ
=ou/K
-----END PGP SIGNATURE-----



More information about the bazaar mailing list