Project

General

Profile

Actions

Bug #19150

closed

pack/unpack silently ignores unknown directives

Added by Eregon (Benoit Daloze) over 1 year ago. Updated over 1 year ago.

Status:
Closed
Assignee:
-
Target version:
[ruby-core:111010]

Description

But I believe it should be an error instead.
Typically when a parser sees a syntax error it should fail not continue silently.

For instance [1].pack('<L') succeeds and only emits a warning if $VERBOSE is true.
This behavior caused confusion in https://github.com/oracle/truffleruby/issues/2791

I think it should fail with an ArgumentError instead.

Extracted from https://bugs.ruby-lang.org/issues/19108#note-3


Related issues 1 (0 open1 closed)

Related to Ruby master - Bug #19108: Format routines like pack blindly treat a string as ASCII-encodedClosedActions
Actions

Also available in: Atom PDF

Like1
Like0Like0Like0Like0Like1Like0Like0