Author terry.reedy
Recipients Todd.Rovito, roger.serwy, terry.reedy
Date 2013-06-06.17:02:31
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
This issue is about uniformly updating the old idiom

  f = open('file')
  <use f)
  f.close()  # omitted at least in GrepDialog
except IOError as msg:
  <ignore or display message>

to the current idiom

  with open('file') as f:
    <use f
except OSError as msg:  # still use IOError in 2.7
    <ignore or display message>

#16715 changed 'IOError' to 'OSError' everywhere in Lib/* for 3.4 only.

I ran into this issue (again) because GrepDialog.Grepdialog.grep_it uses open without close. Consequently, with debug builds, 'Find in files' raises a ResourceWarning for each file opened. Because of the 3.4-only change, there will be a merge conflict.

To avoid this, now and in the future, I plan to backport the idlelib subset of the Svetlov's patch to 3.3 (it applied with only one fix).

Currently, all 3.x patches are being applied to both 3.3 and 3.4 and any 3.3 patch with 'IOError' will have a merge conflict. Any 3.4 patch with 'OSError' will not apply to 3.3. There is no longer an issue with breaking 3.2 to 3.3 merges. This change will break existing 3.3 patches with 'IOError', but they would break anyway on the merge.
Date User Action Args
2013-06-06 17:02:32terry.reedysetrecipients: + terry.reedy, roger.serwy, Todd.Rovito
2013-06-06 17:02:32terry.reedysetmessageid: <>
2013-06-06 17:02:32terry.reedylinkissue18151 messages
2013-06-06 17:02:32terry.reedycreate