Project

General

Profile

Actions

Bug #14932

closed

Puppet Strings JSON parsing error with UTF-8 vs US-ASCII (Encoding::InvalidByteSequenceError)

Added by Dominic Cleal almost 8 years ago. Updated almost 8 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

Description

When using kafo-export-params with the puppet-strings parser in an RPM build (which runs in a C locale), the JSON parsing can fail to read UTF-8 characters:

/usr/bin/kafo-export-params -c config/foreman.yaml -f asciidoc > /builddir/build/BUILD/foreman-installer-1.12.0/_build/options.asciidoc
D, [2016-05-05T09:15:31.144665 #11338] DEBUG -- : Using Puppet module parser KafoParsers::PuppetStringsModuleParser
/usr/share/gems/gems/json-1.8.3/lib/json/common.rb:155:in `encode': "\xE2" on US-ASCII (Encoding::InvalidByteSequenceError)
    from /usr/share/gems/gems/json-1.8.3/lib/json/common.rb:155:in `initialize'
    from /usr/share/gems/gems/json-1.8.3/lib/json/common.rb:155:in `new'
    from /usr/share/gems/gems/json-1.8.3/lib/json/common.rb:155:in `parse'
    from /usr/share/gems/gems/kafo_parsers-0.1.0/lib/kafo_parsers/puppet_strings_module_parser.rb:46:in `initialize'
    from /usr/share/gems/gems/kafo_parsers-0.1.0/lib/kafo_parsers/puppet_strings_module_parser.rb:12:in `new'
    from /usr/share/gems/gems/kafo_parsers-0.1.0/lib/kafo_parsers/puppet_strings_module_parser.rb:12:in `parse'
    from /usr/share/gems/gems/kafo-0.8.0/lib/kafo/puppet_module.rb:71:in `parse'
    from /usr/share/gems/gems/kafo-0.8.0/lib/kafo/configuration.rb:88:in `block in modules'
    from /usr/share/gems/gems/kafo-0.8.0/lib/kafo/configuration.rb:88:in `map'
    from /usr/share/gems/gems/kafo-0.8.0/lib/kafo/configuration.rb:88:in `modules'
    from /usr/share/gems/gems/kafo-0.8.0/bin/kafo-export-params:104:in `print_out'
    from /usr/share/gems/gems/kafo-0.8.0/bin/kafo-export-params:51:in `execute'
    from /usr/share/gems/gems/clamp-1.0.0/lib/clamp/command.rb:68:in `run'
    from /usr/share/gems/gems/clamp-1.0.0/lib/clamp/command.rb:133:in `run'
    from /usr/share/gems/gems/kafo-0.8.0/bin/kafo-export-params:155:in `<top (required)>'
    from /usr/bin/kafo-export-params:23:in `load'
    from /usr/bin/kafo-export-params:23:in `<main>'

A fix similar to #14473 might be possible for this parser.


Related issues 2 (0 open2 closed)

Related to Kafo - Bug #14473: invalid byte sequence in US-ASCII on UTF-8 manifests under C localeClosedDominic Cleal04/05/2016Actions
Blocks Packaging - Feature #14809: Build RPMs for Fedora 24ClosedDominic Cleal04/26/2016Actions
Actions #1

Updated by Dominic Cleal almost 8 years ago

  • Related to Bug #14473: invalid byte sequence in US-ASCII on UTF-8 manifests under C locale added
Actions #2

Updated by Dominic Cleal almost 8 years ago

Actions #3

Updated by The Foreman Bot almost 8 years ago

  • Status changed from Assigned to Ready For Testing
  • Pull request https://github.com/theforeman/kafo_parsers/pull/21 added
Actions #4

Updated by Dominic Cleal almost 8 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100
Actions

Also available in: Atom PDF