Issue 19628: maxlevels -1 on compileall for unlimited recursion (original) (raw)

Created on 2013-11-16 20:40 by deleted250130, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
compileall.patch Claudiu.Popa,2013-11-21 22:17 review
issue19628.patch Claudiu.Popa,2014-03-11 21:23 Minor fixes. review
issue19628_1.patch Claudiu.Popa,2014-04-11 17:38 review
Messages (10)
msg203081 - (view) Author: (deleted250130) Date: 2013-11-16 20:40
All functions of compileall are providing a maxlevels argument which defaults to 10. But it is currently not possible to disable this recursion limitation. Maybe it would be useful to have a special value like -1 to disable this limitation and allow to compile in an infinite amount of subdirectories. Also I'm noticing maxlevels is the only argument which is not available on command line. Does it default there to 10 too? Maybe it would be useful if it could be configured too (in this case it could theoretically replace -l).
msg203685 - (view) Author: PCManticore (Claudiu.Popa) * (Python triager) Date: 2013-11-21 22:17
Here's a patch which adds support for controlling the maxlevels on command line. Currently, compileall uses a binary choice, either we don't process subdirectories or we process at most 10 subdirectories. This seems to be the case since its inception, in " Changeset: 1828 (b464e1d0b2fb) New way of generating .pyc files, thanks to Sjoerd. User: Guido van Rossum <guido@python.org> Date: 1994-08-29 10:52:58 +0000 (1994-08-29) " The patch adds a new command option, -r, where `-r 0` is equivalent to specifying -l. I guess we can't modify -l to actually control the maxlevels, due to backward compatibility concerns.
msg215897 - (view) Author: PCManticore (Claudiu.Popa) * (Python triager) Date: 2014-04-10 18:25
Ping. :) Can someone review this patch, please?
msg215935 - (view) Author: PCManticore (Claudiu.Popa) * (Python triager) Date: 2014-04-11 17:38
Added patch which addresses the comments of Berker Peksag. Thanks for the review!
msg221619 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2014-06-26 17:23
Do we really want to allow infinite recursion (say a symbolic link loop)?
msg221621 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2014-06-26 17:26
Ah, bad font, I thought the -l was a -1. I see you aren't adding the infinite recursion, the just ability to control the maximum. The patch looks good to me.
msg225541 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2014-08-19 20:53
Why can't we just reuse the "-l" option?
msg225542 - (view) Author: PCManticore (Claudiu.Popa) * (Python triager) Date: 2014-08-19 21:05
Backward compatibility reasons, I guess. compileall -l completely deactivates the recursion, so using -l for controlling the number of levels seems to overwrite its original meaning.
msg225544 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2014-08-19 21:13
New changeset a62368778d6c by Benjamin Peterson in branch 'default': allow recursion depth to be specified (closes #19628) http://hg.python.org/cpython/rev/a62368778d6c
msg253591 - (view) Author: (deleted250130) Date: 2015-10-28 08:27
I'm wondering what the recursion limit is if -l and -r are not given. Does it default to 10 too or is there no limit? If the first is the case maybe this should also get documented.
History
Date User Action Args
2022-04-11 14:57:53 admin set github: 63827
2015-10-28 08:27:28 deleted250130 set messages: +
2014-08-19 21:13:36 python-dev set status: open -> closednosy: + python-devmessages: + resolution: fixedstage: commit review -> resolved
2014-08-19 21:05:55 Claudiu.Popa set messages: +
2014-08-19 20:53:41 benjamin.peterson set nosy: + benjamin.petersonmessages: +
2014-08-13 09:24:17 berker.peksag set nosy: + berker.peksag
2014-06-26 17:26:04 r.david.murray set messages: + stage: patch review -> commit review
2014-06-26 17:23:03 r.david.murray set messages: +
2014-06-26 17:06:40 Claudiu.Popa set nosy: + r.david.murray
2014-06-16 10:44:56 Claudiu.Popa set stage: patch review
2014-04-11 17:38:07 Claudiu.Popa set files: + issue19628_1.patchmessages: +
2014-04-10 18:25:12 Claudiu.Popa set messages: +
2014-03-11 21:23:09 Claudiu.Popa set files: + issue19628.patchversions: + Python 3.5, - Python 3.4
2013-11-21 22:17:40 Claudiu.Popa set versions: + Python 3.4, - Python 2.7, Python 3.3
2013-11-21 22:17:22 Claudiu.Popa set files: + compileall.patchnosy: + Claudiu.Popamessages: + keywords: + patch
2013-11-16 20:40:50 deleted250130 create