The Puppet Labs Issue Tracker has Moved: https://tickets.puppetlabs.com

Bug #15190

iconv will be deprecated, used in pson/json_pure lib

Added by Dominic Cleal almost 2 years ago. Updated over 1 year ago.

Status:ClosedStart date:06/24/2012
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:ruby19
Target version:3.0.0
Affected Puppet version:2.7.17 Branch:https://github.com/puppetlabs/puppet/pull/1151
Keywords:

We've Moved!

Ticket tracking is now hosted in JIRA: https://tickets.puppetlabs.com

This issue is currently not available for export. If you are experiencing the issue described below, please file a new ticket in JIRA. Once a new ticket has been created, please add a link to it that points back to this Redmine ticket.


Description

While running Puppet on Fedora 17 with ruby 1.9.3p194, there are many warnings printed by ruby:

/usr/share/rubygems/rubygems/custom_require.rb:36:in `require': iconv will be deprecated in the future, use String#encode instead.

This seems to be caused by the pson (json_pure) library in lib/puppet/external/pson/pure.rb, that still uses iconv:

module PSON
  begin
    require 'iconv'
    # An iconv instance to convert from UTF8 to UTF16 Big Endian.
    UTF16toUTF8 = Iconv.new('utf-8', 'utf-16be') # :nodoc:

This can be shown by changing the require line so the iconv library doesn’t load (forcing the rescue path), then the deprecation warnings disappear.

Originally filed in Fedora as #809911.


Related issues

Duplicated by Puppet - Bug #20587: [Debian 7 Wheezy] custom_require.rb:36:in `require': icon... Duplicate

History

#1 Updated by eric sorenson over 1 year ago

  • Status changed from Unreviewed to Accepted
  • Assignee set to Andrew Parker

Hey, we were just talking about 1.9.x support.

#2 Updated by Ben Hughes over 1 year ago

This hit me last week, when I was trying to use puppet parser validate under ruby 1.9.3… Can I help with this?

#3 Updated by Andrew Parker over 1 year ago

This is a really interesting issue the encoding translation changed between ruby 1.8 and ruby 1.9 from iconv to String#encode. The iconv code is used for UTF-8 to UTF-16 translation and for UTF-16 to UTF-8 translation, but I can only find a use of the UTF-16 to UTF-8. With some refactoring a lot of this might just disappear and leave something that we can easily make a shim for supporting both versions of ruby.

#4 Updated by Andrew Parker over 1 year ago

This was dealt with in the json/pure code with https://github.com/flori/json/blob/master/lib/json/common.rb#L408

#5 Updated by Daniel Pittman over 1 year ago

  • Status changed from Accepted to In Topic Branch Pending Review
  • Assignee deleted (Andrew Parker)
  • Branch set to https://github.com/puppetlabs/puppet/pull/1151

#6 Updated by Josh Cooper over 1 year ago

  • Status changed from In Topic Branch Pending Review to Merged - Pending Release
  • Target version set to 3.0.0

Merged into 3.x in commit ed45ae8daa7ee929f59fe4502642483becd9a59e

#7 Updated by Moses Mendoza over 1 year ago

  • Status changed from Merged - Pending Release to Closed

released in 3.0.0-rc7

Also available in: Atom PDF