summaryrefslogtreecommitdiffstats
path: root/pym/portage/process.py
Commit message (Collapse)AuthorAgeFilesLines
* _setup_pipes: close unnecessary duplicate fdsZac Medico2013-01-171-9/+46
|
* SpawnProcess: improve dummy pipe allocation logicZac Medico2013-01-151-0/+15
| | | | | | | By using allocated file descriptors for keys in fd_pipes, we naturally avoid interference with callers such as FileDigester and MergeProcess. See the _setup_pipes docstring for more benefits of this allocation approach.
* spawn: add close_fds parameterZac Medico2013-01-031-5/+9
|
* Handle closed sys.__stdin__, for multiprocessingZac Medico2012-12-151-1/+1
| | | | | | | Buggy code in python's multiprocessing/process.py closes sys.stdin and reassigns it to open(os.devnull), but fails to update the corresponding __stdin__ reference. So, detect that case and handle it appropriately. The buggy code is visible in http://hg.python.org/lookup/r73708.
* spawn: setup _exit finally block before forkZac Medico2012-10-081-17/+26
| | | | This is the most reliable way to handle the race condition.
* spawn: use finally block for failure os._exit()Zac Medico2012-10-081-2/+5
| | | | Also, use writemsg for unicode safety.
* Use sys.__std*.fileno() in case of overrides.Zac Medico2012-08-221-3/+3
| | | | | This fixes AttributeError exceptions for API consumers that override sys.std* streams pseudo-file objects.
* Close fewer file descriptors for fork / no exec.Zac Medico2012-03-271-1/+13
| | | | This will fix bug #374335.
* Replace @returns with @return.Zac Medico2012-03-271-2/+2
|
* get_open_fds: handle EAGAIN for PyPy 1.8Zac Medico2012-02-151-1/+15
|
* After python fork, don't close fds for PyPy 1.8.Zac Medico2012-02-141-9/+11
| | | | | | | | | | | | | | | | If we close all open file descriptors after a fork, with PyPy 1.8 it triggers "[Errno 9] Bad file descriptor" later in the subprocess. Apparently it is holding references to file descriptors and closing them after they've already been closed and re-opened for other purposes. As a workaround, we don't close the file descriptors, so that they won't be re-used and therefore we won't be vulnerable to this kind of interference. The obvious caveat of not closing the fds is that the subprocess can hold locks that belonged to the parent process, even after the parent process has released the locks. Hopefully this won't be a major problem though, since the subprocess has to exit at release the lock eventually, when the EbuildFetcher or _MergeProcess task is complete.
* spawn: assert that fork returns int typeZac Medico2012-02-061-1/+4
|
* process._exec: tweak opt_name for PyPyZac Medico2011-12-011-1/+6
| | | | | PyPy 1.7 will die due to "libary path not found" if argv[0] does not contain the full path of the binary.
* _exec: use default SIGINT/TERM handlersZac Medico2011-01-311-0/+5
| | | | Avoid issues like bug #353239.
* _exec: disable SIGQUIT handler override by parentZac Medico2010-12-281-0/+4
| | | | This will fix bug #289486.
* Fix some typos and improve a message in repoman.Arfrever Frehtes Taifersar Arahesis2010-10-231-2/+2
|
* EbuildFetcher: close uneeded fds in subprocessZac Medico2010-10-221-16/+19
|
* With waitpid and WNOHANG, only check the first element of the tuplev2.2_rc85Zac Medico2010-09-191-2/+8
| | | | since the second element may vary (bug #337465, comment #12).
* Remove unused imports found by pylint.Arfrever Frehtes Taifersar Arahesis2010-08-291-2/+1
|
* Ensure SystemExit is never caught.Zac Medico2010-08-261-0/+2
|
* Move PORTAGE_PYTHON setting to doebuild_environment() so that itZac Medico2010-08-141-3/+0
| | | | doesn't pollute os.environ.
* Set PORTAGE_PYTHON in processes executed by portage.process._exec().Arfrever Frehtes Taifersar Arahesis2010-08-141-1/+4
|
* Remove all svn $Id keywords.Zac Medico2010-03-241-1/+0
|
* Bug #309001 - Install a SIGPIPE handler inside _exec for all forked processes.Zac Medico2010-03-131-0/+3
| | | | svn path=/main/trunk/; revision=15825
* Make find_binary() use os.environ.get instead of os.getenv, since os.getenvZac Medico2009-09-211-2/+1
| | | | | | isn't behaving correctly in py3k (maybe a unicode wrapper issue?). svn path=/main/trunk/; revision=14364
* Don't encode the env in py3k since it expects strings for the env that'sZac Medico2009-09-211-13/+9
| | | | | | passed into os.execve(). svn path=/main/trunk/; revision=14363
* Decode all keys in dictionary containing environment passed to os.execve() ↵Arfrever Frehtes Taifersar Arahesis2009-09-211-1/+7
| | | | | | in portage.process._exec() for compatibility with Python 3. svn path=/main/trunk/; revision=14352
* Use dict.(keys|values|items)() instead of ↵Arfrever Frehtes Taifersar Arahesis2009-09-211-1/+1
| | | | | | | | dict.(iterkeys|itervalues|iteritems)() for compatibility with Python 3. (2to3-3.1 -f dict -nw ${FILES}) svn path=/main/trunk/; revision=14327
* Use range() instead of xrange() for compatibility with Python 3.Arfrever Frehtes Taifersar Arahesis2009-09-211-1/+1
| | | | | | (2to3-3.1 -f xrange -nw ${FILES}) svn path=/main/trunk/; revision=14317
* Define basestring as str when Python 3 is used.Arfrever Frehtes Taifersar Arahesis2009-09-211-0/+3
| | | | svn path=/main/trunk/; revision=14316
* Fix all remaining SyntaxErrors with Python 3.Arfrever Frehtes Taifersar Arahesis2009-09-211-1/+4
| | | | svn path=/main/trunk/; revision=14315
* Update syntax of 'except' statements for compatibility with Python 3.Arfrever Frehtes Taifersar Arahesis2009-09-201-1/+1
| | | | | | (2to3-3.1 -f except -nw ${FILES}) svn path=/main/trunk/; revision=14289
* Replace _content_encoding, _fs_encoding, and _merge_encoding with directZac Medico2009-08-211-3/+3
| | | | | | usage of _encodings. svn path=/main/trunk/; revision=14113
* Update import to import portage.os (with unicode wrappers), and useZac Medico2009-08-151-6/+5
| | | | | | | _unicode_encode() and _content_encoding for encoding unicode env vars in spawn(). svn path=/main/trunk/; revision=14062
* Show a traceback when spawn() fails.Zac Medico2009-08-121-0/+2
| | | | svn path=/main/trunk/; revision=14005
* Make spawn decode unicode in order to avoid a potential UnicodeEncodeErrorZac Medico2009-08-071-0/+11
| | | | | | from os.execve(). svn path=/main/trunk/; revision=13944
* Inside spawn(), avoid redundant os.access() and stat() calls on commonlyZac Medico2009-03-221-1/+2
| | | | | | | spawned binaries such as BASH_BINARY, SANDBOX_BINARY, and FAKEROOT_BINARY. Thanks to Piotr Jaroszyński <peper@g.o> for reporting. svn path=/main/trunk/; revision=13144
* Always use basestring instead of str with isinstance().Zac Medico2009-03-071-1/+1
| | | | svn path=/main/trunk/; revision=12775
* Use lazyimport to avoid importing the checksum, locks, and util modulesZac Medico2009-02-221-2/+6
| | | | | | when portage is initially imported. svn path=/main/trunk/; revision=12680
* For consistency, make get_open_fds() return a plain iterator in any case,Zac Medico2008-08-151-2/+2
| | | | | | rather than return a list in some cases. svn path=/main/trunk/; revision=11418
* Use a list comprehension instead of strange map() usage which yields oddZac Medico2008-08-151-1/+2
| | | | | | results when fed to the py3k converter. Thanks to René 'Necoro' Neumann. svn path=/main/trunk/; revision=11417
* In portage.process.spawn(), make the default fd_pipes value getZac Medico2007-12-211-1/+5
| | | | | | | file descriptors from sys.std{in,out,err} so that they can be overridden. svn path=/main/trunk/; revision=9018
* For bug #186386, pass stdin directly to spawned processes (even when their ↵Zac Medico2007-07-251-10/+0
| | | | | | output goes through a pty) so that Ctrl+Z works as on would expect.) svn path=/main/trunk/; revision=7394
* Add FEATURES=fakeroot support which causes install and package phases to run ↵Zac Medico2007-07-231-1/+20
| | | | | | inside fakeroot when a non-root user runs the ebuild command. Thanks to swegener for the initial patch. svn path=/main/trunk/; revision=7379
* Run pychecker over everything, fix obvious thing slike modules not in use, ↵Alec Warner2007-07-221-2/+4
| | | | | | variables not being used, or global exceptions not being deleted. Also fix imports for style (1 per line) svn path=/main/trunk/; revision=7354
* Fix strange _DevNull instance has no attribute 'isatty' warnings that occur ↵Zac Medico2007-06-071-1/+1
| | | | | | when epydoc generates docs. svn path=/main/trunk/; revision=6748
* When using a pty for logging, use setsid() to create a new session and make ↵Zac Medico2007-06-071-3/+20
| | | | | | the pty into the controlling terminal of the new session. This makes interactive ebuild behave properly in interactive cases like check_license() where ${PAGER:-less} is invoked. svn path=/main/trunk/; revision=6747
* Raise a CommandNotFound exception when necessary, to ease troubleshooting. ↵Zac Medico2007-02-211-2/+2
| | | | | | Thanks to marienz for reporting. svn path=/main/trunk/; revision=6021
* Namespace sanitizing, step 2Marius Mauch2007-01-251-0/+336
Rename portage.exec to portage.process to avoid syntax errors svn path=/main/trunk/; revision=5780