[issue12661] Add a new shutil.cleartree function to shutil module
Leonid Vasilev vsleo...@gmail.com added the comment: yup, it's really to specific. -- resolution: - invalid status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12661 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12661] Add a new shutil.cleartree function to shutil module
Changes by Leonid Vasilev vsleo...@gmail.com: -- resolution: invalid - rejected ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12661 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12661] Add a new shutil.cleartree function to shutil module
Leonid Vasilev vsleo...@gmail.com added the comment: Added file with sample usage (extracted from real application). the main purpose of shutil.cleartree() is to remove unnecessary files from tree, where patterns of ignored or deleted files are computed dynamically. Yes I agree, that it might be done by shell expression, but in case of dynamic patterns it will be hacky. -- Added file: http://bugs.python.org/file22807/example.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12661 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12661] [new function] shutil.cleartree
New submission from Leonid Vasilev vsleo...@gmail.com: Hello, This patch adds new function to shutil. I think it's quite generic, and it fits shutil purpose. Sample usage: shutil.cleartree(path='/home/chin/Dev/python-hg-dev', ignore=shutil.ignore_pattterns('*.py')) removes all files from path, except *.py files. and shutil.cleartree(path='/home/chin/Dev/python-hg-dev', ignore=shutil.ignore_pattterns('*.pyc'), invert=True) is equivalent to `find /home/chin/Dev/python-hg-dev -name *.pyc -delete` -- components: Library (Lib) files: shutil.cleartree.patch keywords: patch messages: 141450 nosy: chin priority: normal severity: normal status: open title: [new function] shutil.cleartree type: feature request versions: Python 2.7, Python 3.3, Python 3.4 Added file: http://bugs.python.org/file22804/shutil.cleartree.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12661 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue5735] Segfault when loading not recompiled module
Leonid Vasilev vsleo...@gmail.com added the comment: Thanks for patch, it works now: Python compiled with --with-pydebug throws an ImportError when trying to import modules compiled without --with-pydebug, as it should: ImportError: /usr/local/lib/python3.0/site-packages/ext23.so: undefined symbol: PyModule_Create2 -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5735 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue5735] Segfault when loading not recompiled module
New submission from Leonid Vasilev vsleo...@gmail.com: I compiled two versions of python(both from main trunk) Here's what I do: $cd /usr/local/src/Python-3.0.1/ $./configure $make make install ... $cd ~/pyext/ $python3.0 setup.py install ... run python3.0 and import ext1 -- it worked ok ... $cd /usr/local/src/Python-3.0.1 $mkdir debug $cd debug $./../configure --with-pydebug $make $./python ... Try to import a ext1, and got a Segfault Backtrace from gdb: (gdb) backtrace #0 0xb7e9b1cb in strlen () from /lib/i686/cmov/libc.so.6 #1 0x0807c06d in PyUnicodeUCS2_FromString (u=0x Address 0x out of bounds) at ./../Objects/unicodeobject.c:553 #2 0x0816251a in PyModule_New (name=0x Address 0x out of bounds) at ./../Objects/moduleobject.c:39 #3 0x0816282d in PyModule_Create2 (module=0xb7fd26a0, module_api_version=1013) at ./../Objects/moduleobject.c:106 #4 0xb7fd14b8 in PyInit_ext1 () at ext1.c:40 #5 0x080cfda0 in _PyImport_LoadDynamicModule (name=0xbf9f8a17 ext1, pathname=0xbf9f798f /usr/local/lib/python3.0/site-packages/ext1.so, fp=0x9a18ef8) at ./../Python/importdl.c:57 #6 0x080cc226 in load_module (name=0xbf9f8a17 ext1, fp=0x9a18ef8, buf=0xbf9f798f /usr/local/lib/python3.0/site-packages/ext1.so, type=3, loader=0x0) at ./../Python/import.c:1807 #7 0x080ce236 in import_submodule (mod=0x81b8d4c, subname=0xbf9f8a17 ext1, fullname=0xbf9f8a17 ext1) at ./../Python/import.c:2601 #8 0x080cd7b6 in load_next (mod=0x81b8d4c, altmod=0x81b8d4c, p_name=0xbf9f9a30, buf=0xbf9f8a17 ext1, p_buflen=0xbf9f8a10) at ./../Python/import.c:2406 #9 0x080ccbdf in import_module_level (name=0x0, globals=0xb7e10714, locals=0xb7e10714, fromlist=0x81b8d4c, level=0) at ./../Python/import.c:2123 #10 0x080ccfc7 in PyImport_ImportModuleLevel (name=0x9a057f0 ext1, globals=0xb7e10714, locals=0xb7e10714, fromlist=0x81b8d4c, level=0) at ./../Python/import.c:2174 #11 0x0809f65f in builtin___import__ (self=0xb7df6ce4, args=0xb7df7a9c, kwds=0x0) at ./../Python/bltinmodule.c:173 #12 0x08161e56 in PyCFunction_Call (func=0xb7df6dfc, arg=0xb7df7a9c, kw=0x0) at ./../Objects/methodobject.c:84 #13 0x081179c1 in PyObject_Call (func=0xb7df6dfc, arg=0xb7df7a9c, kw=0x0) at ./../Objects/abstract.c:2161 #14 0x080b1806 in PyEval_CallObjectWithKeywords (func=0xb7df6dfc, arg=0xb7df7a9c, kw=0x0) at ./../Python/ceval.c:3313 #15 0x080ac71c in PyEval_EvalFrameEx (f=0x9a3105c, throwflag=0) at ./../Python/ceval.c:1995 #16 0x080b03fa in PyEval_EvalCodeEx (co=0x9983ec8, globals=0xb7e10714, locals=0xb7e10714, args=0x0, argcount=0, kws=0x0, kwcount=0, defs=0x0, defcount=0, kwdefs=0x0, closure=0x0) at ./../Python/ceval.c:2869 #17 0x080a562b in PyEval_EvalCode (co=0x9983ec8, globals=0xb7e10714, locals=0xb7e10714) at ./../Python/ceval.c:526 #18 0x080dcb68 in run_mod (mod=0x9a78d68, filename=0x819ff60 stdin, globals=0xb7e10714, locals=0xb7e10714, flags=0xbf9faf70, arena=0x99126d8) at ./../Python/pythonrun.c:1686 #19 0x080dadf1 in PyRun_InteractiveOneFlags (fp=0xb7f81420, filename=0x819ff60 stdin, flags=0xbf9faf70) at ./../Python/pythonrun.c:1081 #20 0x080da953 in PyRun_InteractiveLoopFlags (fp=0xb7f81420, filename=0x819ff60 stdin, flags=0xbf9faf70) at ./../Python/pythonrun.c:993 #21 0x080da7ab in PyRun_AnyFileExFlags (fp=0xb7f81420, filename=0x819ff60 stdin, closeit=0, flags=0xbf9faf70) at ./../Python/pythonrun.c:962 #22 0x080ec7a7 in Py_Main (argc=1, argv=0xb7de3028) at ./../Modules/main.c:625 #23 0x0805a75b in main (argc=1, argv=0xbf9fb0b4) at ./../Modules/python.c:70 -- assignee: tarek components: Build, Distutils, Installation files: ext1.c messages: 85853 nosy: chin, tarek severity: normal status: open title: Segfault when loading not recompiled module type: crash versions: Python 3.0 Added file: http://bugs.python.org/file13672/ext1.c ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5735 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue5714] CGIHTTPServer._url_collapse_path_split should live elsewhere
Leonid Vasilev vsleo...@gmail.com added the comment: I'd Wrote a patch for this. Perhaps some unittests are needed. -- keywords: +patch nosy: +chin Added file: http://bugs.python.org/file13644/issue5714_withdoc.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5714 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue5714] CGIHTTPServer._url_collapse_path_split should live elsewhere
Leonid Vasilev vsleo...@gmail.com added the comment: Actually urlparse.urljoin implements RFC 2396 Is it true that 'CGIHTTPServer._url_collapse_path_split' is just a inverted 'urlparse.urljoin' ? urlparse.urljoin('http://a/b/c/','g') 'http://a/b/c/g' urlparse.url_collapse_path_split('http://a/b/c/g') ('/http:/a/b/c', 'g') urlparse.urlsplit('http://a/b/c/g') SplitResult(scheme='http', netloc='a', path='/b/c/g', query='', fragment='') And there is existing function 'urlparse.urlsplit'. I think CGIHTTPServer._url_collapse_path_split is just a customized version of latter, and should be rewritten using 'urlparse.urlsplit'. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5714 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com