Project

General

Profile

Actions

Bug #19150

closed

pack/unpack silently ignores unknown directives

Added by Eregon (Benoit Daloze) over 1 year ago. Updated about 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 #1

Updated by Eregon (Benoit Daloze) over 1 year ago

  • Related to Bug #19108: Format routines like pack blindly treat a string as ASCII-encoded added

Updated by matz (Yukihiro Matsumoto) over 1 year ago

For 3.2 unknown directives always warn; for 3.3 they raise exceptions.

Matz.

Actions #4

Updated by mame (Yusuke Endoh) over 1 year ago

  • Status changed from Open to Closed

Applied in changeset git|ee7a338d2b21a84d194015c3680bd2a95c0dd23f.


Unconditionally warn "unknown pack/unpack directive"

[Bug #19150]

Updated by byroot (Jean Boussier) about 1 year ago

  • Status changed from Closed to Open

Reopening so we remember to make it raise in 3.3

Actions #6

Updated by Eregon (Benoit Daloze) about 1 year ago

  • Target version set to 3.3

Updated by Eregon (Benoit Daloze) about 1 year ago

  • Status changed from Open to Closed
  • Backport changed from 2.7: UNKNOWN, 3.0: UNKNOWN, 3.1: UNKNOWN to 2.7: DONTNEED, 3.0: DONTNEED, 3.1: DONTNEED
Actions

Also available in: Atom PDF

Like1
Like0Like0Like0Like0Like1Like0Like0