Re: [1.7][python] File operation API to multibyte filenames fails.

2009-05-08 Thread Dave Korn
Corinna Vinschen wrote: > On May 9 05:02, IWAMURO Motonori wrote: >> When the last readdir returns NULL, python detects the error because >> readdir keeps previous errno. >> >> 1) ep = readdir(dirp); // ep->d_name == ".", errno == 0 >>Python check only ep != NULL. -> OK >> 2) ep = readdir(dir

Re: [1.7][python] File operation API to multibyte filenames fails.

2009-05-08 Thread Corinna Vinschen
On May 9 05:02, IWAMURO Motonori wrote: > 2009/5/9 Corinna Vinschen : > > Cool. Thanks for the patch. This actually solves the problem. > > I applied the patch with just a little tweak. > > Thanks. > > The following patch might be better. > > --- a/winsup/cygwin/strfuncs.cc Thu May 07 12:29:1

Re: [1.7][python] File operation API to multibyte filenames fails.

2009-05-08 Thread IWAMURO Motonori
2009/5/9 Corinna Vinschen : > Cool. Thanks for the patch. This actually solves the problem. > I applied the patch with just a little tweak. Thanks. The following patch might be better. --- a/winsup/cygwin/strfuncs.cc Thu May 07 12:29:17 2009 +0900 +++ b/winsup/cygwin/strfuncs.cc Sat May 09 04:

Re: [1.7][python] File operation API to multibyte filenames fails.

2009-05-08 Thread Corinna Vinschen
On May 9 04:21, IWAMURO Motonori wrote: > 2009/5/9 Corinna Vinschen : > > can't see a fault in Cygwin. Neither from strace, nor in a GDB session. > > The readdir calls return the filenames using the SO sequences so that > > a valid byte-stream is created which also works in the C locale. > > Howev

Re: [1.7][python] File operation API to multibyte filenames fails.

2009-05-08 Thread IWAMURO Motonori
Sorry, test code is bad. - printf("%d\n", ent->d_name, errno); + printf("%d\n", errno); -- IWAMURO Motnori -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.

Re: [1.7][python] File operation API to multibyte filenames fails.

2009-05-08 Thread IWAMURO Motonori
2009/5/9 Corinna Vinschen : > can't see a fault in Cygwin. Neither from strace, nor in a GDB session. > The readdir calls return the filenames using the SO sequences so that > a valid byte-stream is created which also works in the C locale. > However, for some reason there's a EILSEQ (138) errno ge

Re: [1.7][python] File operation API to multibyte filenames fails.

2009-05-08 Thread Corinna Vinschen
On May 8 22:21, IWAMURO Motonori wrote: > Hi. > > 2009/5/8 Corinna Vinschen : > > Your scripts.  Python correctly doesn't use setlocale because it's > > the responsibility of the application to set the local if it uses > > non-ASCII chars.  And Cygwin simply has no chance to convert UTF-8 > > to

Re: [1.7][python] File operation API to multibyte filenames fails.

2009-05-08 Thread IWAMURO Motonori
Hi. 2009/5/8 Corinna Vinschen : > Your scripts.  Python correctly doesn't use setlocale because it's > the responsibility of the application to set the local if it uses > non-ASCII chars.  And Cygwin simply has no chance to convert UTF-8 > to UTF-16 if the application doesn't ask for UTF-8. Oh, i

Re: [1.7][python] File operation API to multibyte filenames fails.

2009-05-08 Thread Corinna Vinschen
On May 8 22:02, IWAMURO Motonori wrote: > Hi. > > File operation API to multibyte filenames fails on Python and Cygwin-1.7. > Which Python or Cygwin-1.7 should be fixed? > > My environment: Windows XP SP3, Cygwin-1.7.0-46, and LANG=ja_JP.UTF-8 > > The following code fails on the directory which

[1.7][python] File operation API to multibyte filenames fails.

2009-05-08 Thread IWAMURO Motonori
Hi. File operation API to multibyte filenames fails on Python and Cygwin-1.7. Which Python or Cygwin-1.7 should be fixed? My environment: Windows XP SP3, Cygwin-1.7.0-46, and LANG=ja_JP.UTF-8 The following code fails on the directory which has multibyte filenames: >>> import os >>> os.listdir("