classification
Title: stdlib compatibility with pypy: mailbox module
Type: behavior Stage: resolved
Components: email, Library (Lib) Versions: Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: amaury.forgeotdarc, barry, mattip, petri.lehtinen, python-dev, r.david.murray
Priority: normal Keywords: patch

Created on 2012-06-09 19:26 by mattip, last changed 2012-10-23 12:04 by petri.lehtinen. This issue is now closed.

Files
File name Uploaded Description Edit
mailbox.patch mattip, 2012-06-09 19:26 review
mailbox.patch mattip, 2012-06-11 18:47 review
Messages (10)
msg162564 - (view) Author: mattip (mattip) * Date: 2012-06-09 19:26
These are changes necessary to mailbox.py and its tests so that tests pass (windows platform) on pypy 1.9.0. Files must be explicitly closed on pypy. 

I would like to submit these as a "compatability" issue type, but that category does not exist, so I used "behavior". 

This is the first in a series of a number of such patches, I think there will be about 20.
msg162566 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2012-06-10 00:10
I see some code changes, but no added tests for those code changes.

msg.fp doesn't exist in Python3.  I'd like to understand those changes better, but I don't know when I'll have the time or if it is worth the effort.
msg162567 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2012-06-10 00:15
Oh, and the code changes should presumably be applied to Python3 as well (once there are tests), so I've added those versions.  It might be better to have two patches, one for the close of _file, and the other for the msg.fp stuff (since that doesn't exist in Python3).
msg162607 - (view) Author: Amaury Forgeot d'Arc (amaury.forgeotdarc) * (Python committer) Date: 2012-06-11 07:31
I'm not sure about the __del__: if pypy's deferred garbage collection is not enough to close self._file, how can a __del__ method help?
msg162635 - (view) Author: mattip (mattip) * Date: 2012-06-11 18:47
Revised patch: changes to mailbox.py were not needed for pypy. Someone did a good job with mailbox.py in stdlib 2.7.3

Now the patch only changes tests. The tests in 3.3 are very different, it seems to me there is little that can be reused there.
msg162636 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2012-06-11 19:09
Ah, good.  I thought we'd fixed the open/close issues, but I could easily believe we had missed something (especially in Python2).

Since the fp stuff is gone in 3, I'd be OK with just applying this.
msg162754 - (view) Author: mattip (mattip) * Date: 2012-06-14 05:17
What is the next stage in moving this forward? I am new here...
msg162781 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2012-06-14 12:54
You could get one of the pypy devs that have push rights on cpython to commit it.  If that doesn't happen, then at some point (probably not *too* long from now) I or someone else will commit it.  We have many more patches than we have people with time to commit them, so it sometimes takes a bit.
msg173596 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2012-10-23 12:03
New changeset 84cd07899baf by Petri Lehtinen in branch '2.7':
#15040: Close files in mailbox tests for PyPy compatibility
http://hg.python.org/cpython/rev/84cd07899baf
msg173598 - (view) Author: Petri Lehtinen (petri.lehtinen) * (Python committer) Date: 2012-10-23 12:04
Applied, thanks!
History
Date User Action Args
2012-10-23 12:04:28petri.lehtinensetstatus: open -> closed

nosy: + petri.lehtinen
messages: + msg173598

resolution: fixed
stage: commit review -> resolved
2012-10-23 12:03:37python-devsetnosy: + python-dev
messages: + msg173596
2012-06-18 14:55:39eric.araujosettitle: stdlib compatability with pypy: mailbox.py -> stdlib compatibility with pypy: mailbox module
2012-06-14 12:54:06r.david.murraysetmessages: + msg162781
stage: patch review -> commit review
2012-06-14 05:17:53mattipsetmessages: + msg162754
2012-06-11 19:09:49r.david.murraysetmessages: + msg162636
versions: - Python 3.2, Python 3.3
2012-06-11 18:47:44mattipsetfiles: + mailbox.patch

messages: + msg162635
2012-06-11 07:31:55amaury.forgeotdarcsetnosy: + amaury.forgeotdarc
messages: + msg162607
2012-06-10 00:15:48r.david.murraysetversions: + Python 3.2, Python 3.3
nosy: + barry

messages: + msg162567

components: + email
stage: patch review
2012-06-10 00:10:10r.david.murraysetnosy: + r.david.murray
messages: + msg162566
2012-06-09 19:26:20mattipcreate