[issue35611] open doesn't call IncrementalEncoder with final=True
New submission from David Haney : The implementation of open relies on a codecs' IncrementalEncoder, however it never calls `encode` with final=True. This appears to violate the documentation for IncrementalEncoder.encode which states that the last call to encode _must_ set final=True. The attached test case demonstrates this behavior. A codec "delayed" is implemented that holds the last encoded string until the next call to `encode`, at which point it returns the encoded string. When final=True, both the previous and current string are returned. When `codecs.iterencode` is used to encode a sequence of strings, the encode function is called for each element in the sequence, with final=False. encode is then called a final time with an empty string and final=True. When `open` is used to open a file stream for the encoding, each call to `write` calls `encode` with final=False, however it never calls `encode` with final=True, and it doesn't appear there's an API for forcing it to occur (for instance `flush` and `close` do not). -- components: IO files: test.py messages: 332701 nosy: haney priority: normal severity: normal status: open title: open doesn't call IncrementalEncoder with final=True type: behavior versions: Python 3.7 Added file: https://bugs.python.org/file48022/test.py ___ Python tracker <https://bugs.python.org/issue35611> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue30183] [HPUX] compilation error in pytime.c with cc compiler
David Haney added the comment: I've attached the test output summary from a recent build. -- Added file: http://bugs.python.org/file46995/tests.out ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue30183> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue30183] [HPUX] compilation error in pytime.c with cc compiler
Changes by David Haney <david.ha...@gmail.com>: -- pull_requests: -2361 ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue30183> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue30183] [HPUX] compilation error in pytime.c with cc compiler
David Haney added the comment: I submitted a pull request for a possible fix for this issue but haven't received any feedback yet. Is there any additional information needed from me? -- pull_requests: +2361 ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue30183> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue30183] [HPUX] compilation error in pytime.c with cc compiler
Changes by David Haney <david.ha...@gmail.com>: -- pull_requests: +1463 ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue30183> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue30183] [HPUX] compilation error in pytime.c with cc compiler
David Haney added the comment: > It seems like gethrtime() is the right function to be used on HP-UX. > https://docstore.mik.ua/manuals/hp-ux/en/B2355-60130/gethrtime.3C.html Thanks, I'll work on getting a patch that leverages gethrtime() tested and submitted for review. -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue30183> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue30183] [HPUX] compilation error in pytime.c with cc compiler
New submission from David Haney: When compiling on HP-UX with the native cc compiler, the following compilation error occurs in pytime.c cc -Ae -c -O -O -I. -I./Include-DPy_BUILD_CORE -o Python/pytime.o Python/pytime.c "Python/pytime.c", line 723: error #2020: identifier "CLOCK_MONOTONIC" is undefined const clockid_t clk_id = CLOCK_MONOTONIC; ^ 1 error detected in the compilation of "Python/pytime.c". *** Error exit code 2 Stop. HP-UX does not support the CLOCK_MONOTONIC state. -- components: Build messages: 292397 nosy: David Haney priority: normal severity: normal status: open title: [HPUX] compilation error in pytime.c with cc compiler type: compile error versions: Python 3.5, Python 3.6, Python 3.7 ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue30183> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com