[issue13418] Embedded Python memory leak
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: These are not memory leaks, but global state that the Python interpreter does not bother to free on exit. The amount of memory there is limited. Yes, I agree that this makes the basic memory checker built in Visual Studio completely useless. -- nosy: +amaury.forgeotdarc ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13418 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13416] Python Tutorial, Section 3, Minor PEP 8 adjustment
Changes by Ezio Melotti ezio.melo...@gmail.com: -- stage: - committed/rejected ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13416 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13419] import does not recognise SYMLINKDs on Windows 7
Changes by Tim Golden m...@timgolden.me.uk: -- nosy: +brian.curtin, jason.coombs, tim.golden ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13419 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13406] Deprecation warnings when running the test suite
Roundup Robot devn...@psf.upfronthosting.co.za added the comment: New changeset fe2be7d35660 by Ezio Melotti in branch 'default': #13406: fix more deprecation warnings and move the deprecation of unicode-internal earlier in the code. http://hg.python.org/cpython/rev/fe2be7d35660 -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13406 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13418] Embedded Python memory leak
Asesh aseshsh...@gmail.com added the comment: ok thanks for the replies. Actually I have python embedded in my game but now the real problem now is how do I differentiate from the real memory leak caused either by Python or by my application? Disabling memory leak check is not an option since it's been very helpful when debugging my C++ apps -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13418 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13420] newer() function in dep_util.py discard changes in the same second
New submission from David Amian dam...@emergya.com: Hi, I had a problem making deb packages with distutils and cdbs. Looking for any solution, I found Issue 11933 and saw that the newer() method has been changed, using [ST_MTIME] instead of st_mtime. This commit is to solve Issue 10148 that describes a bug when copying files with python, it depends on the filesystem. In these changes, modification time of files are checked as a integer, discarding the millisec. It makes the issue. For example, I've a file that is modified with an installation prefix. CDBS runs the build step and after the install step. In build step, the prefix is '/usr/local' because the prefix argument isn't supported, immediately the install step runs with prefix='/usr', so the file that contains a variable with project path modified with the prefix is not copied by distutils, it runs in a different millisec but in the same second. Then when install my app, it crashes because the variable with project path is '/usr/local' instead of '/usr' and this variable is used in the source. To solve this problem I made some modifications on file_util.py and dep_util.py files, I revert the changes of the issue 11933, but rounding all times returned by stat() with two decimals. With that changes, distutils is not affected by the Issue 10148 and if any file is modified in the same second, but in different millisec, distutils will compare it and it wil copy the file. -- assignee: tarek components: Distutils files: fix_mtime.diff keywords: patch messages: 147794 nosy: d.amian, eric.araujo, tarek priority: normal severity: normal status: open title: newer() function in dep_util.py discard changes in the same second type: behavior versions: Python 2.7 Added file: http://bugs.python.org/file23716/fix_mtime.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13420 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13349] Uninformal error message in index() and remove() functions
Petri Lehtinen pe...@digip.org added the comment: Éric Araujo wrote: On the other hand, the repr of a value might be very long: You can restrict the length with % formats. Seems you can't with %R. I'd also like to somehow indicate that the output is truncated. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13349 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13419] import does not recognise SYMLINKDs on Windows 7
Brian Curtin br...@python.org added the comment: Duplicate of #6727 -- resolution: - duplicate stage: - committed/rejected status: open - closed superseder: - ImportError when package is symlinked on Windows ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13419 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6727] ImportError when package is symlinked on Windows
Jason R. Coombs jar...@jaraco.com added the comment: If this issue is important to you, please follow the link above to the Microsoft Connect site and vote for the issue. More votes should mean it will get more attention. Thanks. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6727 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6727] ImportError when package is symlinked on Windows
Alex Regueiro alex...@gmail.com added the comment: Is this bug going to be fixed? I've been experiencing this for some time now, and it seems the Python team has known about it for a while too... seems like an easy fix! -- nosy: +alexreg ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6727 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6727] ImportError when package is symlinked on Windows
Brian Curtin br...@python.org added the comment: Not fixed, but if it's easy, you're welcome to fix it before we get around to it. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6727 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6727] ImportError when package is symlinked on Windows
Alex Regueiro alex...@gmail.com added the comment: Well, I am making an assumption here. :-) Might have a look at a patch. Never looked at the Python runtime before. If it's all written in C, then it's possible. I'm guessing most of the Python programmers don't know much/anything about Win32 programming, so that probably explains the delay. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6727 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13405] Add DTrace probes
Jesús Cea Avión j...@jcea.es added the comment: The LD_LIBRARY_PATH is because I am compiling Python as a shared lib and, of course, I am not installing the development version in the usual system path. That is, it is not a requirement for this project, but an easy to follow procedure for unexperienced betatesters. About the permissions, the situation is messy because under Solaris a regular user can not run dtrace unless special permissions be assigned to her. The situation is something like this: (talking about Solaris 10): * Global Zone: - root: dtrace works. - Regular user: dtrace is going to show a permission denied error, unless an admin had set dtrace user/proc permissions to him. If that is the case, it works. * Non Global Zone: - root: dtrace seems to work, but no probes can be found unless special dtrace user/proc permissions are assigned to the zone. - regular user: dtrace is going to show a permission denied error, unless an admin had set dtrace user/proc permissions to him. In that case, it will behave like root. That is, no probes found unles the zone have the right capabilities. The permission denied error can be easily detected and managed, but the silent error is not distinguible of this project not working. I am thinking about trying first an always present well known probe, to detect when the kernel is activelly ignoring dtrace instead of giving a clear permission error. I have requested to the sysadmins of my OpenIndiana buildbots to activate dtrace (of user code) in my zone, so I can evaluate the behaviour under OpenIndiana/Illumos. A couple of details I want to document here, to remember then and to ask for advice: - I have added a sys.trace_capabilities, so a program can know if any system-trace functionality is compiled in. Current values are None and (dtrace, Sun). Maybe create a new dtrace module could be appropiate, instead, with dtrace.supported=True/False, but I am thinking about future MacOS probes, Linux systemtap probes, etc. - Current code only traces function calls *TO* Python code. If the function calls is to C code (os.getpid(), for instance), the call is not visible. I think this is a major deficience, apparently shared by all the previous attempts I have seen (including official Sun probes). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13405 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6727] ImportError when package is symlinked on Windows
Brian Curtin br...@python.org added the comment: There are a few of us, and Jason and myself have done most of the Windows symlink related work. We'll certainly get to this and have it fixed, but with no releases on the immediate horizon, there isn't a rush. This and your other symlink issue are on my radar for things to make sure we cover. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6727 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6727] ImportError when package is symlinked on Windows
Alex Regueiro alex...@gmail.com added the comment: Thanks Brian; that's good to know. If we could get it in the next release (Python 2.8?) that would be awesome. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6727 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13405] Add DTrace probes
Changes by Antoine Pitrou pit...@free.fr: -- nosy: +loewis ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13405 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13357] HTMLParser parses attributes incorrectly.
Ezio Melotti ezio.melo...@gmail.com added the comment: I verified with the red_test.html you provided and now HTMLParser seems to parse everything correctly, so I'm closing this. -- resolution: - fixed stage: test needed - committed/rejected status: open - closed versions: +Python 3.2, Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13357 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6727] ImportError when package is symlinked on Windows
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: If we could get it in the next release (Python 2.8?) that would be awesome. I doubt it will (see PEP 404) but 3.3 is a good target. -- nosy: +amaury.forgeotdarc ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6727 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13358] HTMLParser incorrectly handles cdata elements.
Michael Brooks firealwayswo...@gmail.com added the comment: Has anyone else been able to verify this? On Mon, Nov 7, 2011 at 7:46 AM, Michael Brooks rep...@bugs.python.orgwrote: Michael Brooks firealwayswo...@gmail.com added the comment: This one should also have a priority change. Tested python 2.7.3 --MIke On Sun, Nov 6, 2011 at 12:54 PM, Michael Brooks rep...@bugs.python.org wrote: Michael Brooks firealwayswo...@gmail.com added the comment: Yes I am running python 2.7.2. On Sun, Nov 6, 2011 at 12:52 PM, Ezio Melotti rep...@bugs.python.org wrote: Ezio Melotti ezio.melo...@gmail.com added the comment: Have you tried with the latest 2.7? (see msg147170) -- nosy: +ezio.melotti stage: - test needed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13358 ___ -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13358 ___ -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13358 ___ -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13358 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13358] HTMLParser incorrectly handles cdata elements.
Ezio Melotti ezio.melo...@gmail.com added the comment: I'm working on it, but a minimal example seems to work fine. (P.S. there's no need to quote the previous message(s) while replying) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13358 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13405] Add DTrace probes
Changes by Jesús Cea Avión j...@jcea.es: Removed file: http://bugs.python.org/file23690/05fde8943685.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13405 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13405] Add DTrace probes
Changes by Jesús Cea Avión j...@jcea.es: Removed file: http://bugs.python.org/file23691/1563b5a70362.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13405 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13405] Add DTrace probes
Changes by Jesús Cea Avión j...@jcea.es: Removed file: http://bugs.python.org/file23696/9fcca74ff413.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13405 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13405] Add DTrace probes
Changes by Jesús Cea Avión j...@jcea.es: Removed file: http://bugs.python.org/file23701/7a2465f6a56a.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13405 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13405] Add DTrace probes
Changes by Jesús Cea Avión j...@jcea.es: Added file: http://bugs.python.org/file23717/7c1b63f949e7.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13405 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13405] Add DTrace probes
Jesús Cea Avión j...@jcea.es added the comment: New changeset: 7c1b63f949e7.diff Now I detect lacking of dtrace privileges, both in the global zone and in a non-global zone. For that, I verify that the process can actually insert a C-entry point probe in a well known function: PyEval_EvalCode. This should work ALWAYS, even if the dtrace instrumentation provided by this fails miserably. We have to remember if we change that function name, someday... -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13405 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13358] HTMLParser incorrectly handles cdata elements.
Ezio Melotti ezio.melo...@gmail.com added the comment: It seems to me that the arguments are parsed correctly, but handle_data is called multiple time between handle_starttag and handle_endtag. This might happen, e.g. in case the source lines are fed one by one to the parser, but in this case seems to happen whenever / is found. (The tests didn't detect this because they join the data to avoid buffer artifacts.) I'm not sure if this can be considered a bug, but the situation can indeed be improved. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13358 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13064] Port codecs and error handlers to the new Unicode API
Changes by STINNER Victor victor.stin...@haypocalc.com: -- resolution: - duplicate status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13064 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13405] Add DTrace probes
Danek Duvall duv...@comfychair.org added the comment: - I have added a sys.trace_capabilities, so a program can know if any system-trace functionality is compiled in. Current values are None and (dtrace, Sun). I'm not sure Sun is the right name here. I'd say either SunOS or Solaris (or the lowercase of either). Sun typically refers to Sun hardware, which isn't relevant here, and the company, which doesn't exist anymore, also isn't particularly relevant. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13405 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13411] Hashable memoryviews
STINNER Victor victor.stin...@haypocalc.com added the comment: Does memory_hash() reject non-contiguous memory? _Py_HashBytes() might be reused by unicode_hash() for PyUnicode_1BYTE_KIND. -- nosy: +haypo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13411 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13411] Hashable memoryviews
STINNER Victor victor.stin...@haypocalc.com added the comment: Except these two minor nits, the patch looks good to me. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13411 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13411] Hashable memoryviews
Antoine Pitrou pit...@free.fr added the comment: Does memory_hash() reject non-contiguous memory? It should, since it checks the strides array. _Py_HashBytes() might be reused by unicode_hash() for PyUnicode_1BYTE_KIND. I don't really see how unicode hashing should be related to bytes hashing (even though apparently an (outdated?) test checks for that). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13411 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13411] Hashable memoryviews
Charles-François Natali neolo...@free.fr added the comment: I'm not sure that the register storage class specifier is still relevant with modern compilers: I'm pretty sure gcc ignores it unless -O0, and I think I've read somewhere Microsoft's compiler ignores it too. -- nosy: +neologix ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13411 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13411] Hashable memoryviews
Antoine Pitrou pit...@free.fr added the comment: I'm not sure that the register storage class specifier is still relevant with modern compilers: I'm pretty sure gcc ignores it unless -O0, and I think I've read somewhere Microsoft's compiler ignores it too. I don't think so either. I was lazily moving the original code, but I could remove those bits. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13411 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13358] HTMLParser incorrectly handles cdata elements.
Michael Brooks firealwayswo...@gmail.com added the comment: Ok so until you fix this bug, i'll be overriding HTMLParser with my fix, becuase this is a blocking issue for my project. My HTMLParser must behave like a browser, period end of story. Thanks. On Thu, Nov 17, 2011 at 9:24 AM, Ezio Melotti rep...@bugs.python.orgwrote: Ezio Melotti ezio.melo...@gmail.com added the comment: It seems to me that the arguments are parsed correctly, but handle_data is called multiple time between handle_starttag and handle_endtag. This might happen, e.g. in case the source lines are fed one by one to the parser, but in this case seems to happen whenever / is found. (The tests didn't detect this because they join the data to avoid buffer artifacts.) I'm not sure if this can be considered a bug, but the situation can indeed be improved. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13358 ___ -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13358 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13421] PyCFunction_* are not documented anywhere
New submission from Jesús Cea Avión j...@jcea.es: Functions PyCFunction_* are not documented. Searching online I found http://www.gossamer-threads.com/lists/python/dev/738662 , so I am actually opening the issue and assigning to Georg :). -- assignee: georg.brandl components: Documentation messages: 147817 nosy: georg.brandl, jcea priority: normal severity: normal status: open title: PyCFunction_* are not documented anywhere ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13421 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13358] HTMLParser incorrectly handles cdata elements.
Ezio Melotti ezio.melo...@gmail.com added the comment: It already behaves like a browser, it just gives you data in chunks instead of calling handle_data() only once at the end. The documentation is not clear about this though. It says that feed() can be called several times, but it doesn't say that handle_data() (and possibly other methods) might get called more than once. This seems to always be the case while calling feed() several times. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13358 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13358] HTMLParser incorrectly handles cdata elements.
Michael Brooks firealwayswo...@gmail.com added the comment: Oah, then there is a misunderstanding. No browser will parse the html that is declared within a javascript variable, it must be treated as a continues data segment (with cdata properties) until the exit /\s*script\s* is encountered (and if this tag found anywhere, even in a quoted string it will still terminate this data segment, because its a cdata element). The snip of html provided must only be a single data segment. / alone is not a proper terminator. Thu, Nov 17, 2011 at 11:17 AM, Ezio Melotti rep...@bugs.python.org wrote: Ezio Melotti ezio.melo...@gmail.com added the comment: It already behaves like a browser, it just gives you data in chunks instead of calling handle_data() only once at the end. The documentation is not clear about this though. It says that feed() can be called several times, but it doesn't say that handle_data() (and possibly other methods) might get called more than once. This seems to always be the case while calling feed() several times. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13358 ___ -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13358 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13405] Add DTrace probes
Changes by Jesús Cea Avión j...@jcea.es: Added file: http://bugs.python.org/file23718/62e7091812bc.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13405 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13421] PyCFunction_* are not documented anywhere
Changes by Georg Brandl ge...@python.org: -- assignee: georg.brandl - docs@python nosy: +docs@python ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13421 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13422] Subprocess: children hang due to open pipes
New submission from Felix Steffenhagen fe...@sutus.com: subprocess.Popen.communicate() hangs for daemonized subprocesses that leave a pipe open. The python caller, invoking the daemon subprocess, runs as long as the daemon process. This happens on POSIX platforms with python 2.7 as well as 3.2. Please find attached a simple python daemon, which leaves stderr pipe open. It runs for 10 sec and then exits. To reproduce the problem run the following start script: ## # startpydaemon.py import subprocess cmd = 'python pydaemon.py' print(Starting daemon that runs for 10 sec) daemon = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True) stdout, stderr = daemon.communicate() print(Stdout:) print(stdout) print(Stderr:) print(stderr) ## Expected Behavior: -- Daemon starter should exit immediately after the daemon process is initialized. Actual Behavior: Daemon starter waits for daemon process to be finished due to left open error pipe. Workaround: --- One workaround is to not capture output from the left-open pipe. This way. -- components: Library (Lib) files: pydaemon.py messages: 147820 nosy: fsteffenhagen priority: normal severity: normal status: open title: Subprocess: children hang due to open pipes versions: Python 2.6, Python 3.2 Added file: http://bugs.python.org/file23719/pydaemon.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13422 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13422] Subprocess: children hang due to open pipes
Changes by Felix Steffenhagen fe...@sutus.com: -- type: - behavior ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13422 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13422] Subprocess: children hang due to open pipes
Charles-François Natali neolo...@free.fr added the comment: subprocess.Popen.communicate() hangs for daemonized subprocesses that leave a pipe open. [...] which leaves stderr pipe open. Of course: the daemon process (spawned by the second fork()) inherits the subprocess's stderr (since file descriptors are inherited upon fork), and communicate waits until the subprocess's stderr and stdout are closed (EOF returned). And it's of course documented, see http://docs.python.org/dev/library/subprocess.html#subprocess.Popen.communicate : Popen.communicate(input=None, timeout=None) Interact with process: Send data to stdin. Read data from stdout and stderr, until end-of-file is reached. Wait for process to terminate. -- nosy: +neologix ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13422 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13215] multiprocessing Manager.connect() aggressively retries refused connections
Charles-François Natali neolo...@free.fr added the comment: Apparently you forgot to upload the patch... Told you I couldn't think straight :-) -- Added file: http://bugs.python.org/file23720/connection_retry.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13215 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13215] multiprocessing Manager.connect() aggressively retries refused connections
Antoine Pitrou pit...@free.fr added the comment: Ok for me. Nice to see that piece of ugliness removed. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13215 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13349] Uninformal error message in index() and remove() functions
Terry J. Reedy tjre...@udel.edu added the comment: The test suite has code (functions) that restrict the length on AssertEqual (and other) failure messages. (I do not know the location though.) Perhaps that can be reused. This almost seems like something that should be more easily available. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13349 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13422] Subprocess: children hang due to open pipes
Gregory P. Smith g...@krypto.org added the comment: This looks like a bug in your daemon not in subprocess. Your daemon is intentionally not closing its inherited stderr fd. -- nosy: +gregory.p.smith resolution: - invalid status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13422 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13422] Subprocess: children hang due to open pipes
Felix Steffenhagen fe...@sutus.com added the comment: The behavior that the daemon is not closing stderr is intentional to reproduce the issue. This problem occured to me when I was invoking the samba init script on a Gentoo system. Invoked from a bash, the initscript was terminating fine. But when I invoked it using the subprocess module, my python script hang. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13422 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13386] Document documentation conventions for optional args
Eric V. Smith e...@trueblade.com added the comment: I just ran across the other reason that having the actual default values documented is important. Sometimes I want to do this: some_func(param if some_condition else use the default value) If some_condition is False, I want the default behavior, if not, I want to pass in a parameter. If I don't know the real default value, I have to write: if some_condition: some_func(param) else: some_func() -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13386 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7750] IOError when launching script under pdb with backslash in script path
Nu Kvar asafgreenb...@gmail.com added the comment: this bug exist also in python 2.5 (of course) and the same patch as above fixes it (of course). -- nosy: +nukvar ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7750 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7750] IOError when launching script under pdb with backslash in script path
Roundup Robot devn...@psf.upfronthosting.co.za added the comment: New changeset f7dd5178f36a by Jason R. Coombs in branch '2.7': PDB now will properly escape backslashes in the names of modules it executes. Fixes #7750 http://hg.python.org/cpython/rev/f7dd5178f36a -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7750 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7750] IOError when launching script under pdb with backslash in script path
Jason R. Coombs jar...@jaraco.com added the comment: This bug doesn't appear to be present in 3.1, so the 2.7 patch is all that applies at this time. -- resolution: - fixed status: open - closed versions: -Python 2.6 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7750 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13386] Document documentation conventions for optional args
Eli Bendersky eli...@gmail.com added the comment: Eric, Spot on :-) This is *exactly* the reason that led me to open issue 12875, which eventually led to this one. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13386 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13386] Document documentation conventions for optional args
Terry J. Reedy tjre...@udel.edu added the comment: From Ezio's original post: ''' If a function has optional arguments but it doesn't accept keyword arguments, the func([arg1]) notation is used instead. ... The notation func([arg=default]) should never be used, and func([arg]) should be used only when keyword args are not accepted. ''' In the following, I give objections to this PO (position only) rule and suggest an alternative ND (no default) rule: use 'name=default' when there is a default and '[name]' when there is not'. The issue of whether an argument is required or optional is orthogonal to whether it can be passed by both position and name, only by name, or only by position. All combinations are possible. Optional arguments may or may not have a definition-time (or even run-time) default value, regardless of how passed. (In Python, use of *args and **kwds allows args to be optional without default.) In the CPython stdlib, I think position-only arguments only occur with some, but only some, C functions. One can emulate such C functions in Python by doing the equivalent of what is going on with such C functions. Use a collective *varargs in the definition while naming the required and optional components of varargs in the doc as if they were the actual parameters. But I think we agree that emulating a limitation of C in Python is a bad idea. So by using [] to mean both 'argument is optional' and 'function only take parameters by position' (or at least 'this parameter can only be passed to this function by position'), we are simultaneously documenting an intended and permanent feature of the Python function and a possibly temporary and unwanted side-effect of the current CPython implementation of that function. I think a separate PO indication might be better. 1: The PO rule goes against the effort to separate the Python language from the CPython implementation. With it, the doc for a function does not apply to other implementations that do not have the PO limitation for that function. 2: The PO rule is incomplete. It only marks an arg as position-only if it is optional, but not if it is required. And even if marking one arg as PO means that other args of the function might be, so 'watch out', there is still no special marking for a function with only required PO args. A separate sentence like For CPython, all args must be passed by position. would solve both of the above problems. 3: The PO rule does not account for the possibility that an argument can be passed by keyword, perhaps only by keyword, but have no default. This is possibly in Python with **kwds in the def and recognized optional names in the doc. With 'name=default' and '[name]' not allowed, how should such an argument be documented is a signature? 4: The PO rule omits useful information on defaults from the place of prominence - the signature header for the entry. Sometimes the information, needed by some users and all implementers, gets omitted altogether. For example, the doc string and manual entry give the signature for str.startwith as str.startswith(prefix[, start[, end]]) The unmentioned defaults are None, None. In summary, the PO rule primarily indicates, but only for optional args, whether the arg can be passed by keyword or not. It secondarily indicates, but only if it can be passed by keyword, what its default is. But if fails if the arg can be passed by keyword but does not have a default. It also fails, in its primary role, for required args. To me, this is all mixed up. Method of passing is not related to optionality. What is special about optional args, regardless of how passed, is the default value, if it has one. The ND rule is to give exactly this information. With an implementation-independent signature and a separate note on passing method, when needed, it solves all the problems listed above. For .startswith, I would like to see something like str.startswith(prefix, start=None, end=None) ... CPython: pass args by position only. --- #13355 illustrates Eric's point with a twist. random.triangular(low, high, mode) Return a random floating point number N such that low = N = high and with the specified mode between those bounds. The low and high bounds default to zero and one. The mode argument defaults to the midpoint between the bounds, giving a symmetric distribution. The *actual* default for mode is None. The function *usually* acts if the default were as described. Twist 1 is that it does not actually calculate the midpoint, as it is not actually needed. Twist 2 is that there is currently a bug (easily fixed) such that triangular does not work if low=high and mode is not specified, whereas it does work if the true default None is passed ;-). So one needs to know the real default to avoid the bug. Of course, as I said on the issue, all defaults should be given in the signature (by either PO or ND rule): random.triangular(low=0.0, high=1.0,
[issue13386] Document documentation conventions for optional args
Baptiste Carvello de...@baptiste-carvello.net added the comment: Le 18/11/2011 05:29, Terry J. Reedy a écrit : In the following, I give objections to this PO (position only) rule and suggest an alternative ND (no default) rule: use 'name=default' when there is a default and '[name]' when there is not'. The issue of whether an argument is required or optional is orthogonal to whether it can be passed by both position and name, only by name, or only by position. With this logic, you would need to use '[name=default]' when an argument is optional *and* can be passed by name. Sure, this notation is inherently redundant, but is has the advantage of conveying both informations immediately to the user. It is also more coherent with '[name]'. But this is a big change from the current philosophy... -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13386 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13349] Uninformal error message in index() and remove() functions
Petri Lehtinen pe...@digip.org added the comment: I found safe_repr() from Lib/unittest/util.py. We would require a similar function, just implemented in C. What is a good place to define such C helpers that could be used everywhere? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13349 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com