[issue14014] codecs.StreamWriter.reset contract not fulfilled

2021-01-05 Thread Berker Peksag


Change by Berker Peksag :


--
assignee:  -> docs@python
components:  -Unicode
nosy: +docs@python -vstinner

___
Python tracker 

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



[issue14014] codecs.StreamWriter.reset contract not fulfilled

2021-01-05 Thread Berker Peksag


Change by Berker Peksag :


--
assignee: lemburg -> 
components: +Documentation
nosy: +vstinner
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
versions: +Python 3.10 -Python 3.8

___
Python tracker 

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



[issue14014] codecs.StreamWriter.reset contract not fulfilled

2021-01-05 Thread Berker Peksag


Berker Peksag  added the comment:


New changeset a3ca6747f50efa2fe59caf516a26b0fd1912b8e8 by Miss Islington (bot) 
in branch '3.9':
bpo-14014: Clarify StreamWriter.reset() documentation (GH-13716)
https://github.com/python/cpython/commit/a3ca6747f50efa2fe59caf516a26b0fd1912b8e8


--

___
Python tracker 

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



[issue14014] codecs.StreamWriter.reset contract not fulfilled

2021-01-05 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 6.0 -> 7.0
pull_requests: +22966
pull_request: https://github.com/python/cpython/pull/24136

___
Python tracker 

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



[issue14014] codecs.StreamWriter.reset contract not fulfilled

2021-01-05 Thread Berker Peksag


Berker Peksag  added the comment:


New changeset 1a9f51ed12feb4d95ad6d0faf610a030c05b9f5e by Berker Peksag in 
branch 'master':
bpo-14014: Clarify StreamWriter.reset() documentation (GH-13716)
https://github.com/python/cpython/commit/1a9f51ed12feb4d95ad6d0faf610a030c05b9f5e


--
nosy: +berker.peksag

___
Python tracker 

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



[issue14014] codecs.StreamWriter.reset contract not fulfilled

2020-01-15 Thread STINNER Victor


Change by STINNER Victor :


--
nosy:  -vstinner

___
Python tracker 

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



[issue14014] codecs.StreamWriter.reset contract not fulfilled

2020-01-12 Thread Cheryl Sabella


Cheryl Sabella  added the comment:

@lemburg, when you get a chance, please review the PR.  Thanks!

--
assignee:  -> lemburg
nosy: +cheryl.sabella
versions: +Python 3.8, Python 3.9 -Python 3.4, Python 3.5

___
Python tracker 

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



[issue14014] codecs.StreamWriter.reset contract not fulfilled

2019-05-31 Thread Berker Peksag


Change by Berker Peksag :


--
pull_requests: +13603
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/13716

___
Python tracker 

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



[issue14014] codecs.StreamWriter.reset contract not fulfilled

2019-04-26 Thread Mark Lawrence


Change by Mark Lawrence :


--
nosy:  -BreamoreBoy

___
Python tracker 

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



[issue14014] codecs.StreamWriter.reset contract not fulfilled

2015-01-14 Thread Marc-Andre Lemburg

Marc-Andre Lemburg added the comment:

On 14.01.2015 02:21, Martin Panter wrote:
 
 Martin Panter added the comment:
 
 I don’t think this is appropriate. If you want to flush the underlying 
 stream, then call its flush() method after calling reset(). The docstring 
 only says it flushes the _codec’s_ buffers, not any buffers of the underlying 
 stream, and it should not be the codec’s business to worry about lower level 
 buffers.

Correct. That's the reason why the method is called .reset() and
not .flush().

--
nosy: +lemburg

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



Re: [issue14014] codecs.StreamWriter.reset contract not fulfilled

2015-01-14 Thread M.-A. Lemburg
Adding a note to the documentation is fine.

The .reset() method doesn't have anything to do with the underlying
stream. It's only meant to work at the codec level and needed for
codecs that keep internal state.

-- 
Marc-Andre Lemburg
eGenix.com

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



[issue14014] codecs.StreamWriter.reset contract not fulfilled

2015-01-13 Thread Martin Panter

Martin Panter added the comment:

I don’t think this is appropriate. If you want to flush the underlying stream, 
then call its flush() method after calling reset(). The docstring only says it 
flushes the _codec’s_ buffers, not any buffers of the underlying stream, and it 
should not be the codec’s business to worry about lower level buffers.

--
nosy: +vadmium

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



[issue14014] codecs.StreamWriter.reset contract not fulfilled

2015-01-13 Thread Jim Jewett

Jim Jewett added the comment:

That sounds like a bug magnet to me; my mental model is that the codec
is my output; flushing it will push things out, and resetting it will
erase anything pending.  I don't care if some implementation detail
means that some other object technically owns the buffer.

An alternative (inferior, but better than nothing) would be to add an
explicit note warning users that reset won't really finish the job,
and they have to also get the codec's underlying stream and flush
that.  (Of course, if the stream is really an abstraction over the
real stream ... at what point does the delegation start to work on its
own?)

On Tue, Jan 13, 2015 at 8:21 PM, Martin Panter rep...@bugs.python.org wrote:

 Martin Panter added the comment:

 I don’t think this is appropriate. If you want to flush the underlying 
 stream, then call its flush() method after calling reset(). The docstring 
 only says it flushes the _codec’s_ buffers, not any buffers of the underlying 
 stream, and it should not be the codec’s business to worry about lower level 
 buffers.

 --
 nosy: +vadmium

 ___
 Python tracker rep...@bugs.python.org
 http://bugs.python.org/issue14014
 ___

--

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



[issue14014] codecs.StreamWriter.reset contract not fulfilled

2015-01-13 Thread Martin Panter

Martin Panter added the comment:

Maybe it would be better to redefine the docstring to say it flushes the codec 
as well as calling flush() on the underlying stream.

But if you really want to finish the job you should probably be closing the 
underlying stream, which would flush if necessary. See Issue 460474, for adding 
a close() method which invokes reset().

--

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



[issue14014] codecs.StreamWriter.reset contract not fulfilled

2014-07-03 Thread Mark Lawrence

Mark Lawrence added the comment:

On Windows 7 206 codecs tests passed and 4 skipped with the patch included.

--
keywords: +patch
nosy: +BreamoreBoy
versions: +Python 3.4, Python 3.5 -Python 3.2, Python 3.3
Added file: http://bugs.python.org/file35840/Issue14014.diff

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



[issue14014] codecs.StreamWriter.reset contract not fulfilled

2012-02-14 Thread Jim Jewett

New submission from Jim Jewett jimjjew...@gmail.com:

def reset(self):

 Flushes and resets the codec buffers used for keeping state.

Calling this method should ensure that the data on the
output is put into a clean state, that allows appending
of new fresh data without having to rescan the whole
stream to recover state.


pass

This does not ensure that the stream is flushed, as the docstring promises.  I 
believe the following would work better.


def reset(self):
 Flushes and resets the codec buffers used for keeping state.

Calling this method should ensure that the data on the
output is put into a clean state, that allows appending
of new fresh data without having to rescan the whole
stream to recover state.


if hasattr(self.stream, flush): self.stream.flush()

--
components: Unicode
messages: 153354
nosy: Jim.Jewett, ezio.melotti
priority: normal
severity: normal
status: open
title: codecs.StreamWriter.reset contract not fulfilled
type: behavior
versions: Python 3.2

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14014
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14014] codecs.StreamWriter.reset contract not fulfilled

2012-02-14 Thread Antoine Pitrou

Changes by Antoine Pitrou pit...@free.fr:


--
nosy: +haypo
versions: +Python 3.3

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14014
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com