[issue26335] Make mmap.write return the number of bytes written like other write methods

2016-03-02 Thread Jakub Stasiak

Jakub Stasiak added the comment:

Glad I could help, thanks for merging!

--

___
Python tracker 

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



[issue26335] Make mmap.write return the number of bytes written like other write methods

2016-03-02 Thread Berker Peksag

Berker Peksag added the comment:

Thanks for the patch, Jakub!

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

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



[issue26335] Make mmap.write return the number of bytes written like other write methods

2016-03-02 Thread Roundup Robot

Roundup Robot added the comment:

New changeset ba71aecec943 by Berker Peksag in branch 'default':
Issue #26335: Make mmap.write() return the number of bytes written like
https://hg.python.org/cpython/rev/ba71aecec943

--
nosy: +python-dev

___
Python tracker 

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



[issue26335] Make mmap.write return the number of bytes written like other write methods

2016-02-25 Thread Jakub Stasiak

Jakub Stasiak added the comment:

Thank you. I didn't know whether to add an entry to Doc/whatsnew/3.6.rst, 
Misc/NEWS or both so I chose both, feel free to modify/remove as needed.

The new patch also doesn't have a typo in the versionchanged directive present 
in the version 2. I noticed more typos like this (single colon instead of 
double colon), I'll create a separate issue.

--
Added file: http://bugs.python.org/file42026/mmap_write_return_count3.patch

___
Python tracker 

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



[issue26335] Make mmap.write return the number of bytes written like other write methods

2016-02-23 Thread Martin Panter

Martin Panter added the comment:

Patch looks okay to me. I guess it would be good to write a What’s New entry as 
well.

--
nosy: +martin.panter

___
Python tracker 

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



[issue26335] Make mmap.write return the number of bytes written like other write methods

2016-02-23 Thread Jakub Stasiak

Jakub Stasiak added the comment:

Oops, sorry for the silliness in the C code, thanks for reviewing. I modified 
as suggested, please find the new patch attached.

--
Added file: http://bugs.python.org/file42014/mmap_write_return_count2.patch

___
Python tracker 

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



[issue26335] Make mmap.write return the number of bytes written like other write methods

2016-02-22 Thread Berker Peksag

Berker Peksag added the comment:

Thanks for the patch, Jakub. I don't use mmap module much so I don't have an 
opinion about the feature, but it sounds reasonable.

I left some review comments on Rietveld: http://bugs.python.org/review/26335/

--
components: +Extension Modules -IO, Library (Lib)
nosy: +berker.peksag
stage:  -> patch review

___
Python tracker 

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



[issue26335] Make mmap.write return the number of bytes written like other write methods

2016-02-12 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
nosy: +twouters

___
Python tracker 

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



[issue26335] Make mmap.write return the number of bytes written like other write methods

2016-02-10 Thread Jakub Stasiak

New submission from Jakub Stasiak:

Since mmap objects are said to "behave like both bytearray and like file 
objects" I believe it's appropriate for the mmap.write() method to return the 
number of bytes written like write() of other file objects/interfaces I could 
find in the standard library for consistency reasons:

https://docs.python.org/3/library/io.html#io.BufferedIOBase.write
https://docs.python.org/3/library/io.html#io.BufferedWriter.write
https://docs.python.org/3/library/io.html#io.RawIOBase.write
https://docs.python.org/3/library/io.html#io.TextIOBase.write

Why I believe this would be useful: code that writes to file objects and tests 
the number of bytes/characters written right now will likely fail when it's 
passed a mmap object because its write() method returns None. With this patch 
applied it'll work transparently.

Please find proposed patch attached, I included information about the exception 
type in the documentation as it seems fitting (apologies for generating the 
patch using Git, I'll generate using Mercurial if necessary).

--
components: IO, Library (Lib)
keywords: patch
messages: 260053
nosy: jstasiak
priority: normal
severity: normal
status: open
title: Make mmap.write return the number of bytes written like other write 
methods
type: enhancement
versions: Python 3.6
Added file: http://bugs.python.org/file41890/mmap_write_return_count.patch

___
Python tracker 

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