[bug] os.chdir() report E344 when destination directory contains Chinese characters.

52 views
Skip to first unread message

Yggdroot Chen

unread,
Jun 1, 2016, 4:36:35 AM6/1/16
to vim_dev
Steps to reproduce:
1. Open vim in directory D:\中文\test\
2. Execute the following commands:
:py import os
:py os.chdir('..')
the change succeed, but raise an error:

Traceback (most recent call last):
File "<string>", line 1, in <module>
vim.error: failed to change directory
Error detected while processing :
E344: Can't find directory "D:\<d6><d0><ce><c4>" in cdpath

PS:
VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Jan 2 2016 14:36:11)
MS-Windows 32-bit GUI version with OLE support
Included patches: 1-1023
Compiled by mool@tororo

Ken Takata

unread,
Jun 1, 2016, 7:53:23 AM6/1/16
to vim_dev
Hi,
It seems that it occurs when 'encoding' is changed from the default setting.
(E.g. set enc=utf-8 on Windows.)

The following patch should fix the problem:
https://bitbucket.org/k_takata/vim-ktakata-mq/src/1617abbf9424a3c8787677e071bb15b2930c6787/py2-chdir.patch

P.S. If you report a problem related to multibyte characters, it's better
to show your 'encoding' setting and your OS version.

Regards,
Ken Takata

Yggdroot Chen

unread,
Jun 1, 2016, 8:40:49 AM6/1/16
to vim_dev
在 2016年6月1日星期三 UTC+8下午7:53:23,Ken Takata写道:
Yes, I'm on Windows and I have `set enc=utf-8` in my vimrc.
Thanks for the patch. Hope it to be merged.

Bram Moolenaar

unread,
Jun 1, 2016, 2:38:45 PM6/1/16
to Ken Takata, vim_dev

Ken Takata wrote:

> 2016/6/1 Wed 17:36:35 UTC+9 Yggdroot Chen wrote:
> > Steps to reproduce:
> > 1. Open vim in directory D:\中文\test\
> > 2. Execute the following commands:
> > :py import os
> > :py os.chdir('..')
> > the change succeed, but raise an error:
> >
> > Traceback (most recent call last):
> > File "<string>", line 1, in <module>
> > vim.error: failed to change directory
> > Error detected while processing :
> > E344: Can't find directory "D:\<d6><d0><ce><c4>" in cdpath
> >
> > PS:
> > VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Jan 2 2016 14:36:11)
> > MS-Windows 32-bit GUI version with OLE support
> > Included patches: 1-1023
> > Compiled by mool@tororo
>
> It seems that it occurs when 'encoding' is changed from the default setting.
> (E.g. set enc=utf-8 on Windows.)
>
> The following patch should fix the problem:
> https://bitbucket.org/k_takata/vim-ktakata-mq/src/1617abbf9424a3c8787677e071bb15b2930c6787/py2-chdir.patch

Thanks!

> P.S. If you report a problem related to multibyte characters, it's better
> to show your 'encoding' setting and your OS version.

--
What a wonderfully exciting cough! Do you mind if I join you?
-- Douglas Adams, "The Hitchhiker's Guide to the Galaxy"

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
Reply all
Reply to author
Forward
0 new messages