[#104169] [Ruby master Feature#17938] Keyword alternative for boolean positional arguments — matheusrichardt@...

Issue #17938 has been reported by matheusrich (Matheus Richard).

12 messages 2021/06/04

[#104213] [Ruby master Feature#17942] Add a `initialize(public @a, private @b)` shortcut syntax for defining public/private accessors for instance vars — tyler@...

Issue #17942 has been reported by TylerRick (Tyler Rick).

6 messages 2021/06/09

[#104288] [Ruby master Bug#17992] Upstreaming the htmlentities gem into CGI#.(un)escape_html — alexandermomchilov@...

Issue #17992 has been reported by AMomchilov (Alexander Momchilov).

9 messages 2021/06/15

[#104338] [Ruby master Misc#17997] DevelopersMeeting20210715Japan — mame@...

Issue #17997 has been reported by mame (Yusuke Endoh).

10 messages 2021/06/17

[#104361] [Ruby master Bug#18000] have_library doesn't work when ruby is compiled with --disable-shared --disable-install-static-library — jean.boussier@...

Issue #18000 has been reported by byroot (Jean Boussier).

9 messages 2021/06/18

[#104401] [Ruby master Feature#18007] Help developers of C extensions meet requirements in "doc/extension.rdoc" — mike.dalessio@...

Issue #18007 has been reported by mdalessio (Mike Dalessio).

16 messages 2021/06/25

[#104430] [Ruby master Bug#18011] `Method#parameters` is incorrect for forwarded arguments — josh.cheek@...

Issue #18011 has been reported by josh.cheek (Josh Cheek).

12 messages 2021/06/29

[ruby-core:104425] [Ruby master Bug#9737] Non-ASCII characters in the path to ruby executable break require paths

From: merch-redmine@...
Date: 2021-06-28 17:41:56 UTC
List: ruby-core #104425
Issue #9737 has been updated by jeremyevans0 (Jeremy Evans).

Status changed from Open to Closed

This issue appears to have been fixed, probably in Ruby 3.0.  Using the latest RubyInstaller-head:

```
D:\zz-knen2>D:\zz-knen2\Ruby31-x64\bin\ruby.exe -v --disable-gems -e "p $:.first.encoding, $:.first; require 'uri'"
ruby 3.1.0dev (2021-06-27 master e724857f42) [x64-mingw-ucrt]
#<Encoding:IBM437>
"D:/zz-k\x94nnen2/Ruby31-x64/lib/ruby/site_ruby/3.1.0"
```

----------------------------------------
Bug #9737: Non-ASCII characters in the path to ruby executable break require paths
https://bugs.ruby-lang.org/issues/9737#change-92671

* Author: spatulasnout (B Kelly)
* Status: Closed
* Priority: Normal
* Assignee: cruby-windows
* ruby -v: ruby 2.2.0dev (2014-04-12 trunk 45576) [i386-mswin32_100]
* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN
----------------------------------------
Hi,

On Windows, if non-ASCII characters exist the path on which the ruby
interpreter is invoked, the character encoding is not handled properly
when the require paths in $: are created, making ruby unable to require
libraries in its standard lib paths.

In the first two examples, the working directory of the shell is not
a factor; what matters is the path by which the ruby interpreter is
invoked.

Here we invoke ruby using a path containing non-ASCII characters:

~~~
$ M:\dev\ruby-build\zz-knen2\bin\ruby.exe -v --disable-gems -e "p $:.first.encoding, $:.first; require 'uri'"
ruby 2.2.0dev (2014-04-12 trunk 45576) [i386-mswin32_100]
#<Encoding:ASCII-8BIT>
"M:/dev/ruby-build/zz-k\xF6nnen2/lib/ruby/site_ruby/2.2.0"
-e:1:in `require': cannot load such file -- uri (LoadError)
        from -e:1:in `<main>'
~~~

Here we invoke ruby in the same location, but instead using the
NTFS "short" name on the path so that it is ASCII only:

~~~
$ M:\dev\ruby-build\ZZ-KNN~2\bin\ruby.exe -v --disable-gems -e "p $:.first.encoding, $:.first; require 'uri'"
ruby 2.2.0dev (2014-04-12 trunk 45576) [i386-mswin32_100]
#<Encoding:IBM437>
"M:/dev/ruby-build/ZZ-KNN~2/lib/ruby/site_ruby/2.2.0"
~~~

In the second two examples, we change the working dir instead of
specifying the interpreter path directly.  The results are the same:

~~~
# working dir: M:\dev\ruby-build\zz-knen2\bin
$ .\ruby.exe -v --disable-gems -e "p $:.first.encoding, $:.first; require 'uri'"
ruby 2.2.0dev (2014-04-12 trunk 45576) [i386-mswin32_100]
#<Encoding:ASCII-8BIT>
"M:/dev/ruby-build/zz-k\xF6nnen2/lib/ruby/site_ruby/2.2.0"
-e:1:in `require': cannot load such file -- uri (LoadError)
        from -e:1:in `<main>'

# working dir: M:\dev\ruby-build\ZZ-KNN~2\bin
$ .\ruby.exe -v --disable-gems -e "p $:.first.encoding, $:.first; require 'uri'"
ruby 2.2.0dev (2014-04-12 trunk 45576) [i386-mswin32_100]
#<Encoding:IBM437>
"M:/dev/ruby-build/ZZ-KNN~2/lib/ruby/site_ruby/2.2.0"
~~~


I'm guessing this will be related to the `GetModuleFileName()` call in:

~~~
win32/stub.c:    lenexe = (size_t)GetModuleFileName(NULL, exename, sizeof exename);
~~~

which would presumably need to become the Unicode `GetModuleFileNameW()`
version instead?


Regards,

Bill





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

Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>

In This Thread

Prev Next