[MERGE] Error messages for test FTP server (Python 2.5 compatibility)
Alexander Belchenko
bialix at ukr.net
Wed Apr 18 13:30:04 BST 2007
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Aaron Bentley пишет:
> Alexander Belchenko wrote:
>> Attached diff fixes my problems with Ftp tests @ Python 2.5.
>
> It is strange; I tried running the Ftp tests under Python 2.5 and they
> worked just fine for me.
Probably it's a issue with Windows Python version?
Also my Python 2.5 sometimes try to report localized error messages
(i.e. russian for my russian win32) instead of english ones.
>
> @@ -667,6 +667,10 @@
> class ftp_channel(medusa.ftp_server.ftp_channel):
> """Customized ftp channel"""
>
> + ERRORS = {errno.ENOENT: 'No such file or directory',
> + errno.EEXIST: 'File exists',
> + }
>
> os.strerror ought to provide these translations and many more. Have you
> tried it?
Thanks for the hint. I was unaware about this function.
It works fine with Python 2.5 and returns expected english messages.
But I'm worry about this comment in python doc:
strerror( code)
Return the error message corresponding to the error code in code. Availability: Unix, Windows.
This function does not exist on Mac? In this case I'm better to keep
my dictionary with error messages.
[µ]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFGJg9MzYr338mxwCURAsBoAKCRfHEa2VWDRA3Cl2O9akanYAdoTQCfXxKQ
pzYQs8INZTOjH/qs6SqOEwo=
=KHrg
-----END PGP SIGNATURE-----
More information about the bazaar
mailing list