Hacker News new | ask | show | jobs
by Thorrez 2284 days ago
Wow, very interesting! That sounds like a somewhat significant change, and I wonder how much stuff will be broken by it.

Although interestingly somehow I'm still seeing the old behavior in Debian Buster with glibc 2.28 with python3.

    import sys
    while True:
        b = sys.stdin.read(1)
        print(repr(b))
With old glibc with both python2 and python3 the EOF isn't sticky (as expected). With 2.28 with python2 the EOF is sticky (like you said). With 2.28 with python3 it's not sticky for some reason.
1 comments

In Python 3, file I/O is is implemented using POSIX read(), write() etc., rather than C stdio.
Interesting, and EOF on POSIX read() isn't supposed to be sticky?

That seems like a weird situation, that EOF is sticky in some cases but not others.