Project

General

Profile

Actions

Bug #13093

closed

JSON Parse

Bug #13093: JSON Parse

Added by hfr1994 (Hector Flores) almost 9 years ago. Updated almost 9 years ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-linux]
[ruby-core:78934]

Description

When trying to parse a JSON file from the following format:

[ {"original":"yahoo.fr","replace":"yahoo.fr"}, {"original":"zahnen.cl","replace":"zahnen.cl"}, {"original":"zzion.cl","replace":"zzion.cl"} ] 

using the following code:

file=remplace_template def replace_template # Reads the file file=File.read 'replaces.json' JSON.parse(file,{symbolize_names: true, object_class: true}) end 

I got the attached error file


Files

error.log (19.9 KB) error.log This is what I got in console hfr1994 (Hector Flores), 01/01/2017 10:35 PM

Updated by nobu (Nobuyoshi Nakada) almost 9 years ago Actions #1 [ruby-core:78935]

  • Description updated (diff)
  • Status changed from Open to Feedback

I got a NameError.

-:1:in `<main>': undefined local variable or method `remplace_template' for main:Object (NameError) 

Updated by nobu (Nobuyoshi Nakada) almost 9 years ago Actions #2

  • Status changed from Feedback to Closed

Applied in changeset r57249.


object.c: rb_class_s_new

  • object.c (rb_class_new_instance): add pathological check of
    klass for extension libraries which do not check given arguments
    properly. [ruby-core:78934] [Bug #13093]
Actions

Also available in: PDF Atom