I've received some enthusiastic emails from someone who wants to
revive restricted mode. He started out with a bunch of patches to the
CPython runtime using ctypes, which he attached to an App Engine bug:
Based on his code (the file secure.py is all you need, included in
secure.tar.gz) it seems he believes the only security leaks are
__subclasses__, gi_frame and gi_code. (I have since convinced him that
if we add "restricted" guards to these attributes, he doesn't need the
functions added to sys.)
I don't recall the exploits that Samuele once posted that caused the
death of rexec.py -- does anyone recall, or have a pointer to the
--Guido van Rossum (home page: http://www.python.org/~guido/)
Alright, I will re-submit with the contents pasted. I never use double
backquotes as I think them rather ugly; that is the work of an editor
or some automated program in the chain. Plus, it also messed up my
line formatting and now I have lines with one word on them... Anyway,
the contents of PEP 3145:
Title: Asynchronous I/O For subprocess.Popen
Author: (James) Eric Pruitt, Charles R. McCreary, Josiah Carlson
Type: Standards Track
In its present form, the subprocess.Popen implementation is prone to
dead-locking and blocking of the parent Python script while waiting on data
from the child process.
A search for "python asynchronous subprocess" will turn up numerous
accounts of people wanting to execute a child process and communicate with
it from time to time reading only the data that is available instead of
blocking to wait for the program to produce data   . The current
behavior of the subprocess module is that when a user sends or receives
data via the stdin, stderr and stdout file objects, dead locks are common
and documented  . While communicate can be used to alleviate some of
the buffering issues, it will still cause the parent process to block while
attempting to read data when none is available to be read from the child
There is a documented need for asynchronous, non-blocking functionality in
subprocess.Popen    . Inclusion of the code would improve the
utility of the Python standard library that can be used on Unix based and
Windows builds of Python. Practically every I/O object in Python has a
file-like wrapper of some sort. Sockets already act as such and for
strings there is StringIO. Popen can be made to act like a file by simply
using the methods attached the the subprocess.Popen.stderr, stdout and
stdin file-like objects. But when using the read and write methods of
those options, you do not have the benefit of asynchronous I/O. In the
proposed solution the wrapper wraps the asynchronous methods to mimic a
I have been maintaining a Google Code repository that contains all of my
changes including tests and documentation  as well as blog detailing
the problems I have come across in the development process .
I have been working on implementing non-blocking asynchronous I/O in the
subprocess.Popen module as well as a wrapper class for subprocess.Popen
that makes it so that an executed process can take the place of a file by
duplicating all of the methods and attributes that file objects have.
There are two base functions that have been added to the subprocess.Popen
class: Popen.send and Popen._recv, each with two separate implementations,
one for Windows and one for Unix based systems. The Windows
implementation uses ctypes to access the functions needed to control pipes
in the kernel 32 DLL in an asynchronous manner. On Unix based systems,
the Python interface for file control serves the same purpose. The
different implementations of Popen.send and Popen._recv have identical
arguments to make code that uses these functions work across multiple
When calling the Popen._recv function, it requires the pipe name be
passed as an argument so there exists the Popen.recv function that passes
selects stdout as the pipe for Popen._recv by default. Popen.recv_err
selects stderr as the pipe by default. "Popen.recv" and "Popen.recv_err"
are much easier to read and understand than "Popen._recv('stdout' ..." and
"Popen._recv('stderr' ..." respectively.
Since the Popen._recv function does not wait on data to be produced
before returning a value, it may return empty bytes. Popen.asyncread
handles this issue by returning all data read over a given time
The ProcessIOWrapper class uses the asyncread and asyncwrite functions to
allow a process to act like a file so that there are no blocking issues
that can arise from using the stdout and stdin file objects produced from
a subprocess.Popen call.
 [ python-Feature Requests-1191964 ] asynchronous Subprocess
 Daily Life in an Ivory Basement : /feb-07/problems-with-subprocess
 How can I run an external command asynchronously from Python? - Stack
 18.1. subprocess - Subprocess management - Python v2.6.2 documentation
 18.1. subprocess - Subprocess management - Python v2.6.2 documentation
 Issue 1191964: asynchronous Subprocess - Python tracker
 Module to allow Asynchronous subprocess use on Windows and Posix
platforms - ActiveState Code
 subprocess.rst - subprocdev - Project Hosting on Google Code
 subprocdev - Project Hosting on Google Code
 Python Subprocess Dev
This P.E.P. is licensed under the Open Publication License;
On Tue, Sep 8, 2009 at 22:56, Benjamin Peterson <benjamin(a)python.org> wrote:
> 2009/9/7 Eric Pruitt <eric.pruitt(a)gmail.com>:
>> Hello all,
>> I have been working on adding asynchronous I/O to the Python
>> subprocess module as part of my Google Summer of Code project. Now
>> that I have finished documenting and pruning the code, I present PEP
>> 3145 for its inclusion into the Python core code. Any and all feedback
>> on the PEP (http://www.python.org/dev/peps/pep-3145/) is appreciated.
> Hi Eric,
> One of the reasons you're not getting many response is that you've not
> pasted the contents of the PEP in this message. That makes it really
> easy for people to comment on various sections.
> BTW, it seems like you were trying to use reST formatting with the
> text PEP layout. Double backquotes only mean something in reST.
Which I noticed since it's cited in the BeOpen license we still refer
to in LICENSE. Since pythonlabs.com itself is still up, it probably
isn't much work to make the logos.html URI work again, but I don't know
who maintains that page.
Thus spake the Lord: Thou shalt indent with four spaces. No more, no less.
Four shall be the number of spaces thou shalt indent, and the number of thy
indenting shall be four. Eight shalt thou not indent, nor either indent thou
two, excepting that thou then proceed to four. Tabs are right out.
-----BEGIN PGP SIGNED MESSAGE-----
Current Python lacks support for "aio_*" syscalls to do async IO. I
think this could be a nice addition for python 3.3.
If you agree, I will create an issue in the tracker. If you think the
idea is of no value, please say so for me to move on. Maybe an 3th party
module, but I think this functionality sould be available in core python.
PS: The function calls are: aio_cancel, aio_error, aio_fsync, aio_read,
Jesus Cea Avion _/_/ _/_/_/ _/_/_/
jcea(a)jcea.es - http://www.jcea.es/ _/_/ _/_/ _/_/ _/_/ _/_/
jabber / xmpp:email@example.com _/_/ _/_/ _/_/_/_/_/
. _/_/ _/_/ _/_/ _/_/ _/_/
"Things are not so easy" _/_/ _/_/ _/_/ _/_/ _/_/ _/_/
"My name is Dump, Core Dump" _/_/_/ _/_/_/ _/_/ _/_/
"El amor es poner tu felicidad en la felicidad de otro" - Leibniz
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
-----END PGP SIGNATURE-----
+The :mod:`zlib` extension is built using an included copy of the zlib
+sources unless the zlib version found on the system is too old to be
+used for the build::
Unless or if? Building with an included copy *if* the system one is too
old makes sense to me, not the contrary. Am I not seeing something?
The first 3.2 beta is scheduled by Georg for November 13th.
What would you think of scheduling a bug week-end one week later, that
is on November 20th and 21st? We would need enough core developers to
be available on #python-dev.
reading the description of the new LRU cache in the "What's new in 3.2"
document now, I got the impression that the hits/misses attributes and the
.clear() method aren't really well namespaced. When I read
it's not very obvious to me what happens, unless I know that there actually
*is* a cache involved, which simply has the same name as the function. So
this will likely encourage users to add a half-way redundant comment like
"clear the cache" to their code.
What about adding an intermediate namespace called "cache", so that the new
operations are available like this:
It's just a little more overhead, but I think it reads quite a bit better.
The development team of the Python interpreter (a.k.a python-dev) is
organizing a bug week-end on Saturday 20th and Sunday 21st of November.
We would like to encourage anyone who feels interested in participating
to give it a try. Contributing to Python is much less intimidating than
it sounds. You don't need to have previous experience with modifying
the Python source; in fact bug days offer a good opportunity to learn
the basics by asking questions and working on relatively simple bugs
(see "how to get prepared" below). And most core developers are actual
How it happens
The bug week-end will happen on the #python-dev IRC channel on the
Freenode network, where several core developers routinely hang out. No
physical meeting is scheduled as far as I know, but anyone is
encouraged to organize one and announce it on the official Python
channels such as this one.
Participants (you!) join #python-dev and collaboratively go through the
Python issue tracker at http://bugs.python.org . From there, you can
provide patches and/or review existing patches. Also, you can help us
assess issues on any specific topic you have expertise in (the range of
topics touched in the stdlib is quite broad and it is more than likely
that the core developers' expertise is lacking in some of them).
Or, if you feel shy, you can simply watch other people work and
slowly get more confident about participating yourself.
Development is public and lurkers are welcome.
What you can work on
Our expectation is that Python 3.2 beta 1 will have been released a
couple of days before the bug week-end and, therefore, one primary goal
is to polish the 3.2 branch for the following betas and the final
release. There are many issues to choose from on the bug tracker; any
bug fixes or documentation improvements will do. New features are
discouraged: they can't be checked in before the official 3.2 release.
How to get prepared
If you are a beginner with the Python codebase, you may want to read the
development guide available here (courtesy of Brian Curtin):
There's a small practical guide to bug days/week-ends on the wiki:
And the development FAQ holds answers to generic development questions:
You can also do all of the above during the bug week-end, of course.
Please, don't hesitate to ask us questions on the #python-dev channel.
So, python 2.7 is in bugfix only mode. 'trunk' is off limit. So, where does one make improvements to the distinguished, and still very much alive, 2.x series of Python?
The answer would seem to be "one doesn't". But must it be that way?
When Morris stopped producing the Oxford III model back in '57 in favor of new developments, it didn't spell the end for it. The plant was sold to India and the Hindustan Ambassador<http://en.wikipedia.org/wiki/Hindustan_Ambassador> continues to be developed and produced to this day. It even has fuel injection.
The Morris Motor Company isn't around anymore.
So, here is my suggestion:
Let's move the current 'trunk' into /branches/afterlife-27. Open it for submissions from people such as myself that use 2.7 on a regular basis and are willing to give it some extra love. Host it there without the usual stringent python quality assurance, buildbot support, release management and all that rigmarole. Open-source it, if you will.
Svn.python.org already plays host to some other, less official, projects such as stackless, so why not this?
What do you think?
I have started to correct quite a lot of issues I have with Python on
AIX, and since I had to test quite a lot of patchs, I though it would be
more convenient to setup a buildbot for that platform.
So I now have a buildbot environment with 2 slaves (AIX 5.3 and 6.1)
that builds and tests Python (branch py3k) with both gcc and xlc (the
native AIX compiler) (I have 4 builders ("py3k-aix6-xlc",
"py3k-aix5-xlc", "py3k-aix6-gcc", "py3k-aix5-gcc").
I expect to add 4 more builders for branch 2.7 in coming days.
I would like to share the results of this buildbot to the Python
community so that issues with AIX could be addressed more easily.
R. David Murray pointed me to the page on the python wiki concerning
buildbot. It is stated there that is is possible to connect some slaves
to some official Python buildbot master.
Unfortunately, I don't think this solution is possible for me: I don't
think the security team in my company would appreciate that a server
inside our network runs some arbitrary shell commands provided by some
external source. Neither can I expose the buildbot master web interface.
Also I had to customize the buildbot rules in order to work with some
specificities of AIX (see attached master.cfg), and I can't guarantee
that this buildbot will run 24 hours a day; I may have to schedule it
only once at night for example if it consumes too much resources.
(And the results are very unstable at the moment, mostly because of
On the other hand, I could upload the build results with rsync or scp
somewhere or setup some MailNotifier if that can help.
How do you think I could share those results?
Le 15/09/2010 23:28, R. David Murray a écrit :
> R. David Murray added the comment:
> Sébastien, you could email Martin (tracker id loewis) about adding your buildbot to our unstable fleet (or even to stable if it is stable; that is, the tests normally pass and don't randomly fail). As long as you are around to help fix bugs it would be great to have an aix buildbot in our buildbot fleet.
> (NB: see also http://wiki.python.org/moin/BuildBot, which unfortunately is a bit out of date...)
> nosy: +r.david.murray
> Python tracker<report(a)bugs.python.org>