Issue 5761: add file name to py3k IO objects repr() (original) (raw)

Created on 2009-04-15 10:45 by pitrou, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
issue5761.patch pitrou,2009-05-23 17:58
issue5761-2.patch pitrou,2009-05-23 18:48
Messages (9)
msg85989 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2009-04-15 10:45
>>> f = open("py3k/__svn__/LICENSE") >>> f >>> f.buffer <_io.BufferedReader object at 0x7f4b67569f68> >>> f.buffer.raw io.FileIO(3, 'rb') >>> f.name 'py3k/__svn__/LICENSE' It would probably be nice if f.name were reused for f's repr().
msg86000 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2009-04-15 21:15
What should we do about filenames of bytes?
msg86237 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2009-04-21 15:23
Benjamin, do you think it can still be added after beta1? (I ask that in case noone does it before)
msg86253 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2009-04-21 18:14
2009/4/21 Antoine Pitrou <report@bugs.python.org>: > > Antoine Pitrou <pitrou@free.fr> added the comment: > > Benjamin, do you think it can still be added after beta1? > (I ask that in case noone does it before) Yes, I think that would be ok.
msg88222 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2009-05-23 03:21
Antoine, by "reused for f's repr" do you mean adding 'name=xxxx' into the existing repr (probably before the encoding)? Benjamin, by "bytes" do you mean BytesIO objects? Would it be acceptible to give them a 'name' attribute set to 'None'?
msg88223 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2009-05-23 04:57
> Antoine, by "reused for f's repr" do you mean adding 'name=xxxx' into > the existing repr (probably before the encoding)? Exactly.
msg88245 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2009-05-23 17:58
Here is a patch.
msg88247 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2009-05-23 18:48
New patch following Benjamin's comments.
msg88250 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2009-05-23 19:04
Committed in r72870.
History
Date User Action Args
2022-04-11 14:56:47 admin set github: 50011
2009-05-23 19:04:21 pitrou set status: open -> closedresolution: fixedmessages: +
2009-05-23 18:48:56 pitrou set files: + issue5761-2.patchmessages: +
2009-05-23 17:58:36 pitrou set files: + issue5761.patchkeywords: + patchmessages: +
2009-05-23 04:57:08 pitrou set messages: +
2009-05-23 03:21:14 r.david.murray set nosy: + r.david.murraymessages: +
2009-05-14 21:53:00 pitrou set components: + IO
2009-05-14 21:52:56 pitrou set priority: normal -> release blocker
2009-04-21 18:14:18 benjamin.peterson set messages: +
2009-04-21 15:23:49 pitrou set messages: +
2009-04-15 21:15:40 benjamin.peterson set messages: +
2009-04-15 10:45:46 pitrou create