This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author arigo
Recipients
Date 2007-01-08.08:26:44
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
The __getattr__ magic makes the following kind of code fail with SpooledTemporaryFile:

  f = SpooledTemporaryFile(max_size=something)
  rd = f.read
  wr = f.write
  for x in y:
      ...use rd(size) and wr(data)...

The problem is that the captured 'f.read' method is the one from the StringIO instance, even after the write() rolled the file over to disk.  Given that capturing bound methods is a semi-official speed hack advertised in some respected places, we might have to be careful about it.  About such matters I am biased towards first getting it right and then getting it fast...

Also, Python 2.5 is already out, so this will probably be a 2.6 addition.
History
Date User Action Args
2007-08-23 15:56:09adminlinkissue1630118 messages
2007-08-23 15:56:09admincreate