Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not add a relative path to $LOAD_PATH #431

Merged
merged 1 commit into from
Jul 3, 2020

Conversation

mame
Copy link
Contributor

@mame mame commented Jul 3, 2020

... because it conflicts with test/ruby/test_m17n.rb in ruby/ruby.

An exception incompatible character encodings: UTF-8 and UTF-16BE
occurs when:

  • a non-existence relative path is added to $LOAD_PATH,
  • ASCII-incompatible encoding is set to default_external, and
  • some file is loaded.
$LOAD_PATH << "no_existing_dir"
Encoding.default_external = Encoding::UTF_16BE
load "dummy.rb" #=> incompatible character encodings: UTF-8 and UTF-16BE

This issue can be actually observed by a combination of out-of-place
build and the following command:

make test-all TESTS="json ruby/m17n -n test_object_inspect_external"

http://ci.rvm.jp/logfiles/brlog.trunk-test-random.20200322-221411

ASCII-incompatible default external encoding assumes that the cwd is the
encoding, and it is attempted to beconcatenated with a non-existence
relative LOAD_PATH UTF-8 string, which causes the exception.

This changeset avoids a relative path.

... because it conflicts with test/ruby/test_m17n.rb.

An exception `incompatible character encodings: UTF-8 and UTF-16BE`
occurs when:

* a non-existence relative path is added to $LOAD_PATH,
* ASCII-incompatible encoding is set to default_external, and
* some file is loaded.

```
$LOAD_PATH << "no_existing_dir"
Encoding.default_external = Encoding::UTF_16BE
load "dummy.rb" #=> incompatible character encodings: UTF-8 and UTF-16BE
```

This issue can be actually observed by a combination of out-of-place
build and the following command:

make test-all TESTS="json ruby/m17n -n test_object_inspect_external"

http://ci.rvm.jp/logfiles/brlog.trunk-test-random.20200322-221411

ASCII-incompatible default external encoding assumes that the cwd is the
encoding, and it is attempted to beconcatenated with a non-existence
relative LOAD_PATH UTF-8 string, which causes the exception.

This changeset avoids a relative path.
@hsbt hsbt merged commit b6e6a4c into flori:master Jul 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants