Does verbose switch work in 1.5.0?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

Does verbose switch work in 1.5.0?

5haun
I was attempting to identify the following error, and discovered --verbose appears to do NOTHING.

/var/lib/gems/1.9.1/gems/asciidoctor-1.5.0/lib/asciidoctor/substitutors.rb:360:in `gsub': invalid byte sequence in UTF-8 (ArgumentError)
        from /var/lib/gems/1.9.1/gems/asciidoctor-1.5.0/lib/asciidoctor/substitutors.rb:360:in `sub_specialcharacters'
        from /var/lib/gems/1.9.1/gems/asciidoctor-1.5.0/lib/asciidoctor/substitutors.rb:110:in `block in apply_subs'
        from /var/lib/gems/1.9.1/gems/asciidoctor-1.5.0/lib/asciidoctor/substitutors.rb:107:in `each'
        from /var/lib/gems/1.9.1/gems/asciidoctor-1.5.0/lib/asciidoctor/substitutors.rb:107:in `apply_subs'
        from /var/lib/gems/1.9.1/gems/asciidoctor-1.5.0/lib/asciidoctor/block.rb:86:in `content'
        from /var/lib/gems/1.9.1/gems/asciidoctor-1.5.0/lib/asciidoctor/converter/html5.rb:581:in `literal'
        from /var/lib/gems/1.9.1/gems/asciidoctor-1.5.0/lib/asciidoctor/converter/base.rb:26:in `convert'
        from /var/lib/gems/1.9.1/gems/asciidoctor-1.5.0/lib/asciidoctor/abstract_block.rb:70:in `convert'
        from /var/lib/gems/1.9.1/gems/asciidoctor-1.5.0/lib/asciidoctor/abstract_block.rb:79:in `block in content'
        from /var/lib/gems/1.9.1/gems/asciidoctor-1.5.0/lib/asciidoctor/abstract_block.rb:79:in `map'
        from /var/lib/gems/1.9.1/gems/asciidoctor-1.5.0/lib/asciidoctor/abstract_block.rb:79:in `content'
        from /var/lib/gems/1.9.1/gems/asciidoctor-1.5.0/lib/asciidoctor/converter/html5.rb:317:in `section'
        from /var/lib/gems/1.9.1/gems/asciidoctor-1.5.0/lib/asciidoctor/converter/base.rb:26:in `convert'
        from /var/lib/gems/1.9.1/gems/asciidoctor-1.5.0/lib/asciidoctor/abstract_block.rb:70:in `convert'
        from /var/lib/gems/1.9.1/gems/asciidoctor-1.5.0/lib/asciidoctor/abstract_block.rb:79:in `block in content'
        from /var/lib/gems/1.9.1/gems/asciidoctor-1.5.0/lib/asciidoctor/abstract_block.rb:79:in `map'
        from /var/lib/gems/1.9.1/gems/asciidoctor-1.5.0/lib/asciidoctor/abstract_block.rb:79:in `content'
        from /var/lib/gems/1.9.1/gems/asciidoctor-1.5.0/lib/asciidoctor/document.rb:1068:in `content'
        from /var/lib/gems/1.9.1/gems/asciidoctor-1.5.0/lib/asciidoctor/converter/html5.rb:205:in `document'
        from /var/lib/gems/1.9.1/gems/asciidoctor-1.5.0/lib/asciidoctor/converter/base.rb:26:in `convert'
        from /var/lib/gems/1.9.1/gems/asciidoctor-1.5.0/lib/asciidoctor/document.rb:1010:in `convert'
        from /var/lib/gems/1.9.1/gems/asciidoctor-1.5.0/lib/asciidoctor.rb:1459:in `convert'
        from /var/lib/gems/1.9.1/gems/asciidoctor-1.5.0/lib/asciidoctor/cli/invoker.rb:93:in `block in invoke!'
        from /var/lib/gems/1.9.1/gems/asciidoctor-1.5.0/lib/asciidoctor/cli/invoker.rb:85:in `each'
        from /var/lib/gems/1.9.1/gems/asciidoctor-1.5.0/lib/asciidoctor/cli/invoker.rb:85:in `invoke!'
        from /var/lib/gems/1.9.1/gems/asciidoctor-1.5.0/bin/asciidoctor:10:in `<top (required)>'
        from /usr/local/bin/asciidoctor:19:in `load'
        from /usr/local/bin/asciidoctor:19:in `<main>'

I am passing the asciidoc text into asciidoctor 1.5.0 using a STDIN pipe on Ubuntu 12.04.
$ my_asciidoc_producer | asciidoctor - -d book -v
I also tried --verbose.  Neither appear to provide anything, let alone a line-by-line trace.

Suggestions?  (other than to split the 7400 lines of input into smaller chunks)

Thanks,
-Shaun
Reply | Threaded
Open this post in threaded view
|

Re: Does verbose switch work in 1.5.0?

LightGuardjp
It looks like your file has the wrong BOM for a UTF-8 file.


On Wed, Aug 20, 2014 at 8:47 AM, 5haun [via Asciidoctor :: Discussion] <[hidden email]> wrote:
I was attempting to identify the following error, and discovered --verbose appears to do NOTHING.

/var/lib/gems/1.9.1/gems/asciidoctor-1.5.0/lib/asciidoctor/substitutors.rb:360:in `gsub': invalid byte sequence in UTF-8 (ArgumentError)
        from /var/lib/gems/1.9.1/gems/asciidoctor-1.5.0/lib/asciidoctor/substitutors.rb:360:in `sub_specialcharacters'
        from /var/lib/gems/1.9.1/gems/asciidoctor-1.5.0/lib/asciidoctor/substitutors.rb:110:in `block in apply_subs'
        from /var/lib/gems/1.9.1/gems/asciidoctor-1.5.0/lib/asciidoctor/substitutors.rb:107:in `each'
        from /var/lib/gems/1.9.1/gems/asciidoctor-1.5.0/lib/asciidoctor/substitutors.rb:107:in `apply_subs'
        from /var/lib/gems/1.9.1/gems/asciidoctor-1.5.0/lib/asciidoctor/block.rb:86:in `content'
        from /var/lib/gems/1.9.1/gems/asciidoctor-1.5.0/lib/asciidoctor/converter/html5.rb:581:in `literal'
        from /var/lib/gems/1.9.1/gems/asciidoctor-1.5.0/lib/asciidoctor/converter/base.rb:26:in `convert'
        from /var/lib/gems/1.9.1/gems/asciidoctor-1.5.0/lib/asciidoctor/abstract_block.rb:70:in `convert'
        from /var/lib/gems/1.9.1/gems/asciidoctor-1.5.0/lib/asciidoctor/abstract_block.rb:79:in `block in content'
        from /var/lib/gems/1.9.1/gems/asciidoctor-1.5.0/lib/asciidoctor/abstract_block.rb:79:in `map'
        from /var/lib/gems/1.9.1/gems/asciidoctor-1.5.0/lib/asciidoctor/abstract_block.rb:79:in `content'
        from /var/lib/gems/1.9.1/gems/asciidoctor-1.5.0/lib/asciidoctor/converter/html5.rb:317:in `section'
        from /var/lib/gems/1.9.1/gems/asciidoctor-1.5.0/lib/asciidoctor/converter/base.rb:26:in `convert'
        from /var/lib/gems/1.9.1/gems/asciidoctor-1.5.0/lib/asciidoctor/abstract_block.rb:70:in `convert'
        from /var/lib/gems/1.9.1/gems/asciidoctor-1.5.0/lib/asciidoctor/abstract_block.rb:79:in `block in content'
        from /var/lib/gems/1.9.1/gems/asciidoctor-1.5.0/lib/asciidoctor/abstract_block.rb:79:in `map'
        from /var/lib/gems/1.9.1/gems/asciidoctor-1.5.0/lib/asciidoctor/abstract_block.rb:79:in `content'
        from /var/lib/gems/1.9.1/gems/asciidoctor-1.5.0/lib/asciidoctor/document.rb:1068:in `content'
        from /var/lib/gems/1.9.1/gems/asciidoctor-1.5.0/lib/asciidoctor/converter/html5.rb:205:in `document'
        from /var/lib/gems/1.9.1/gems/asciidoctor-1.5.0/lib/asciidoctor/converter/base.rb:26:in `convert'
        from /var/lib/gems/1.9.1/gems/asciidoctor-1.5.0/lib/asciidoctor/document.rb:1010:in `convert'
        from /var/lib/gems/1.9.1/gems/asciidoctor-1.5.0/lib/asciidoctor.rb:1459:in `convert'
        from /var/lib/gems/1.9.1/gems/asciidoctor-1.5.0/lib/asciidoctor/cli/invoker.rb:93:in `block in invoke!'
        from /var/lib/gems/1.9.1/gems/asciidoctor-1.5.0/lib/asciidoctor/cli/invoker.rb:85:in `each'
        from /var/lib/gems/1.9.1/gems/asciidoctor-1.5.0/lib/asciidoctor/cli/invoker.rb:85:in `invoke!'
        from /var/lib/gems/1.9.1/gems/asciidoctor-1.5.0/bin/asciidoctor:10:in `<top (required)>'
        from /usr/local/bin/asciidoctor:19:in `load'
        from /usr/local/bin/asciidoctor:19:in `<main>'

I am passing the asciidoc text into asciidoctor 1.5.0 using a STDIN pipe on Ubuntu 12.04.
$ my_asciidoc_producer | asciidoctor - -d book -v
I also tried --verbose.  Neither appear to provide anything, let alone a line-by-line trace.

Suggestions?  (other than to split the 7400 lines of input into smaller chunks)

Thanks,
-Shaun


If you reply to this email, your message will be added to the discussion below:
http://discuss.asciidoctor.org/Does-verbose-switch-work-in-1-5-0-tp2023.html
To start a new topic under Asciidoctor :: Discussion, email [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML



--
Reply | Threaded
Open this post in threaded view
|

Re: Does verbose switch work in 1.5.0?

5haun
@Jason.  Thanks for the quick reply.

I wrapped some of the input as listing blocks, and got no errors and no crash, but I also still don't get any output for the verbose flags.  

So, one of the blocks obviously has a bad sequence of characters in it (something likely needs to be wrapped in code tags).

I'd still like to know how to have asciidoctor list the input line it is on as it parses them.

Thanks,
-Shaun
Reply | Threaded
Open this post in threaded view
|

Re: Does verbose switch work in 1.5.0?

5haun
In reply to this post by LightGuardjp
Jason was correct on the BOM being wrong.  The producer is a Perl script.  Adding this to the Perl script fixed the crash.

     binmode(STDIN,  ":utf8");
     binmode(STDOUT, ":utf8");
     binmode(STDERR, ":utf8");

Thanks Jason!!!!!
-Shaun
Reply | Threaded
Open this post in threaded view
|

Re: Does verbose switch work in 1.5.0?

mojavelinux
Administrator

I am desperately trying to track down a reproducible error for this encoding bug so I can actually write a test for it. Would you be able to describe how you make it happen in a simple document, including the platform & Ruby version you are using? I've been unable to get it to happen on my machine so far.

Thanks!

-Dan

Reply | Threaded
Open this post in threaded view
|

Re: Does verbose switch work in 1.5.0?

mojavelinux
Administrator
In reply to this post by 5haun

To answer the other question, verbose only controls the output of log statements, so you don't get much more by turning it on. --trace gives you the stacktrace.

Reply | Threaded
Open this post in threaded view
|

Re: Does verbose switch work in 1.5.0?

5haun
In reply to this post by mojavelinux
Dan,

Thanks for the info on verbose.  A line-by-line trace (like -x in bash) would be a nice enhancement.

I got with the engineer that produced the source document that caused the encoding error.  He had cut/paste some text from a remotely viewed manpage into an editor.  We think it might be nano via putty, but are not sure; however, I managed to find some unprintable characters in the source document where he pasted using vim, so pretty sure it is the source, I think I can put together a small test to reproduce the issue.  I'll work on it later this afternoon and if successful I'll post what you need as a small zip (I'll let you know in either case).

Thanks,
-Shaun
Reply | Threaded
Open this post in threaded view
|

Re: Does verbose switch work in 1.5.0?

mojavelinux
Administrator

On Wed, Aug 20, 2014 at 1:28 PM, 5haun [via Asciidoctor :: Discussion] <[hidden email]> wrote:
I got with the engineer that produced the source document that caused the encoding error.  He had cut/paste some text from a remotely viewed manpage into an editor.  We think it might be nano via putty, but are not sure; however, I managed to find some unprintable characters in the source document where he pasted using vim, so pretty sure it is the source, I think I can put together a small test to reproduce the issue.  I'll work on it later this afternoon and if successful I'll post what you need as a small zip (I'll let you know in either case).

Great! That would be so helpful. Failures are a welcomed sight in this case :)

Reply | Threaded
Open this post in threaded view
|

Re: Does verbose switch work in 1.5.0?

mojavelinux
Administrator
In reply to this post by 5haun

On Wed, Aug 20, 2014 at 1:28 PM, 5haun [via Asciidoctor :: Discussion] <[hidden email]> wrote:
A line-by-line trace (like -x in bash) would be a nice enhancement.

The Ruby and JVM works take a very different approach to this problem. Debugging and VM monitors are the preferred approach. I'm not aware of anything on the cli that matches what bash -x provides. Maybe pry.