ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
* [ruby-core:99513] [Ruby master Bug#17107] Backtick in backtrace is a little bit annoying
@ 2020-08-08  2:30 samuel
  2020-08-08  4:39 ` [ruby-core:99514] " hsbt
  2020-08-08  4:47 ` [ruby-core:99515] " sawadatsuyoshi
  0 siblings, 2 replies; 3+ messages in thread
From: samuel @ 2020-08-08  2:30 UTC (permalink / raw)
  To: ruby-core

Issue #17107 has been reported by ioquatix (Samuel Williams).

----------------------------------------
Bug #17107: Backtick in backtrace is a little bit annoying
https://bugs.ruby-lang.org/issues/17107

* Author: ioquatix (Samuel Williams)
* Status: Open
* Priority: Normal
* Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN
----------------------------------------
In Ruby exception backtrace (and other places), the method name uses a quoting style of a backtick followed by a text/name followed by an apostrophy.

```
in `<main>'
```

The quoting style is not safe, as in, it cannot be relied upon for parsing, because it's easy to inject quotes into the output stream:

e.g.

~~~
irb(main):006:0> self.send(:"I'm Great")
Traceback (most recent call last):
        4: from /tmp/64556713-b3a1-40a1-b458-bfed3fec55b2:8:in `<main>'
        3: from <internal:prelude>:20:in `irb'
        2: from /tmp/64556713-b3a1-40a1-b458-bfed3fec55b2:5:in `<main>'
        1: from /tmp/64556713-b3a1-40a1-b458-bfed3fec55b2:6:in `rescue in <main>'
NoMethodError (undefined method `I'm Great' for main:Object)
~~~

Note the last line now has ambiguous quoting.

- Should we fix this quoting style?
- Should we remove this quoting style?
- Should we choose some other quoting style?

As a specific point:

- Can we use two apostrophes rather than a backtick/apostrophe? Backticks often have a special meaning (e.g. markdown) which makes it somewhat annoying to copy and paste.






-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-08-08  4:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-08  2:30 [ruby-core:99513] [Ruby master Bug#17107] Backtick in backtrace is a little bit annoying samuel
2020-08-08  4:39 ` [ruby-core:99514] " hsbt
2020-08-08  4:47 ` [ruby-core:99515] " sawadatsuyoshi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).