[issue15623] Init time relative imports no longer work from __init__.so modules

2012-08-12 Thread Eric Snow

Eric Snow added the comment:

I was able to reproduce the error using a fresh build from tip (34d5ec8a1019):

/tmp/test$ PYTHON=/opt/python3.3/bin/python3 ./test.sh
['__main__', '_bisect', '_codecs', '_collections', '_frozen_importlib', 
'_functools', '_heapq', '_imp', '_io', '_locale', '_sre', '_sysconfigdata', 
'_thread', '_warnings', '_weakref', '_weakrefset', 'abc', 'bisect', 'builtins', 
'codecs', 'collections', 'collections.abc', 'copyreg', 'encodings', 
'encodings.aliases', 'encodings.latin_1', 'encodings.utf_8', 'errno', 
'functools', 'genericpath', 'heapq', 'io', 'itertools', 'keyword', 'locale', 
'marshal', 'operator', 'os', 'os.path', 'posix', 'posixpath', 're', 'reprlib', 
'signal', 'site', 'sre_compile', 'sre_constants', 'sre_parse', 'stat', 'sys', 
'sysconfig', 'weakref', 'zipimport']
Traceback (most recent call last):
  File string, line 1, in module
  File __init__.py, line 11, in init my_test_package 
(my_test_package/__init__.c:1106)
SystemError: Parent module 'my_test_package' not loaded, cannot perform 
relative import

--
nosy: +eric.snow

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15623
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15623] Init time relative imports no longer work from __init__.so modules

2012-08-12 Thread Eric Snow

Eric Snow added the comment:

The files, post-run:

$ find /tmp/test/
/tmp/test/
/tmp/test/my_test_package
/tmp/test/my_test_package/__init__.cpython-33dm.so
/tmp/test/my_test_package/a.cpython-33dm.so
/tmp/test/my_test_package/a.c
/tmp/test/my_test_package/a.py
/tmp/test/my_test_package/__init__.py
/tmp/test/my_test_package/__init__.c
/tmp/test/test.tgz
/tmp/test/build
/tmp/test/build/temp.linux-x86_64-3.3-pydebug
/tmp/test/build/temp.linux-x86_64-3.3-pydebug/my_test_package
/tmp/test/build/temp.linux-x86_64-3.3-pydebug/my_test_package/a.o
/tmp/test/build/temp.linux-x86_64-3.3-pydebug/my_test_package/__init__.o
/tmp/test/test.sh
/tmp/test/setup.py

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15623
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15623] Init time relative imports no longer work from __init__.so modules

2012-08-12 Thread Eric Snow

Eric Snow added the comment:

Traceback when run verbosely:

Traceback (most recent call last):
  File string, line 1, in module
  File frozen importlib._bootstrap, line 1529, in _find_and_load
  File frozen importlib._bootstrap, line 1496, in _find_and_load_unlocked
  File frozen importlib._bootstrap, line 583, in _check_name_wrapper
  File frozen importlib._bootstrap, line 498, in set_package_wrapper
  File frozen importlib._bootstrap, line 511, in set_loader_wrapper
  File frozen importlib._bootstrap, line 1109, in load_module
  File frozen importlib._bootstrap, line 310, in _call_with_frames_removed
  File __init__.py, line 11, in init my_test_package 
(my_test_package/__init__.c:1106)
SystemError: Parent module 'my_test_package' not loaded, cannot perform 
relative import

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15623
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15623] Init time relative imports no longer work from __init__.so modules

2012-08-12 Thread Eric Snow

Eric Snow added the comment:

in ___init__.c:963+, prior to executing the module proper (Python2 and PyPy 
handling removed):

  /*--- Module creation code ---*/
  __pyx_m = PyModule_Create(__pyx_moduledef);
  if (!__pyx_m) {...};
  __pyx_b = PyImport_AddModule(__Pyx_NAMESTR(__Pyx_BUILTIN_MODULE_NAME));
  if (!__pyx_b) {...};
  if (__Pyx_SetAttrString(__pyx_m, __builtins__, __pyx_b)  0) {...};
  /*--- Initialize various global constants etc. ---*/
  if (unlikely(__Pyx_InitGlobals()  0)) {...}
  if (__pyx_module_is_main_my_test_package) {
if (__Pyx_SetAttrString(__pyx_m, __name__, __pyx_n_smain__)  0) 
{...};
  }
  if (__Pyx_SetAttrString(__pyx_m, __file__, __pyx_kp_u_6)  0) {...};
  __pyx_t_1 = Py_BuildValue([O], __pyx_kp_u_7); if (unlikely(!__pyx_t_1)) 
{...}
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_SetAttrString(__pyx_m, __path__, __pyx_t_1)  0) {...};
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  /*--- Builtin init code ---*/
  if (unlikely(__Pyx_InitCachedBuiltins()  0)) {...}
  /*--- Constants init code ---*/
  if (unlikely(__Pyx_InitCachedConstants()  0)) {...}

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15623
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15623] Init time relative imports no longer work from __init__.so modules

2012-08-12 Thread Stefan Behnel

Stefan Behnel added the comment:

That's the module init code, yes, including the setting of __file__ and 
__path__ that I mentioned (due to issue13429). Setting at least one of the two 
is required in previous CPython versions to make relative imports work.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15623
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15573] Support unknown formats in memoryview comparisons

2012-08-12 Thread Stefan Krah

Stefan Krah added the comment:

Martin v. L??wis rep...@bugs.python.org wrote:
 Here is a more formal definition of my last proposal,
 
 v and w are equal iff
 v.shape() == w.shape() and
   ((v.format == w.format and v.tobytes() == w.tobytes()) or
v.tolist() == w.tolist())
 if tolist raises an exception for unsupported codes, they are not equal

This wouldn't solve the NaN problem though:

 nd = ndarray([(1,2)], shape=[1], format='dd', flags=ND_WRITABLE)
 nd[0] = (float('nan'), float('nan'))
 m = memoryview(nd)
 m == nd
True

What's the policy on importing modules in the Object/* hierarchy? Can we
import _struct?

The current unpack_cmp() function for identical single native format codes
is very fast. The only thing that would be needed to make it general is
to replace

   default: return -1;

with

   default: return unpack_cmp_struct();

The code is already there in _testbuffer.c. _testbuffer.c itself has 100%
code coverage (including all error conditions with a special patch).

This means that all tests are already present in test_buffer.py.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15573
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15623] Init time relative imports no longer work from __init__.so modules

2012-08-12 Thread Georg Brandl

Changes by Georg Brandl ge...@python.org:


--
priority: normal - deferred blocker

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15623
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15573] Support unknown formats in memoryview comparisons

2012-08-12 Thread Stefan Krah

Stefan Krah added the comment:

To be specific, after a quick look the only function from _testbuffer.c
that would be needed is unpack_single(). This really does not look very
complex.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15573
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15589] Bus error on Debian sparc

2012-08-12 Thread Stefan Krah

Stefan Krah added the comment:

Closing since the remaining issue is almost certainly a platform bug.

--
keywords:  -3.2regression, patch
resolution:  - wont fix
stage: needs patch - committed/rejected
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15589
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15626] unittest.main negates -bb option and programmatic warning configuration

2012-08-12 Thread Antoine Pitrou

Changes by Antoine Pitrou pit...@free.fr:


--
nosy: +michael.foord
versions: +Python 3.3

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15626
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15573] Support unknown formats in memoryview comparisons

2012-08-12 Thread Nick Coghlan

Nick Coghlan added the comment:

We do import modules in the Object/* code if we really need to (Grep for 
PyImport_Import in the Objects dir)

It seems to me like this case is rapidly reaching (or has even gone well past) 
the point where that's the sensible thing to do.

A couple of key issues of concern are:
- the number of modules implicitly imported at startup
- the risk of attempting to import a module before the import system (and the 
interpreter in general) is fully initialised

A simple trick for alleviating both concerns is to call PyImport_Import 
directly in the code path that needs it. It will be pretty quick if it gets a 
hit in the sys.modules cache, and most of the builtin objects aren't *used* 
until well after the interpreter is fully initialised (and, in the case of 
memoryview equality comparisons, often won't be used at all).

The main alternative is to invert the dependency: move the desired 
functionality into a private API function and have the standard library 
extension module access it that way. This can end up being harder to maintain, 
though, and certainly isn't appropriate in this case (since 
_struct.unpack_from needs the full struct machinery to do the job).

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15573
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15573] Support unknown formats in memoryview comparisons

2012-08-12 Thread Stefan Krah

Stefan Krah added the comment:

Thanks, Nick. I'll work on a struct module patch then. At this point for me
this is the only satisfying solution.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15573
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10848] Move test.regrtest from getopt to argparse

2012-08-12 Thread Chris Jerdonek

Chris Jerdonek added the comment:

I just discovered that issue 15302, which has a patch awaiting review from a 
month ago as well as some discussion, is a duplicate of this issue.

Would it be possible to leave that issue open (retitling either or both issues 
if necessary to avoid overlap)?  The discussion here seems broader in certain 
ways (e.g. discussing the behavior of certain options, pre-requisites for 
end-to-end testing of regrtest, adding a --more-help option, etc).  The patch 
in issue 15302 is narrower in that it handles testing via dependency injection 
so that main() can remain largely unaffected.

I could propose such a retitling.

 What about putting the addition option details in the epilog?

By the way, David, I did use epilog in my patch there (without having seen this 
thread). :)

--
nosy: +cjerdonek

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10848
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7652] Merge C version of decimal into py3k.

2012-08-12 Thread STINNER Victor

STINNER Victor added the comment:

Is there some remaining work on this issue? Or can it be closed?

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7652
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15627] Add a method to importlib.abc.SourceLoader for converting source to a code object

2012-08-12 Thread Yury Selivanov

Changes by Yury Selivanov yselivanov...@gmail.com:


--
nosy: +yselivanov

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15627
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10486] http.server doesn't set all CGI environment variables

2012-08-12 Thread Berker Peksag

Changes by Berker Peksag berker.pek...@gmail.com:


--
versions: +Python 3.3 -Python 2.6, Python 3.1

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10486
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7652] Merge C version of decimal into py3k.

2012-08-12 Thread Stefan Krah

Stefan Krah added the comment:

I'm almost done with my (second) self-review of mpdecimal.c. The only
functions missing are all Karatsuba functions and mpd_qpowmod().

If there are any takers, I would be very happy. For the Karatsuba functions
you'll probably need Roman Maeder's paper, which I could send to anyone
interested. All I can promise is that it's a beautiful formulation of the
algorithm. :)

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7652
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15605] Explain sphinx documentation building in devguide

2012-08-12 Thread Tshepang Lekhonkhobe

Changes by Tshepang Lekhonkhobe tshep...@gmail.com:


--
nosy: +tshepang

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15605
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15629] Run doctests in Doc/*.rst as part of regrtest

2012-08-12 Thread Chris Jerdonek

New submission from Chris Jerdonek:

This issue is to start running (at least some of) the doctests in the Doc/ 
folder's *.rst files as part of regrtest.

We will need a whitelist mechanism to tell regrtest which files to process 
since currently many doctests are not runnable (e.g. some kind of 
doctest-safe marker that can go in a file as suggested by Nick).

See also the discussion thread started here:

http://mail.python.org/pipermail/python-dev/2012-August/121304.html

--
assignee: docs@python
components: Documentation
messages: 168036
nosy: cjerdonek, docs@python
priority: normal
severity: normal
status: open
title: Run doctests in Doc/*.rst as part of regrtest
type: enhancement

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15629
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15629] Run doctests in Doc/*.rst as part of regrtest

2012-08-12 Thread Richard Oudkerk

Richard Oudkerk added the comment:

Might it be simpler to run doctest over the rst file from the relevant 
unittest?  (Perhaps with help from test.support.)

--
nosy: +sbt

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15629
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15629] Run doctests in Doc/*.rst as part of regrtest

2012-08-12 Thread Chris Jerdonek

Chris Jerdonek added the comment:

One option for whitelisting files would be to subclass doctest.DocTestParser 
and pass an instance as the parser argument to doctest.DocFileSuite:

http://docs.python.org/dev/library/doctest.html#doctest.DocFileSuite

The custom parser could look for the per-file marker before falling back to the 
usual parsing logic.  This would give us the functionality we need without 
having to make changes to doctest.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15629
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15629] Run doctests in Doc/*.rst as part of regrtest

2012-08-12 Thread Chris Jerdonek

Chris Jerdonek added the comment:

 Might it be simpler to run doctest over the rst file from the relevant 
 unittest?  (Perhaps with help from test.support.)

If I understand correctly, do you mean for example that 
Lib/test/test_textwrap.py could be responsible for loading the doctests in 
Doc/library/textwrap.rst?

One problem with this approach is that the *.rst files are not in one-to-one 
correspondence with unittest files in Lib/test, etc.  For example, there are 
folders of *.rst files that may not correspond to any unit test files (e.g. the 
tutorial folder).  It also introduces more coupling because the unit tests 
would now have to know about the existence of the Doc/*.rst files (though this 
could be a nice addition as it would let you run the doctests for a module 
along with its unit tests if you wanted to run tests only for a particular 
module).

Or did you mean something else?

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15629
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15629] Run doctests in Doc/*.rst as part of regrtest

2012-08-12 Thread Ezio Melotti

Ezio Melotti added the comment:

I'm not sure running these tests as part of regrtest is a good idea.
Fixing and/or marking the doctests is a good idea, and having a `make doctest` 
that reports no error is a desirable goal.  When `make doctest` works we could 
think about adding a regrtest option to run the doctests too, and if these 
tests don't take too much extra time to run we might even consider to run them 
by default (or at least when -uall is specified).
Having an option to run individual doctests would be nice too, and would 
encourage developers to test their doctests.
You should also see if there are more doctest-safe or more doctest-unsafe 
tests, and mark the ones in the smallest group.

--
nosy: +ezio.melotti

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15629
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15557] Tests for webbrowser module

2012-08-12 Thread Anton Barkovsky

Anton Barkovsky added the comment:

Thanks for the review, I've updated the patch.

--
Added file: http://bugs.python.org/file26774/test_webbrowser_v2.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15557
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15629] Run doctests in Doc/*.rst as part of regrtest

2012-08-12 Thread Chris Jerdonek

Chris Jerdonek added the comment:

 I'm not sure running these tests as part of regrtest is a good idea.

Can you provide reasons?

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15629
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15629] Run doctests in Doc/*.rst as part of regrtest

2012-08-12 Thread Ezio Melotti

Ezio Melotti added the comment:

 If I understand correctly, do you mean for example that 
 Lib/test/test_textwrap.py could be responsible for loading
 the doctests in Doc/library/textwrap.rst?

One advantage of this is that I could explicitly add a test in test_textwrap.py 
that loads the doctests in textwrap.rst and runs them.
This would allow me to decide if those tests should be run or not, and which 
ones are runnable.  If I know that textwrap.rst has no runnable tests I won't 
add the test, so by simply running test_textwrap I would be running all the 
tests I want/need to run.

OTOH this has disadvantages too.  If the tests are loaded explicitly it means 
that every test file that wants to load the doctests should be modified.  Even 
if foo.rst has no runnable doctests and no test to load them is added to 
test_foo.py, a `make doctest` might still include the file unless we mark it in 
some way (either by a module-wide directive, or by marking all the individual 
snippets of code).

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15629
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15629] Run doctests in Doc/*.rst as part of regrtest

2012-08-12 Thread Ezio Melotti

Ezio Melotti added the comment:

 Can you provide reasons?

Regrtest takes already a few minutes to run, adding these tests will make it 
even slower and the tradeoff might not be worthwhile (I'm assuming that most of 
the doctests are basic examples that are already well tested, and the 
occasional typos can be found by simply run `make doctest` every once in a 
while).
The tests currently have many failures and output, so adding them now will make 
the regrtest output more confusing.  Integrating this with regrtest requires 
some work, for example you would have to count successes/failures, add skips 
for certain tests and resources to control what tests should be run (there's 
currently a turtle going around on my screen when I run `make doctest`).  This 
will make regrtest even more complex.
People might not care to run these doctests if they are not touching the docs, 
and if they are, they might prefer to check only the specific doc file they 
changed.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15629
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15629] Run doctests in Doc/*.rst as part of regrtest

2012-08-12 Thread Georg Brandl

Georg Brandl added the comment:

One possibility to avoid tons and tons of failures that have to be fixed is to 
convert working doctests to the explicit syntax

.. doctest::

   blah

and set doctest_test_doctest_blocks to False in the Sphinx conf.py.

--
nosy: +georg.brandl

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15629
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15617] FAIL: test_create_connection (test.test_socket.NetworkConnectionNoServer)

2012-08-12 Thread Floris Bruynooghe

Floris Bruynooghe added the comment:

I have no issue with changing the buildhost's zone configuration if that's
the right thing to do. Just one more option. Is widening the expected errno
in the test a valid thing to do?

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15617
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15629] Run doctests in Doc/*.rst as part of regrtest

2012-08-12 Thread Richard Oudkerk

Richard Oudkerk added the comment:

 the occasional typos can be found by simply run `make doctest` every once 
 in a while).

But doesn't make doctest attempt to run the doctests using Python 2.x 
(because Sphinx does not support Python 3.x).

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15629
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15629] Run doctests in Doc/*.rst as part of regrtest

2012-08-12 Thread Richard Oudkerk

Richard Oudkerk added the comment:

An example from the output of make doctest which fails because Python 2.x is 
being used:

**
File library/multiprocessing.rst, line 453, in default
Failed example:
print(p, p.is_alive())
Expected:
Process(Process-1, initial) False
Got:
(Process(Process-1, initial), False)
**

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15629
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15630] Missing continue example for for loop tutorial

2012-08-12 Thread Daniel Ellis

New submission from Daniel Ellis:

Found by Jesse Bikman:

On this page, http://docs.python.org/tutorial/controlflow.html there is no 
example in the code of a continue statement (section 4.4). It is explained, 
but not actually used in code.

--
assignee: docs@python
components: Documentation
messages: 168049
nosy: Daniel.Ellis, docs@python
priority: normal
severity: normal
status: open
title: Missing continue example for for loop tutorial

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15630
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15629] Run doctests in Doc/*.rst as part of regrtest

2012-08-12 Thread Georg Brandl

Georg Brandl added the comment:

Yeah, once we switch around to using the build Python for this...

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15629
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15629] Run doctests in Doc/*.rst as part of regrtest

2012-08-12 Thread Éric Araujo

Éric Araujo added the comment:

Using Python 3 to run Sphinx is tracked in #10224.  I thought there was already 
an issue to make the doctests runnable but can't find it, maybe it was only a 
discussion on a mailing list a year or two ago.

--
nosy: +eric.araujo

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15629
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15557] Tests for webbrowser module

2012-08-12 Thread Chris Jerdonek

Chris Jerdonek added the comment:

It still seems like things could be made more DRY.  Also, the pattern of having 
assert_unix_browser() execute various function blocks depending on whether 
various arguments are not None doesn't seem as clean or scalable as it should 
be (e.g. if the number of assert statements were to grow).

What about defining helper methods like check_open(), check_open_new_tab(), and 
check_open_new(), and then having the various test_browser() methods call 
each of them as appropriate?  For example--

+browser.open_new('http://www.example.com/')
+args = popen.cmd_line
+self.assertEqual(args, ['test', '-raise', '-remote',
+'openURL(http://www.example.com/,new-window)'])

could become a call to check_open_new().  The helper methods could default to 
the most common string arguments so that you will only need to define and pass 
the string arguments when the browser uses strings that are different from the 
defaults.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15557
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15623] Init time relative imports no longer work from __init__.so modules

2012-08-12 Thread Brett Cannon

Brett Cannon added the comment:

I don't have time to delve into C debugging right now, but the question is what 
changed between 3.2 and 3.3 in terms of when an extension module is inserted 
into sys.modules since that is the issue ATM. Probably some time in gdb 
starting in the module's init code and following it to when it is inserted into 
sys.modules should answer the question (hopefully).

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15623
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15630] Missing continue example for for loop tutorial

2012-08-12 Thread Daniel Ellis

Daniel Ellis added the comment:

Added basic example for continue.

--
keywords: +patch
Added file: http://bugs.python.org/file26775/for_continue_doc.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15630
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15630] Missing continue example for for loop tutorial

2012-08-12 Thread Raymond Hettinger

Raymond Hettinger added the comment:

This looks good.   Please remove the ...  prompt from the example so that the 
code is cut-and-pasteable by people who want to experiment with the example.

--
nosy: +rhettinger

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15630
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15630] Missing continue example for for loop tutorial

2012-08-12 Thread Daniel Ellis

Daniel Ellis added the comment:

Oh, I was keeping with the format of the other examples in the tutorial.  
Should I remove the prompts from all of them?

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15630
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15630] Missing continue example for for loop tutorial

2012-08-12 Thread Chris Jerdonek

Chris Jerdonek added the comment:

 Please remove the ...  prompt from the example so that the code is 
 cut-and-pasteable by people who want to experiment with the example.

That is the usual format for docstring examples.  See, for example--

http://docs.python.org/dev/library/doctest.html#how-are-docstring-examples-recognized

--
nosy: +cjerdonek

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15630
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15623] Init time relative imports no longer work from __init__.so modules

2012-08-12 Thread Eric Snow

Eric Snow added the comment:

This smells like a case of where sys.modules got replaced by another mapping, 
but import.c continues using interp-modules.  I won't be able to investigate 
until tomorrow.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15623
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15623] Init time relative imports no longer work from __init__.so modules

2012-08-12 Thread Georg Brandl

Changes by Georg Brandl ge...@python.org:


--
nosy: +georg.brandl

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15623
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15631] Python 3.3 beta 1 installation issue lib/lib64 folders

2012-08-12 Thread ita1024

New submission from ita1024:

On opensuse 12.1, python 3.3 installs its extensions in 
/usr/local/lib64/python3.3/lib-dynload/, but the .py files are in 
/usr/local/lib/python3.3/.

When launching python 3.3 one gets:
Could not find platform dependent libraries exec_prefix
Consider setting $PYTHONHOME to prefix[:exec_prefix]
Python 3.3.0b1 (default, Aug 11 2012, 10:45:34) 
[GCC 4.6.2] on linux
Type help, copyright, credits or license for more information.
Traceback (most recent call last):
  File /etc/pythonstart, line 5, in module
import atexit
  File frozen importlib._bootstrap, line 1294, in _find_and_load
  File frozen importlib._bootstrap, line 1258, in _find_and_load_unlocked
ImportError: No module named 'atexit'

The same thing happens when installing with a --prefix.

Moving the directory lib64/python3.3/lib-dynload to lib/python3.3/lib-dynload 
fixes the problem.

--
components: Build
messages: 168059
nosy: ita1024
priority: normal
severity: normal
status: open
title: Python 3.3 beta 1 installation issue lib/lib64 folders
versions: Python 3.3

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15631
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15627] Add a method to importlib.abc.SourceLoader for converting source to a code object

2012-08-12 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com:


--
nosy: +Arfrever

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15627
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15628] Add import ABC hierarchy to docs for importlib

2012-08-12 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com:


--
nosy: +Arfrever

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15628
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15631] Python 3.3 beta 1 installation issue lib/lib64 folders

2012-08-12 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com:


--
nosy: +Arfrever

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15631
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15557] Tests for webbrowser module

2012-08-12 Thread Anton Barkovsky

Anton Barkovsky added the comment:

Updated, added separate helper methods and 'test' and 'http://www.example.com/' 
are no longer hardcoded.

 The helper methods could default to the most common string arguments so that 
 you will only need to define and pass the string arguments when the browser 
 uses strings that are different from the defaults.

I don't see a good reason to provide defaults. If some browsers have same 
arguments it's just a coincidence, the arguments are not likely to ever change, 
 and I don't like when a test case is scattered all over the module in the form 
of defaults.

--
Added file: http://bugs.python.org/file26776/test_webbrowser_v3.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15557
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15630] Missing continue example for for loop tutorial

2012-08-12 Thread Roundup Robot

Roundup Robot added the comment:

New changeset a4d5ac78a76b by Senthil Kumaran in branch '2.7':
Issue #15630: Add an example for continue statement in the tutorial. Patch by
http://hg.python.org/cpython/rev/a4d5ac78a76b

New changeset e855e6c26dfb by Senthil Kumaran in branch '3.2':
Issue #15630: Add an example for continue statement in the tutorial. Patch by
http://hg.python.org/cpython/rev/e855e6c26dfb

New changeset dd41c287cf7c by Senthil Kumaran in branch 'default':
merge from 3.2
http://hg.python.org/cpython/rev/dd41c287cf7c

--
nosy: +python-dev

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15630
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15630] Missing continue example for for loop tutorial

2012-08-12 Thread Senthil Kumaran

Senthil Kumaran added the comment:

Thanks for the patch, Daniel. Fixed in all versions.

--
nosy: +orsenthil
resolution:  - fixed
stage:  - committed/rejected
status: open - closed
type:  - behavior

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15630
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15632] regrtest.py: spurious leaks with -R option

2012-08-12 Thread Stefan Krah

New submission from Stefan Krah:

With the -R option, test_buffer.py needs an additional warm-up for
the unicode_latin1 cache. Patch attached.

--
components: Tests
files: warm_latin1_cache.diff
keywords: patch
messages: 168063
nosy: skrah
priority: normal
severity: normal
stage: patch review
status: open
title: regrtest.py: spurious leaks with -R option
type: behavior
versions: Python 3.2, Python 3.3
Added file: http://bugs.python.org/file26777/warm_latin1_cache.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15632
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15631] Python 3.3 beta 1 installation issue lib/lib64 folders

2012-08-12 Thread Antoine Pitrou

Changes by Antoine Pitrou pit...@free.fr:


--
priority: normal - high

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15631
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15557] Tests for webbrowser module

2012-08-12 Thread Chris Jerdonek

Chris Jerdonek added the comment:

Thanks, Anton.  It is looking a lot better now.  I still have comments, but 
because my comments have not been on the substance of the patch and because I 
am not a core developer, I will defer to others at this point.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15557
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15632] regrtest.py: spurious leaks with -R option

2012-08-12 Thread Meador Inge

Meador Inge added the comment:

I know the title says spurious, but is there a way to reproduce this at all?  
Can I run a certain suite N times or something?  How did you find the problem?

--
nosy: +meador.inge

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15632
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15627] Add a method to importlib.abc.SourceLoader for converting source to a code object

2012-08-12 Thread Meador Inge

Changes by Meador Inge mead...@gmail.com:


--
nosy: +meador.inge

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15627
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15623] Init time relative imports no longer work from __init__.so modules

2012-08-12 Thread Meador Inge

Changes by Meador Inge mead...@gmail.com:


--
nosy: +meador.inge

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15623
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15632] regrtest.py: spurious leaks with -R option

2012-08-12 Thread Stefan Krah

Stefan Krah added the comment:

I'm attaching a test case. You're right, in test_buffer it's
hard to reproduce but I've encountered the leak several times
in the past months.

Today I realized that the leak always occurred with format code
'c'. There's this passage in test_buffer:

x = randrange(*fmtdict[mode][char])
if char == 'c':
x = bytes(chr(x), 'latin1')


After some head scratching I looked into regrtest.py and found
the warm_char_cache() function. The whole thing makes sense: In
each repetition of the refleak mode new characters can be added
to the unicode_latin1 cache.


So, you should be able to reproduce the issue:

$ ./python -m test -uall -R 2:2 test_pseudo_leak
[1/1] test_pseudo_leak
beginning 4 repetitions
1234

test_pseudo_leak leaked [8, 8] references, sum=16
1 test failed:
test_pseudo_leak
[151225 refs]

--
Added file: http://bugs.python.org/file26778/test_pseudo_leak.py

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15632
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15629] Run doctests in Doc/*.rst as part of regrtest

2012-08-12 Thread Brett Cannon

Changes by Brett Cannon br...@python.org:


--
nosy: +brett.cannon

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15629
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15629] Run doctests in Doc/*.rst as part of regrtest

2012-08-12 Thread R. David Murray

R. David Murray added the comment:

The point of running the doctests in the docs to to make sure the *docs* are 
correct, not to make sure Python is correct.  So IMO adding them to regrtest is 
much more trouble than the tiny benefit it would produce for test coverage.  On 
the other hand, having 'make doctest' run when '-uall' is specified would be 
cool, if the tests can thus be run by the buildbots.

But I think should be 'make doctest', and not regrtest using doctest to process 
.rst files.  The reason is that Sphinx has extra facilities that allow 
docttests to work without having to have boilerplate code in places where 
doing so would disrupt the narrative flow.  I could be mis-remembering (and 
Georg will correct me if I am misremembering again :), but I don't think those 
work when doctest is used directly against the .rst file.

--
nosy: +r.david.murray

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15629
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15633] httplib.response is not closed after all data has been read

2012-08-12 Thread Nikolaus Rath

New submission from Nikolaus Rath:

Occasionally, the isclosed() method of HTTPResponse instances returns False, 
even though a preceding read() call returned '' (or something else that evalues 
to False).

This is a problem, because then the corresponding HTTPConnection can still be 
used to send another request, but an attempt to retrieve its response result it 
in ResponseNotReady() exception.

I have not found anything special about the requests for which this happens. I 
also looked at the httplib code and found no way for this to happen, but 
obviously I am missing something. Maybe someone more familiar with the codebase 
can tell what's happening there.

The problem happens to rarely to be able to run packet capture, but I can 
provide attributes of the relevant httplib instances if desired.

--
components: Library (Lib)
messages: 168068
nosy: Nikratio
priority: normal
severity: normal
status: open
title: httplib.response is not closed after all data has been read
type: behavior
versions: Python 2.7

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15633
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15629] Run doctests in Doc/*.rst as part of regrtest

2012-08-12 Thread Glenn Linderman

Glenn Linderman added the comment:

Another idea would be to make a notation that looks exactly* like doctests for 
documentation purposes, but that doctest would not run.  Then, non-runnable 
doctests could be skipped, and runnable ones could be run. This would help keep 
the runnable code in the documentation validated, but would be on a 
test-by-test basis, rather than file by file.

--
nosy: +v+python

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15629
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com