Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Python: Bugs

[issue6816] Provide CPython command line functionality via runpy module

 

 

Python bugs RSS feed   Index | Next | Previous | View Threaded


report at bugs

Nov 14, 2009, 11:18 PM

Post #1 of 15 (392 views)
Permalink
[issue6816] Provide CPython command line functionality via runpy module

Nick Coghlan <ncoghlan [at] gmail> added the comment:

Descoped idea to just provide runpy.run_path (filesystem path equivalent
of runpy.run_module)

----------

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue6816>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Nov 15, 2009, 1:10 AM

Post #2 of 15 (375 views)
Permalink
[issue6816] Provide CPython command line functionality via runpy module [In reply to]

Nick Coghlan <ncoghlan [at] gmail> added the comment:

2.7: r76286
3.2 merge is still a work in progress

----------

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue6816>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Nov 15, 2009, 1:59 PM

Post #3 of 15 (367 views)
Permalink
[issue6816] Provide CPython command line functionality via runpy module [In reply to]

R. David Murray <rdmurray [at] bitdance> added the comment:

The windows buildbots are reporting an odd error in test_runpy. I can't
see by visual inspection why the test is failing:

http://www.python.org/dev/buildbot/stable/builders/x86%20XP-4%20trunk/builds/2615/steps/test/logs/stdio

----------
nosy: +r.david.murray

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue6816>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Nov 15, 2009, 2:20 PM

Post #4 of 15 (366 views)
Permalink
[issue6816] Provide CPython command line functionality via runpy module [In reply to]

Antoine Pitrou <pitrou [at] free> added the comment:

The test is probably failing because the pattern is interpreted as a regex:
>>> re.match(r'\t', r'\t') is None
True

There is another problem, which is that test_runpy (or runpy itself) is
now leaking references:

test_runpy
beginning 6 repetitions
123456
......
test_runpy leaked [56, 56, 56] references, sum=168

----------
nosy: +pitrou

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue6816>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Nov 15, 2009, 2:54 PM

Post #5 of 15 (366 views)
Permalink
[issue6816] Provide CPython command line functionality via runpy module [In reply to]

Nick Coghlan <ncoghlan [at] gmail> added the comment:

The windows errors are most likely due to the fact that I'm not doubling
the backslashes in the file paths before passing them to
assertRaisesRegex() as the regular expression pattern.

The reference leak is also interesting, since there isn't any new C code
here. Although I do add quite a few new entries to the path importer
cache as part of the run_path tests - that might be enough to explain it.

----------

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue6816>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Nov 15, 2009, 3:20 PM

Post #6 of 15 (366 views)
Permalink
[issue6816] Provide CPython command line functionality via runpy module [In reply to]

Nick Coghlan <ncoghlan [at] gmail> added the comment:

Hmm, definitely not the path importer cache - regrtest already takes
that into account by reverting it to its original state before checking
the reference counts.

----------

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue6816>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Nov 15, 2009, 8:46 PM

Post #7 of 15 (362 views)
Permalink
[issue6816] Provide CPython command line functionality via runpy module [In reply to]

Nick Coghlan <ncoghlan [at] gmail> added the comment:

There's another cache in zipimport that wasn't being cleared when
hunting refleaks. I've updated that on the trunk and will include it in
the forward port to 3k (along with a fix for the Windows path separator
problem).

----------

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue6816>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Nov 15, 2009, 10:58 PM

Post #8 of 15 (356 views)
Permalink
[issue6816] Provide CPython command line functionality via runpy module [In reply to]

Nick Coghlan <ncoghlan [at] gmail> added the comment:

Added to Py3k in r76324 (including the fixes made on 2.x after the
original checkin)

----------
resolution: -> accepted
status: open -> closed

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue6816>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Nov 17, 2009, 3:15 PM

Post #9 of 15 (349 views)
Permalink
[issue6816] Provide CPython command line functionality via runpy module [In reply to]

Antoine Pitrou <pitrou [at] free> added the comment:

Another probably related buildbot failure (again, lack of escaping the
regex pattern):

======================================================================
ERROR: test_directory_error (test.test_runpy.RunPathTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File
"/Users/buildbot/buildarea/3.x.heller-x86-osx5/build/Lib/runpy.py", line
125, in _get_main_module_details
return _get_module_details(main_name)
File
"/Users/buildbot/buildarea/3.x.heller-x86-osx5/build/Lib/runpy.py", line
115, in _get_module_details
raise ImportError("No code object available for %s" % mod_name)
ImportError: No code object available for __main__

During handling of the above exception, another exception occurred:

ImportError: can't find '__main__' module in
'/private/var/folders/hm/hmcPs0tuELuc-92a0F0LIk+++TM/-Tmp-/tmpp8zORb'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File
"/Users/buildbot/buildarea/3.x.heller-x86-osx5/build/Lib/test/test_runpy.py",
line 334, in test_directory_error
self._check_import_error(script_dir, msg)
File
"/Users/buildbot/buildarea/3.x.heller-x86-osx5/build/Lib/test/test_runpy.py",
line 295, in _check_import_error
self.assertRaisesRegexp(ImportError, msg, run_path, script_name)
File
"/Users/buildbot/buildarea/3.x.heller-x86-osx5/build/Lib/unittest/case.py",
line 869, in assertRaisesRegexp
callable_obj(*args, **kwargs)
File
"/Users/buildbot/buildarea/3.x.heller-x86-osx5/build/Lib/unittest/case.py",
line 126, in __exit__
expected_regexp = re.compile(expected_regexp)
File "/Users/buildbot/buildarea/3.x.heller-x86-osx5/build/Lib/re.py",
line 205, in compile
return _compile(pattern, flags)
File "/Users/buildbot/buildarea/3.x.heller-x86-osx5/build/Lib/re.py",
line 273, in _compile
p = sre_compile.compile(pattern, flags)
File
"/Users/buildbot/buildarea/3.x.heller-x86-osx5/build/Lib/sre_compile.py", line
491, in compile
p = sre_parse.parse(p, flags)
File
"/Users/buildbot/buildarea/3.x.heller-x86-osx5/build/Lib/sre_parse.py",
line 692, in parse
p = _parse_sub(source, pattern, 0)
File
"/Users/buildbot/buildarea/3.x.heller-x86-osx5/build/Lib/sre_parse.py",
line 315, in _parse_sub
itemsappend(_parse(source, state))
File
"/Users/buildbot/buildarea/3.x.heller-x86-osx5/build/Lib/sre_parse.py",
line 522, in _parse
raise error("multiple repeat")
sre_constants.error: multiple repeat

======================================================================
ERROR: test_zipfile_error (test.test_runpy.RunPathTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File
"/Users/buildbot/buildarea/3.x.heller-x86-osx5/build/Lib/runpy.py", line
125, in _get_main_module_details
return _get_module_details(main_name)
File
"/Users/buildbot/buildarea/3.x.heller-x86-osx5/build/Lib/runpy.py", line
115, in _get_module_details
raise ImportError("No code object available for %s" % mod_name)
ImportError: No code object available for __main__

During handling of the above exception, another exception occurred:

ImportError: can't find '__main__' module in
'/private/var/folders/hm/hmcPs0tuELuc-92a0F0LIk+++TM/-Tmp-/tmpOprB3K/test_zip.zip'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File
"/Users/buildbot/buildarea/3.x.heller-x86-osx5/build/Lib/test/test_runpy.py",
line 357, in test_zipfile_error
self._check_import_error(zip_name, msg)
File
"/Users/buildbot/buildarea/3.x.heller-x86-osx5/build/Lib/test/test_runpy.py",
line 295, in _check_import_error
self.assertRaisesRegexp(ImportError, msg, run_path, script_name)
File
"/Users/buildbot/buildarea/3.x.heller-x86-osx5/build/Lib/unittest/case.py",
line 869, in assertRaisesRegexp
callable_obj(*args, **kwargs)
File
"/Users/buildbot/buildarea/3.x.heller-x86-osx5/build/Lib/unittest/case.py",
line 126, in __exit__
expected_regexp = re.compile(expected_regexp)
File "/Users/buildbot/buildarea/3.x.heller-x86-osx5/build/Lib/re.py",
line 205, in compile
return _compile(pattern, flags)
File "/Users/buildbot/buildarea/3.x.heller-x86-osx5/build/Lib/re.py",
line 273, in _compile
p = sre_compile.compile(pattern, flags)
File
"/Users/buildbot/buildarea/3.x.heller-x86-osx5/build/Lib/sre_compile.py", line
491, in compile
p = sre_parse.parse(p, flags)
File
"/Users/buildbot/buildarea/3.x.heller-x86-osx5/build/Lib/sre_parse.py",
line 692, in parse
p = _parse_sub(source, pattern, 0)
File
"/Users/buildbot/buildarea/3.x.heller-x86-osx5/build/Lib/sre_parse.py",
line 315, in _parse_sub
itemsappend(_parse(source, state))
File
"/Users/buildbot/buildarea/3.x.heller-x86-osx5/build/Lib/sre_parse.py",
line 522, in _parse
raise error("multiple repeat")
sre_constants.error: multiple repeat

----------------------------------------------------------------------
Ran 16 tests in 32.210s

----------

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue6816>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Nov 18, 2009, 2:26 AM

Post #10 of 15 (345 views)
Permalink
[issue6816] Provide CPython command line functionality via runpy module [In reply to]

Nick Coghlan <ncoghlan [at] gmail> added the comment:

Hmm, I think I need to use a more robust regex escaping approach... I
never knew the OS level temp dir creation could get that creative.

----------

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue6816>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Nov 18, 2009, 3:32 AM

Post #11 of 15 (343 views)
Permalink
[issue6816] Provide CPython command line functionality via runpy module [In reply to]

Nick Coghlan <ncoghlan [at] gmail> added the comment:

I fixed the tests to use the proper escaping function from the re module
instead of directly doubling backslashes, so that error shouldn't happen
any more.

(Was it one of the unstable buildbots that picked this up? I didn't see
anything come through on the checkins list)

----------

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue6816>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Nov 18, 2009, 5:42 AM

Post #12 of 15 (335 views)
Permalink
[issue6816] Provide CPython command line functionality via runpy module [In reply to]

Antoine Pitrou <pitrou [at] free> added the comment:

> (Was it one of the unstable buildbots that picked this up? I didn't see
> anything come through on the checkins list)

Buildbot failures have stopped being e-mailed long ago it seems.
(ah, you really thought our buildbots were all green in all that
time? :P)

----------

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue6816>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Nov 18, 2009, 1:43 PM

Post #13 of 15 (329 views)
Permalink
[issue6816] Provide CPython command line functionality via runpy module [In reply to]

Nick Coghlan <ncoghlan [at] gmail> added the comment:

Antoine Pitrou wrote:
> Antoine Pitrou <pitrou [at] free> added the comment:
>
>> (Was it one of the unstable buildbots that picked this up? I didn't see
>> anything come through on the checkins list)
>
> Buildbot failures have stopped being e-mailed long ago it seems.
> (ah, you really thought our buildbots were all green in all that
> time? :P)

I knew the stable list was a lot shorter than the full list, so I
thought it was remotely possible :)

----------

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue6816>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Nov 18, 2009, 1:47 PM

Post #14 of 15 (330 views)
Permalink
[issue6816] Provide CPython command line functionality via runpy module [In reply to]

Changes by R. David Murray <rdmurray [at] bitdance>:


----------
nosy: -r.david.murray

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue6816>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Nov 19, 2009, 12:17 AM

Post #15 of 15 (323 views)
Permalink
[issue6816] Provide CPython command line functionality via runpy module [In reply to]

Changes by Chris Withers <chris [at] simplistix>:


----------
nosy: -cjw296

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue6816>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com

Python bugs RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.