I'll make these changes later this week and submit another pull request.


2014-06-03 10:50 GMT-06:00 Thomas Kluyver <notifications@github.com>:

> In pexpect/__init__.py:
>
> > @@ -970,9 +970,10 @@ def readline(self, size=-1):
> >          if size == 0:
> >              return self.string_type()
> >          # delimiter default is EOF
> > -        index = self.expect([b'\r\n', self.delimiter])
> > +        line_ending = b'\r\n' if self.string_type == bytes else '\r\n'
>
> Unfortunately, this doesn't work on Python 2, because both alternatives
> are bytes. And we can't use u'' literals until we drop Python 3.2 support
> (soon, but not yet).
>
> Actually, we already have a self.linesep variable which contains \n as
> the appropriate bytes/unicode value. I think we should just make self.crlf
> as a similar class-level variable.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/pexpect/pexpect/pull/67/files#r13345313>.
>