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

Fix YAML syntax - single quote escape (on vehicle.yml) #1305

Merged
merged 1 commit into from
Jul 11, 2018
Merged

Fix YAML syntax - single quote escape (on vehicle.yml) #1305

merged 1 commit into from
Jul 11, 2018

Conversation

YumaInaura
Copy link
Contributor

@YumaInaura YumaInaura commented Jul 8, 2018

i think, in YAML single quote escape

  • \' is invalid
  • '' is vaid

Trouble

when

bundle exec rake

I found many same erros in test on development

...
Error: test_planet(TestFakerDune): I18n::InvalidLocaleData: can not load translations from /Users/yuma/projects/faker/lib/locales/en/vehicle.yml: #<Psych::SyntaxError: (/Users/yuma/projects/faker/lib/locales/en/vehicle.yml): found unknown escape character while parsing a quoted scalar at line 72 column 5413>
/Users/yuma/projects/faker/.bundle/ruby/2.5.0/gems/i18n-1.0.1/lib/i18n/backend/base.rb:234:in `rescue in load_yml'
/Users/yuma/projects/faker/.bundle/ruby/2.5.0/gems/i18n-1.0.1/lib/i18n/backend/base.rb:230:in `load_yml'
/Users/yuma/projects/faker/.bundle/ruby/2.5.0/gems/i18n-1.0.1/lib/i18n/backend/base.rb:215:in `load_file'
/Users/yuma/projects/faker/.bundle/ruby/2.5.0/gems/i18n-1.0.1/lib/i18n/backend/base.rb:17:in `block in load_translations'
/Users/yuma/projects/faker/.bundle/ruby/2.5.0/gems/i18n-1.0.1/lib/i18n/backend/base.rb:17:i
...

on development environment is

  • libyaml: stable 0.2.1 (bottled)
  • Homebrew 1.6.9-138-gb350fe0
  • Homebrew/homebrew-core (git revision 95e6e; last commit 2018-07-08)
  • ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-darwin17]
  • mac OSX High Sierra

parsing example on ruby

[1] pry(main)> YAML.load_file('lib/locales/en/vehicle.yml')
Psych::SyntaxError: (lib/locales/en/vehicle.yml): found unknown escape character while parsing a quoted scalar at line 72 column 5413
from /Users/yuma/.rbenv/versions/2.5.1/lib/ruby/2.5.0/psych.rb:402:in `parse'

Testing result

BEFORE FIXNING

image

AFTER FIXNING

image

when

```
bundle exec rake
```

I found many same erros in test on development

```
...
Error: test_planet(TestFakerDune): I18n::InvalidLocaleData: can not load translations from /Users/yuma/projects/faker/lib/locales/en/vehicle.yml: #<Psych::SyntaxError: (/Users/yuma/projects/faker/lib/locales/en/vehicle.yml): found unknown escape character while parsing a quoted scalar at line 72 column 5413>
/Users/yuma/projects/faker/.bundle/ruby/2.5.0/gems/i18n-1.0.1/lib/i18n/backend/base.rb:234:in `rescue in load_yml'
/Users/yuma/projects/faker/.bundle/ruby/2.5.0/gems/i18n-1.0.1/lib/i18n/backend/base.rb:230:in `load_yml'
/Users/yuma/projects/faker/.bundle/ruby/2.5.0/gems/i18n-1.0.1/lib/i18n/backend/base.rb:215:in `load_file'
/Users/yuma/projects/faker/.bundle/ruby/2.5.0/gems/i18n-1.0.1/lib/i18n/backend/base.rb:17:in `block in load_translations'
/Users/yuma/projects/faker/.bundle/ruby/2.5.0/gems/i18n-1.0.1/lib/i18n/backend/base.rb:17:i
...
```

on development environment is

- ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-darwin17]
- mac OSX High Sierra
@stympy stympy merged commit c08964d into faker-ruby:master Jul 11, 2018
@vbrazo vbrazo changed the title Fix YAML syntax - single quote escape ( on vehicle.yml ) Fix YAML syntax - single quote escape (on vehicle.yml) Jul 11, 2018
@YumaInaura YumaInaura deleted the pynch_sytax_error branch July 12, 2018 04:59
@vbrazo vbrazo self-requested a review July 19, 2018 01:35
davidmorton0 pushed a commit to davidmorton0/faker that referenced this pull request Jul 12, 2021
when

```
bundle exec rake
```

I found many same erros in test on development

```
...
Error: test_planet(TestFakerDune): I18n::InvalidLocaleData: can not load translations from /Users/yuma/projects/faker/lib/locales/en/vehicle.yml: #<Psych::SyntaxError: (/Users/yuma/projects/faker/lib/locales/en/vehicle.yml): found unknown escape character while parsing a quoted scalar at line 72 column 5413>
/Users/yuma/projects/faker/.bundle/ruby/2.5.0/gems/i18n-1.0.1/lib/i18n/backend/base.rb:234:in `rescue in load_yml'
/Users/yuma/projects/faker/.bundle/ruby/2.5.0/gems/i18n-1.0.1/lib/i18n/backend/base.rb:230:in `load_yml'
/Users/yuma/projects/faker/.bundle/ruby/2.5.0/gems/i18n-1.0.1/lib/i18n/backend/base.rb:215:in `load_file'
/Users/yuma/projects/faker/.bundle/ruby/2.5.0/gems/i18n-1.0.1/lib/i18n/backend/base.rb:17:in `block in load_translations'
/Users/yuma/projects/faker/.bundle/ruby/2.5.0/gems/i18n-1.0.1/lib/i18n/backend/base.rb:17:i
...
```

on development environment is

- ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-darwin17]
- mac OSX High Sierra
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants