Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Panic on escaped double quote string literal #273

Closed
karuna opened this issue Mar 23, 2018 · 6 comments
Closed

Panic on escaped double quote string literal #273

karuna opened this issue Mar 23, 2018 · 6 comments

Comments

@karuna
Copy link

karuna commented Mar 23, 2018

rustc 1.26.0-nightly (75af15ee6 2018-03-20)

thread 'main' panicked at 'launch fairing failure', /home/karuna/.cargo/git/checkouts/rocket-8bf16d9ca7e90bdc/b0fc8b3/lib/src/error.rs:224:17
stack backtrace:
   0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace
             at libstd/sys/unix/backtrace/tracing/gcc_s.rs:49
   1: std::sys_common::backtrace::print
             at libstd/sys_common/backtrace.rs:71
             at libstd/sys_common/backtrace.rs:59
   2: std::panicking::default_hook::{{closure}}
             at libstd/panicking.rs:207
   3: std::panicking::default_hook
             at libstd/panicking.rs:223
   4: std::panicking::rust_panic_with_hook
             at libstd/panicking.rs:402
   5: std::panicking::begin_panic
             at /checkout/src/libstd/panicking.rs:365
   6: <rocket::error::LaunchError as core::ops::drop::Drop>::drop
             at /home/karuna/.cargo/git/checkouts/rocket-8bf16d9ca7e90bdc/b0fc8b3/lib/src/error.rs:224
   7: core::ptr::drop_in_place
             at /checkout/src/libcore/ptr.rs:59
   8: hangar_runner::main
             at src/main.rs:5
   9: std::rt::lang_start::{{closure}}
             at /checkout/src/libstd/rt.rs:74
  10: std::panicking::try::do_call
             at libstd/rt.rs:59
             at libstd/panicking.rs:306
  11: __rust_maybe_catch_panic
             at libpanic_unwind/lib.rs:102
  12: std::rt::lang_start_internal
             at libstd/panicking.rs:285
             at libstd/panic.rs:361
             at libstd/rt.rs:58
  13: std::rt::lang_start
             at /checkout/src/libstd/rt.rs:74
  14: main
  15: __libc_start_main
  16: _start
{{"hangar new --name test_app --author \"Will Smoth <will_s@example.com>\" --database sqlite --database-url=test_app.sqlite
cd test_app"}}
@karuna
Copy link
Author

karuna commented Mar 23, 2018

If I put string literal with escaped double quote \" it will cause panic.

@Keats
Copy link
Owner

Keats commented Mar 23, 2018

Tera actually doesn't support escaped quotes currently.

However it supports several type of strings so your example can be written {{'hangar new --name test_app --author "Will Smoth <will_s@example.com>" --database sqlite --database-url=test_app.sqlite cd test_app' }}.

However (bis), this is currently broken on 0.11.5 but I've fixed it yesterday so it should be part of 0.11.6 to be released this weekend.

Another question is that parsing that template should give an error, not a panic. Is your code using unwrap somewhere?

@karuna
Copy link
Author

karuna commented Mar 24, 2018

Hi @Keats , using single quote works, but it show different result than double quote

screenshot_20180324_110623

The single quote showing and double quote missing.

I'm using rocket so I think the panic is because somewhere in the rocket's code. I'll debug and maybe fix the problem there

@Keats
Copy link
Owner

Keats commented Mar 24, 2018

That error is the "However (bis)" in my previous message, you can try the current master branch and it should work

@Keats
Copy link
Owner

Keats commented Mar 25, 2018

I just published 0.11.6 which should fix the bug you had above

@karuna
Copy link
Author

karuna commented Mar 25, 2018

It works with single quote. Thank you

@karuna karuna closed this as completed Mar 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants