Your message dated Tue, 02 Jun 2015 12:03:46 +0200 with message-id <[email protected]> and subject line closing bugs against ancient python2.4 has caused the Debian Bug report #406834, regarding iterating over sys.stdin does not handle end of file correctly on a terminal to be marked as done.
This means that you claim that the problem has been dealt with. If this is not the case it is now your responsibility to reopen the Bug report if necessary, and/or fix the problem forthwith. (NB: If you are a system administrator and have no idea what this message is talking about, this may indicate a serious mail system misconfiguration somewhere. Please contact [email protected] immediately.) -- 406834: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=406834 Debian Bug Tracking System Contact [email protected] with problems
--- Begin Message ---Package: python2.4 Version: 2.4.4-1 Severity: normal Hello, compare these two scripts: import sys for line in sys.stdin.readlines(): print line and import sys for line in sys.stdin: print line when run on an interactive terminal, I get this: $ python test1 ciao <^D> ciao $ python test2 ciao <^D> ciao ^D $ When iterating over sys.stdin, the first end-of-file is ignored and another one is needed. This is the relevant strace output when the two ^D are needed: fstat(0, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 1), ...}) = 0 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2b0a17398000 read(0, "ciao\n", 8192) = 5 read(0, "", 7168) = 0 fstat(1, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 1), ...}) = 0 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2b0a17399000 write(1, "ciao\n", 5) = 5 write(1, "\n", 1) = 1 read(0, "", 8192) = 0 rt_sigaction(SIGINT, {SIG_DFL}, {0x4a0860, [], SA_RESTORER, 0x2b0a16b6e410}, 8) = 0 futex(0x625660, FUTEX_WAKE, 1) = 0 futex(0x6252a0, FUTEX_WAKE, 1) = 0 futex(0x6252a0, FUTEX_WAKE, 1) = 0 futex(0x6252a0, FUTEX_WAKE, 1) = 0 munmap(0x2b0a17399000, 4096) = 0 exit_group(0) = ? You can see that the second read returns 0 bytes, but end of file is not detected another read is attempted again. When redirecting a file to stdin there is of course no problem because the second read would normally fail without anyone noticing. Ciao, Enrico -- System Information: Debian Release: 4.0 APT prefers testing APT policy: (500, 'testing') Architecture: amd64 (x86_64) Shell: /bin/sh linked to /bin/bash Kernel: Linux 2.6.19.1enrico Locale: LANG=it_IT.UTF-8, LC_CTYPE=it_IT.UTF-8 (charmap=UTF-8) Versions of packages python2.4 depends on: ii libbz2-1.0 1.0.3-6 high-quality block-sorting file co ii libc6 2.3.6.ds1-8 GNU C Library: Shared libraries ii libdb4.4 4.4.20-8 Berkeley v4.4 Database Libraries [ ii libncursesw5 5.5-5 Shared libraries for terminal hand ii libreadline5 5.2-2 GNU readline and history libraries ii libssl0.9.8 0.9.8c-4 SSL shared libraries ii mime-support 3.39-1 MIME files 'mime.types' & 'mailcap ii python2.4-minimal 2.4.4-1 A minimal subset of the Python lan python2.4 recommends no packages. -- no debconf information
--- End Message ---
--- Begin Message ---python2.4 has been obsoleted in Debian long ago. I'm now closing the remaining bugs against this ancient version, assuming they have been fixed (or became irrelevant) in newer releases. Feel free to provide more information and reopen the bugs if they are still reproducible in the current versions (python2.7, python3.x). Andreas
--- End Message ---

