Using \x22 works in the following context...

C:\tst>python -u -c "import sys; print 'foobar:\x22'; print
sys.stdin.readlines()" < "test.txt"
foobar:"
['foo\r\n', 'bar\r\n', 'baz']


Cheers,
Will


On 12 March 2014 03:11, Lex Trotman <[email protected]> wrote:

> On 12 March 2014 10:03, Lex Trotman <[email protected]> wrote:
> > [...]
> >> Second way to reproduce
> >>
> >> I also found the same issue outside of AsciiDoc, so I guess it is
> actually a
> >> Python problem.  I use a basic text file with a few lines in it.
> >>
> >> At the command line I run the following command successfully:
> >>
> >> C:\tst>python -u -c "import sys; print 'foobar:'; print
> >> sys.stdin.readlines()" < "test.txt"
> >> foobar:
> >> ['foo\r\n', 'bar\r\n', 'baz']
> >>
> >> However, including an escaped quote hangs:
> >>
> >> C:\tst>python -u -c "import sys; print 'foobar:\"'; print
> >> sys.stdin.readlines()" < "test.txt"
> >> foobar:"
> >
> > As you probably guessed, this works on Linux with Python 2.7.3.  So
> > the problem is either Python for Windows or Python 2.7.6.
> >
> > So if somebody can do further testing, eg 2.7.6 on Linux or other
> > versions on Windows the problem can be narrowed down and a Python bug
> > raised.
> >
> > Cheers
> > Lex
> >
> >>
> >> It only happens when trying to read from stdin though, as the following
> >> command works:
> >>
> >> C:\tst>python -u -c "import sys; print 'foobar:\"'; print
> sys.stdin.mode" <
> >> "test.txt"
> >> foobar:"
> >> r
> >>
>
> A suggestion from elsewhere is to replace \" with \x22 so the " isn't
> visible to the windows shell?
>
> I am a windows free zone, so maybe if you can try it.
>
> Cheers
> Lex
>
>
> >>
> >> Cheers,
> >> Will
> >>
> >> --
> >> 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.
> >> For more options, visit https://groups.google.com/d/optout.
>
> --
> 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.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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.
For more options, visit https://groups.google.com/d/optout.

Reply via email to