[issue46186] replace `io.IncrementalNewlineDecoder` with non incremental newline decoders

2022-01-27 Thread Guo Ci Teo


Guo Ci Teo  added the comment:

The old code has an incorrect usage of `io.IncrementalNewlineDecoder`. Since 
the `decode` method is called only once, is it the final call and needs the 
`final=True` argument as documented in 
https://docs.python.org/dev/library/codecs.html#codecs.IncrementalDecoder.decode

It happens that in those cases, the results are correct in spite of the 
incorrect usage.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46186] replace `io.IncrementalNewlineDecoder` with non incremental newline decoders

2022-01-23 Thread Jelle Zijlstra


Jelle Zijlstra  added the comment:

If the old code is incorrect, can you give an example where it fails? Is it 
possible to write a unit test demonstrating that the current behavior is wrong?

--
nosy: +Jelle Zijlstra

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46186] replace `io.IncrementalNewlineDecoder` with non incremental newline decoders

2022-01-01 Thread Guo Ci Teo


Guo Ci Teo  added the comment:

Some uses of the `decode` method of `io.IncrementalNewlineDecoder` were 
incorrect without the `final=True` argument.
One way to fix it would be to add the `final=True` in all cases.
But the incremental decoding feature is not used, so I decided to replace it 
with stateless non-incremental newline decoders.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46186] replace `io.IncrementalNewlineDecoder` with non incremental newline decoders

2022-01-01 Thread Éric Araujo

Éric Araujo  added the comment:

Can you describe what the problem is?
Is it incorrect in some cases?  Is it inefficient?

Without a statement of the issue, we can’t discuss a solution :)

--
nosy: +eric.araujo
versions: +Python 3.11

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46186] replace `io.IncrementalNewlineDecoder` with non incremental newline decoders

2021-12-27 Thread Guo Ci Teo


Guo Ci Teo  added the comment:

In any case, the use of an incremental newline decoder is not required

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46186] replace `io.IncrementalNewlineDecoder` with non incremental newline decoders

2021-12-27 Thread Guo Ci Teo


Change by Guo Ci Teo :


--
keywords: +patch
pull_requests: +28491
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30276

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46186] replace `io.IncrementalNewlineDecoder` with non incremental newline decoders

2021-12-27 Thread Guo Ci Teo


New submission from Guo Ci Teo :

replace unnecessary use of `io.IncrementalNewlineDecoder` in code.
Some uses of the `decode` method were also incorrect without the `final=True` 
argument.

--
messages: 409235
nosy: guoci
priority: normal
severity: normal
status: open
title: replace `io.IncrementalNewlineDecoder` with non incremental newline 
decoders

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com