ruby-dev (Japanese) list archive (unofficial mirror)
 help / color / mirror / Atom feed
From: nagachika00@gmail•com
To: ruby-dev@ruby-lang.org
Subject: [ruby-dev:50501] [Ruby trunk Bug#13863] RUBYLIB にカレントディレクトリを設定した場合、-E cp932:utf-8 を指定するとスクリプトが全く実行されない
Date: Sat, 17 Mar 2018 14:24:44 +0000 (UTC)	[thread overview]
Message-ID: <redmine.journal-71053.20180317142443.bd2e5a36ac72d762@ruby-lang.org> (raw)
In-Reply-To: redmine.issue-13863.20170904105927@ruby-lang.org

Issue #13863 has been updated by nagachika (Tomoyuki Chikanaga).


I backported additionally r57484,r58767,r58938,r59041 to try to get rid of CI failure.
http://mswinci.japaneast.cloudapp.azure.com/vc12-x64/ruby-2.4/log/20180316T201433Z.fail.html.gz

----------------------------------------
Bug #13863: RUBYLIB にカレントディレクトリを設定した場合、-E cp932:utf-8 を指定するとスクリプトが全く実行されない
https://bugs.ruby-lang.org/issues/13863#change-71053

* Author: dogatana (Toshihiko Ichida)
* Status: Closed
* Priority: Normal
* Assignee: 
* Target version: 
* ruby -v: ruby 2.4.1p111 (2017-03-22 revision 58053) [i386-mingw32]
* Backport: 2.2: WONTFIX, 2.3: REQUIRED, 2.4: DONE
----------------------------------------
こんにちは。

Windows 環境の ruby での話です。

http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-list/49186
https://bugs.ruby-lang.org/issues/7881

について、これは少なくとも

* ruby 2.3.3p222 (2016-11-21 revision 56859) [i386-mingw32]
* ruby 2.4.1p111 (2017-03-22 revision 58053) [i386-mingw32]

では発生せず、対策されているようです。

ただし、

* 環境変数 RUBYLIBにカンレントディレクトリ(.)を設定
* -E cp932:utf-8 を指定

して上のリンクにある a.rb を実行すると、

ruby 2.3.3p222 (2016-11-21 revision 56859) [i386-mingw32]  では

~~~
> ruby -E cp932:utf-8 a.rb
<internal:enc/prelude>:4:in `require': stack level too deep (SystemStackError)
        from <internal:enc/prelude>:4:in `<internal:enc/prelude>'

~~~

と表示され、即座に終了し、
ruby 2.4.1p111 (2017-03-22 revision 58053) [i386-mingw32] では

~~~
> ruby -E cp932:utf-8 a.rb
~~~

と何も表示せず、ruby が終了します。
(内部では SystemStackError が発生?)

-E オプションは標準出力を cp932 で出力したいためで、今はIO#set_encoding を使用するようにして対処していますが、
本質的には ruby 側での対策が望ましいのではと思います。

いかがでしょうか。


市田



-- 
https://bugs.ruby-lang.org/

  parent reply	other threads:[~2018-03-17 14:24 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <redmine.issue-13863.20170904105927@ruby-lang.org>
2017-09-04 10:59 ` [ruby-dev:50221] [Ruby trunk Bug#13863] RUBYLIB にカレントディレクトリを設定した場合、-E cp932:utf-8 を指定するとスクリプトが全く実行されない dogatana
2017-09-04 12:13 ` [ruby-dev:50222] " usa
2017-09-05  4:14 ` [ruby-dev:50224] " dogatana
2017-09-05  7:37 ` [ruby-dev:50225] " usa
2017-09-05 11:51 ` [ruby-dev:50228] " dogatana
2018-03-16 17:34 ` [ruby-dev:50500] " nagachika00
2018-03-17 14:24 ` nagachika00 [this message]
2018-03-18  3:58 ` [ruby-dev:50502] " nagachika00

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.ruby-lang.org/en/community/mailing-lists/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=redmine.journal-71053.20180317142443.bd2e5a36ac72d762@ruby-lang.org \
    --to=ruby-dev@ruby-lang.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).