[issue17401] io.FileIO closefd parameter is not documented nor shown in repr

2014-12-02 Thread Roundup Robot

Roundup Robot added the comment:

New changeset fd80195b920f by Serhiy Storchaka in branch 'default':
Issue #17401: Output the closefd attribute as boolean.
https://hg.python.org/cpython/rev/fd80195b920f

--

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



[issue17401] io.FileIO closefd parameter is not documented nor shown in repr

2014-12-02 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Committed the first patch (showing closefd always) with additional test from 
second path.

--
versions:  -Python 3.4

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



[issue17401] io.FileIO closefd parameter is not documented nor shown in repr

2014-12-02 Thread Serhiy Storchaka

Changes by Serhiy Storchaka storch...@gmail.com:


--
resolution:  - fixed
stage: commit review - resolved
status: open - closed

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



[issue17401] io.FileIO closefd parameter is not documented nor shown in repr

2014-12-02 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Arfrever have suggested on IRC to backport documentation part of the patch to 
3.4.

--

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



[issue17401] io.FileIO closefd parameter is not documented nor shown in repr

2014-10-20 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

FileIO repr now looks confusing:

 sys.stdout.buffer.raw
_io.FileIO name='stdout' mode='wb' closefd='0'

The closefd attribute is not a string '0' or '1', it is boolean value True or 
False. Here is a patch which fixes a repr.

And I think that documentation part of the patch should be backported.

--
nosy: +serhiy.storchaka
resolution: fixed - 
stage:  - patch review
status: closed - open
versions: +Python 3.5 -Python 3.2, Python 3.3
Added file: http://bugs.python.org/file36977/io_fileio_repr_closefd.patch

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



[issue17401] io.FileIO closefd parameter is not documented nor shown in repr

2014-10-20 Thread Robert Collins

Robert Collins added the comment:

Yeah thats nicer. I'll apply that later unless you can.

--

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



[issue17401] io.FileIO closefd parameter is not documented nor shown in repr

2014-10-20 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

May be include closefd in the repr only when it is False? By default closefd is 
True and in common case the repr will be more compact.

--
Added file: http://bugs.python.org/file36979/io_fileio_repr_closefd_2.patch

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



[issue17401] io.FileIO closefd parameter is not documented nor shown in repr

2014-10-20 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com:


--
nosy: +Arfrever

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



[issue17401] io.FileIO closefd parameter is not documented nor shown in repr

2014-10-20 Thread Robert Collins

Robert Collins added the comment:

Showing it only when False would have higher cognitive load. Showing it always 
is simple and clear.

--

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



[issue17401] io.FileIO closefd parameter is not documented nor shown in repr

2014-10-20 Thread Berker Peksag

Changes by Berker Peksag berker.pek...@gmail.com:


--
stage: patch review - commit review

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



[issue17401] io.FileIO closefd parameter is not documented nor shown in repr

2014-10-19 Thread Robert Collins

Changes by Robert Collins robe...@robertcollins.net:


--
resolution:  - fixed
status: open - closed

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



[issue17401] io.FileIO closefd parameter is not documented nor shown in repr

2014-10-17 Thread R. David Murray

R. David Murray added the comment:

I think the information from the following line of the 'open' docs should be 
added to the doc patch:

If a filename is given closefd has no effect and must be True (the default).

Otherwise it looks fine to me.

--
nosy: +r.david.murray

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



[issue17401] io.FileIO closefd parameter is not documented nor shown in repr

2014-10-17 Thread Roundup Robot

Roundup Robot added the comment:

New changeset a1500e4a159a by Robert Collins in branch 'default':
Issue #17401: document closefd in io.FileIO docs and add to repr
https://hg.python.org/cpython/rev/a1500e4a159a

--
nosy: +python-dev

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



[issue17401] io.FileIO closefd parameter is not documented nor shown in repr

2014-09-08 Thread Robert Collins

Robert Collins added the comment:

Its more than just a docs issue - AFAICT it isn't possible to tell if closefd 
is set after the object is created.

The presence of the parameter in the signature is there, but it isn't 
documented *where the bulk of the FileIO parameters are* - there are docs for 
mode for instance. Why would we force users to follow breadcrumbs for one 
parameter but not other ones?

--

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



[issue17401] io.FileIO closefd parameter is not documented nor shown in repr

2014-09-08 Thread Robert Collins

Robert Collins added the comment:

Oh - the the 'open' function docs are fine - they are just a pointer. I was 
specifically referring to the class docs around line 513 of Doc/library/io.rst.

Attached is a patch that changes repr to show this attribute and extends the 
docs to document this as part of FileIO.

--
keywords: +patch
Added file: http://bugs.python.org/file36574/issue17401.patch

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



[issue17401] io.FileIO closefd parameter is not documented nor shown in repr

2014-07-18 Thread Mark Lawrence

Mark Lawrence added the comment:

From the 3.5 docs.

io.open(file, mode='r', buffering=-1, encoding=None, errors=None, newline=None, 
closefd=True, opener=None)
This is an alias for the builtin open() function.

There is a description for closefd at the open() function link.  So how about 
adding to the sentence above  where all the above parameters are described ?

--
nosy: +BreamoreBoy

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



[issue17401] io.FileIO closefd parameter is not documented nor shown in repr

2013-03-11 Thread Robert Collins

New submission from Robert Collins:

the docs (http://docs.python.org/3.x/library/io.html#io.FileIO) do not document 
closefd, and AFAICT it isn't possible to tell if closefd is set after the 
object is created. Specifically it does not show up in the repr().

 import sys
 sys.stdout
_io.TextIOWrapper name='stdout' mode='w' encoding='UTF-8'
 sys.stdout.buffer
_io.BufferedWriter name='stdout'
 sys.stdout.buffer.raw
_io.FileIO name='stdout' mode='wb'

If one wants to reopen sys.std in non-buffered mode, the right thing to do 
according to a recent thread on python-ideas is to use fdopen - e.g.

mystream = io.open(sys.stdout.fileno(), 'wt', 0) 
but this will set closefd to True in the new object, which results in hilarity 
when it gets garbage collected. And you cannot tell or compare that to the 
original stdout because of the lack of exposure of this attribute and it's 
implications. (Does it close the fd on __del__? After each operation? On 
close() being called on the FileIO object?)

--
messages: 184003
nosy: rbcollins
priority: normal
severity: normal
status: open
title: io.FileIO closefd parameter is not documented nor shown in repr
versions: Python 3.2, Python 3.3, Python 3.4, Python 3.5

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



[issue17401] io.FileIO closefd parameter is not documented nor shown in repr

2013-03-11 Thread Ezio Melotti

Changes by Ezio Melotti ezio.melo...@gmail.com:


--
assignee:  - docs@python
components: +Documentation, IO, Library (Lib)
nosy: +docs@python, pitrou
type:  - enhancement
versions:  -Python 3.5

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