Hi Henrick,

Thanks for the excellent analysis.


On 31 March 2013 06:17, Henrik Bengtsson <[email protected]> wrote:

> Hi,
>
> it appears that asciidoc v8.6.8 have problems encoding image files if they
> have commas in their names; probably an issue with 'sys3'.
>
> EXAMPLE:
>
> C:\tmp>echo "image:foo,bar.png[]" > test.txt
>
> C:\tmp>cat test.txt
> image:foo,foo.png[]
>
> C:\tmp>dir "foo,bar.png"
> 03/30/2013  12:01 PM  2,494 note,foo.png
>
> C:\tmp>asciidoc test.txt
> ## <img src="foo,bar.png" alt="foo,bar.png" />
>
> C:\tmp>asciidoc -a data-uri test.txt
> The system cannot find the file specified.
> asciidoc: WARNING: test.txt: line 1: {sys3:"C:\Python27\python.exe" -u -c
> "import base64,sys; base64.encode(sys.stdin,sys.stdout)" <
> "C:\tmp\foo,bar.png"}: non-zero exit status
>
> Using an image filename without a comma and things work just fine.
>  (Before anyone suggests not to use commas in the first place; they are
>
>
> TROUBLESHOOTING:
> Making that system call at the command line does indeed work:
>
> C:\tmp>"C:\Python27\python.exe" -u -c "import base64,sys;
> base64.encode(sys.stdin,sys.stdout)" < "C:\tmp\foo,bar.png"
> iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABX[...]
> [...]yCoCXW14B8HLLvwDd67nwZIEPdgAAAABJRU5ErkJggg==
>
> Could it be that 'sys3' drops/does not pass the filename with quotes?
>  Indeed, when unquoting the filename I get the same error message as above;
>

Yes, on NT type operating systems only, the quotes that do not surround a
space are dropped, the comment in the code is:

# Remove redundant quoting -- this is not just
# cosmetic, unnecessary quoting appears to cause
# command line truncation.

It would appear that "unnecessary" is not just "without spaces" but
"without spaces or commas"?  Are there other characters that require
quoting?  I can't find any exact version of such definition, do you know
what it is?

Cheers
Lex



>
> C:\tmp>"C:\Python27\python.exe" -u -c "import base64,sys;
> base64.encode(sys.stdin,sys.stdout)" < C:\tmp\foo,bar.png
> The system cannot find the file specified.
>
> This may or may not be Windows only issue.
>
>
> SESSION INFO (Windows 7 64-bit Ultimate):
>
> > asciidoc --version
> asciidoc 8.6.8
>
> > "C:\Python27\python.exe" --version
> Python 2.7.4rc1
>
>
> Thanks,
>
> Henrik
>
> --
> You received this message because you are subscribed to the Google Groups
> "asciidoc" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/asciidoc?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"asciidoc" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/asciidoc?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to