[issue12600] Add example of using load_tests to parameterise Test Cases

2012-12-12 Thread Mark Dickinson

Changes by Mark Dickinson dicki...@gmail.com:


--
nosy: +mark.dickinson

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



[issue15861] ttk.Treeview unmatched open brace in list

2012-12-12 Thread Serhiy Storchaka

Changes by Serhiy Storchaka storch...@gmail.com:


Removed file: http://bugs.python.org/file28011/tkinter_quoting_2.patch

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



[issue15861] ttk.Treeview unmatched open brace in list

2012-12-12 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Patch updated. Added additional tests for ttk.Combobox (see issue11290).

--
Added file: http://bugs.python.org/file28286/tkinter_quoting_3.patch

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



[issue15861] ttk.Treeview unmatched open brace in list

2012-12-12 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Patch for 2.7 added.

--
Added file: http://bugs.python.org/file28287/tkinter_quoting_3-2.7.patch

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



[issue11290] ttk.Combobox['values'] String Conversion to Tcl

2012-12-12 Thread Serhiy Storchaka

Changes by Serhiy Storchaka storch...@gmail.com:


--
superseder:  - ttk.Treeview unmatched open brace in list
versions: +Python 2.7, Python 3.2, Python 3.4

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



[issue15045] Make textwrap.dedent() consistent with str.splitlines(True) and str.strip()

2012-12-12 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Ezra's patch is working, but a little non-optimal.

However, I'm not sure, that it is right to extend a set of whitespace 
characters. See comments at the top of the file.

Also this approach should be slower, especially for trivial case (no changes).

--
nosy: +serhiy.storchaka
stage: needs patch - patch review

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



[issue16656] os.walk ignores international dirs on Windows

2012-12-12 Thread anatoly techtonik

anatoly techtonik added the comment:


 - Do you have a full traceback of the failing os.walk() in Python3.3?


Traceback (most recent call last):
  File test.py, line 9, in module
print(dirs)
  File C:\Python33\lib\encodings\cp437.py, line 19, in encode
return codecs.charmap_encode(input,self.errors,encoding_map)[0]
UnicodeEncodeError: 'charmap' codec can't encode characters in position
18-24: character maps to undefined

 - What's the result of os.listdir(u'.') ?


python3 -c import os; print(os.listdir(u'.'))
Traceback (most recent call last):
  File string, line 1, in module
  File C:\Python33\lib\encodings\cp437.py, line 19, in encode
return codecs.charmap_encode(input,self.errors,encoding_map)[0]
UnicodeEncodeError: 'charmap' codec can't encode characters in position
41-47: character maps to undefined

python2 -c import os; print(os.listdir(u'.'))
[u'English name', u'test.py', u'test2.py',
u'\u0420\u0443\u0441\u0441\u043a\u043e\u0435 \u0438\u043c\u044f']

python2 -c import os; print(os.listdir('.'))
['English name', 'test.py', 'test2.py', '??? ???']

--

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



[issue13590] extension module builds fail with python.org OS X installers on OS X 10.7 and 10.6 with Xcode 4.2

2012-12-12 Thread Ronald Oussoren

Ronald Oussoren added the comment:

Ned: do you have time to backport this to 3.2 and 2.7?

Also, the code might not be entirely correct for all machines: on my machine 
'gcc-4.2' still exists in /usr/bin but doesn't work because the actual compiler 
(/usr/bin/i686-apple-darwin11-gcc-4.2.1) is no longer present. This is with 
Xcode 4.5.2.

I haven't checked yet if that actually causes a problem with the binary 
installer for Python 3.3.

--

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



[issue16668] Remove python3dll.vcxproj from pcbuild.sln

2012-12-12 Thread Trent Nelson

New submission from Trent Nelson:

As far as I can tell, the python3dll.vcxproj is bitrot and should be removed 
from pcbuild.sln.  It's a makefile target project that invokes 
..\PC\python3.mak, which builds a target named python3.dll; however, 
pythoncore.vxcproj builds python34[_d].dll as a proper VS project.

(Additionally, the python3dll.vxcproj has no Debug configuration, which is what 
brought it to my attention in the first place.)

Christian/Martin: is this python3dll.vcxproj and resulting python3.dll still 
used or can it be safely removed from pcbuild.sln?

--
assignee: trent
components: Build
messages: 177372
nosy: christian.heimes, loewis, trent
priority: normal
severity: normal
status: open
title: Remove python3dll.vcxproj from pcbuild.sln
versions: Python 3.2, Python 3.3, Python 3.4

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



[issue16656] os.walk ignores international dirs on Windows

2012-12-12 Thread anatoly techtonik

anatoly techtonik added the comment:

I attach tests.py file used to run the tests. Results are in python2.out.txt 
and python3.out.txt also attached.

 What are the results of os.stat(b'Русское имя') and os.stat(b'Русское имя') 
 on Python 2.7 and Python 3.3+?

b'Русское имя' is not a valid syntax construct in Python 3 even though I have 
correct 'coding: utf-8' header and expect characters to be utf-8 bytes. 
Therefore I skipped this test for Python 3.
 python test.py
  File tests.py, line 23
print(os.stat(b'\u0420\u0443\u0441\u0441\u043a\u043e\u0435 
\u0438\u043c\u044f'))
   ^
SyntaxError: bytes can only contain ASCII literal characters.

--

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



[issue16656] os.walk ignores international dirs on Windows

2012-12-12 Thread anatoly techtonik

Changes by anatoly techtonik techto...@gmail.com:


Added file: http://bugs.python.org/file28288/tests.py

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



[issue16656] os.walk ignores international dirs on Windows

2012-12-12 Thread anatoly techtonik

Changes by anatoly techtonik techto...@gmail.com:


Added file: http://bugs.python.org/file28289/python2.out.txt

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



[issue16656] os.walk ignores international dirs on Windows

2012-12-12 Thread anatoly techtonik

Changes by anatoly techtonik techto...@gmail.com:


Added file: http://bugs.python.org/file28290/python3.out.txt

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



[issue16656] os.walk ignores international dirs on Windows

2012-12-12 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Thank you, Anatoly, for report. I'll try to investigate this issue.

--

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



[issue16480] pyvenv 3.3 fails to create symlinks for virtualenv/local/{bin, lib} to virtualenv/{bin, lib}

2012-12-12 Thread Matthias Klose

Changes by Matthias Klose d...@debian.org:


--
nosy: +doko

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



[issue16656] os.walk ignores international dirs on Windows

2012-12-12 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc added the comment:

So, it seems that os.walk() and os.listdir() work correctly with Python3.3, but 
print(u'Русское имя') fails because the terminal encoding is cp437.

See issue1602 for the print issue.
As a quick workaround, try to set PYTHONIOENCODING=cp437:backslashreplace as 
suggested in http://wiki.python.org/moin/PrintFails

If nothing is wrong with os.walk() and os.listdir(), this issue should be 
closed.

--

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



[issue16612] Integrate Argument Clinic specialized preprocessor into CPython trunk

2012-12-12 Thread Stefan Krah

Stefan Krah added the comment:

Gregory, I'm talking about the size of the *total output* of the tool, not
about the size of the actual DSL parts:

posixmodule.c: 1138211514+132 (2 functions)
_cursesmodule.c:3434 3499 +65 (1 function)
zlibmodule.c:   1295 1336 +41 (1 function)
_dbmmodule.c:437  488 +51 (1 function)

To this you have to add the proposed data structure for the signature
information (one per function, if I understand correctly).

For _decimal.c the situation is worse, since all docstrings are currently
in a header file. So I think that my estimate of +100 lines per function
is not exaggerated.

--

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



[issue16656] os.walk ignores international dirs on Windows

2012-12-12 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Anatoly, can you please run the attached test?

--
Added file: http://bugs.python.org/file28291/test_unicode_fname.py

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



[issue16656] os.walk ignores international dirs on Windows

2012-12-12 Thread R. David Murray

R. David Murray added the comment:

Based on the pasted results I'm pretty sure there's nothing wrong with walk and 
listdir.  But it sounds like Serhiy will check to make sure, so we'll wait for 
his report.

The byte string vs the coding cookie is an interesting observation, but is a 
separate issue and should probably be raised on python-ideas, since I'm 
guessing it the current behavior was a conscious design choice.

--

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



[issue14266] pyunit script as shorthand for python -m unittest

2012-12-12 Thread Berker Peksag

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


--
keywords: +patch
nosy: +berker.peksag
versions: +Python 3.4 -Python 3.3
Added file: http://bugs.python.org/file28292/issue14266.diff

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



[issue16668] Remove python3dll.vcxproj from pcbuild.sln

2012-12-12 Thread Trent Nelson

Changes by Trent Nelson tr...@snakebite.org:


--
nosy: +brian.curtin

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



[issue16326] distutils build_ext fails to set library_dirs in 2.7.2 on Linux

2012-12-12 Thread Andy Salnikov

Andy Salnikov added the comment:

OK, I see the problem. Do you think it would help if it tested both
sys.executable and its symlynk-resolved path against sys.exec_prefix
like this:

if sys.executable.startswith(os.path.join(sys.exec_prefix, bin)) 
or

os.path.realpath(sys.executable).startswith(os.path.join(sys.exec_prefix, 
bin)):
# building third party extensions
self.library_dirs.append(sysconfig.get_config_var('LIBDIR'))
else:
# building python standard extensions
self.library_dirs.append('.')

Alternatively one can reverse the test. I guess that 'else:' is supposed
to apply when one builds new Python installation? Where does the 
sys.executable points to in this case? Is there any other (more reliable)
way to figure out that the standard extensions are being built instead of
third-party modules?

Andy

--

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



[issue16656] os.walk ignores international dirs on Windows

2012-12-12 Thread Serhiy Storchaka

Changes by Serhiy Storchaka storch...@gmail.com:


Added file: http://bugs.python.org/file28293/test_unicode_fname.py

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



[issue16656] os.walk ignores international dirs on Windows

2012-12-12 Thread Serhiy Storchaka

Changes by Serhiy Storchaka storch...@gmail.com:


Removed file: http://bugs.python.org/file28291/test_unicode_fname.py

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



[issue16668] Remove python3dll.vcxproj from pcbuild.sln

2012-12-12 Thread Jeremy Kloth

Changes by Jeremy Kloth jeremy.kloth+python-trac...@gmail.com:


--
nosy: +jkloth

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



[issue16668] Remove python3dll.vcxproj from pcbuild.sln

2012-12-12 Thread Martin v . Löwis

Martin v. Löwis added the comment:

Yes, it's still used. python3.dll is different from python3X.dll, and specified 
in PEP 384. It will remain in Python until Python 4 comes along (and then 
likely be replaced by python4.dll).

--
resolution:  - invalid
status: open - closed

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



[issue16669] Docstrings for namedtuple

2012-12-12 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

Here are two patches which implementation two different interface for same 
feature.

In first patch you can use *doc* and *field_docs* arguments to specify 
namedtuple class docstring and field docstrings. For example:

Point = namedtuple('Point', 'x y',
   doc='Point: 2-dimensional coordinate',
   field_docs=['abscissa', 'ordinate'])

In second patch you can use *doc* argument to specify namedtuple class 
docstring and *field_names* argument can be a sequence of pairs: field name and 
field docstring. For example:

Point = namedtuple('Point', [('x', 'absciss'), ('y', 'ordinate')],
   doc='Point: 2-dimensional coordinate')

What approach is better?

Feel free to correct a documentation. I know that it need a correction.

--
components: Library (Lib)
files: namedtuple_docstrings_field_docs.patch
keywords: patch
messages: 177381
nosy: rhettinger, serhiy.storchaka
priority: normal
severity: normal
status: open
title: Docstrings for namedtuple
type: enhancement
versions: Python 3.4
Added file: 
http://bugs.python.org/file28294/namedtuple_docstrings_field_docs.patch

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



[issue16669] Docstrings for namedtuple

2012-12-12 Thread Serhiy Storchaka

Changes by Serhiy Storchaka storch...@gmail.com:


Added file: 
http://bugs.python.org/file28295/namedtuple_docstrings_tuples_seq.patch

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



[issue16670] [docs] class Point in collections.namedtuples may be not that good example

2012-12-12 Thread julien tayon

New submission from julien tayon:

Priority: low
Keywords: documentation

After watching 
http://www.youtube.com/watch?v=o9pEzgHorH0 (Stop writing classes by diedrich)
I think the class Point example for the named tuples may be a wrong practice: 
http://docs.python.org/2/library/collections.html#collections.namedtuple

Since complex basic types

1*  does the same, (if x is real and y is imag)
2*  does more (rotation, norms,  symbolic notation with i)

At my opnion pointing some code to http://bugs.python.org/issue1818 (if it is 
accepted) may be the case of use of the named tuple.

--
assignee: docs@python
components: Documentation
messages: 177382
nosy: docs@python, julien.tayon
priority: normal
severity: normal
status: open
title: [docs] class Point in collections.namedtuples may be not that good 
example
versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3

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



[issue16668] Remove python3dll.vcxproj from pcbuild.sln

2012-12-12 Thread Trent Nelson

Trent Nelson added the comment:

Thanks Martin, I wasn't aware of that PEP.  Explains why there isn't a debug 
configuration, too.

--

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



[issue16665] doc for builtin hex() is poor

2012-12-12 Thread rurpy

rurpy added the comment:

Raymond Hettinger (rhettinger) msg177365:
 For some of the points, a couple examples will do a better job of explaining 
 hex() that trying to write-out the full code specification in prose.  

Examples should never substitute for a clear, complete and concise description. 
 Examples serve to illustrate and clarify a description.  An example can only 
describe usage at a single point in the solution space.  The prose description 
(when well written) describes the total solution space.  

 Overly wordy documentation is harder to use than something short that 
 addresses the primary use case.

No comments in this issue have suggested providing an overly wordy 
description.  The suggestion was for wording that accurately and concisely 
describes the behavior of the hex() function.  That is what good reference 
material is supposed to do.

Reference documentation should describe the behavior of its subject including 
any corner cases.  Addressing only the primary use case is not sufficient.  
For addressing the primary use case, supplement the prose with an example.

 Also, the suggested notes editorialize and venture into the realm of 
 personal coding preferences.

That characterization is incorrect.  
 
There is no editorializing (if this in reference to the word flexible in the 
note).  It is a fact that string formatting with the %x specifier also converts 
to hex and offers more control over the output than the hex() function does.  A 
reader interested in the hex() function should be apprised of this alternative. 
 Perhaps there is some other word that you would find more neutral than 
flexible?

There is no venturing into personal coding preferences -- only the factual and 
appropriate mention of an alternative.

One of the cheapest, easiest ways of improving documentation is good 
cross-referencing to related items.

--

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



[issue16671] logging.handlers.QueueListener sentinel should not be None

2012-12-12 Thread Andras Szalai

New submission from Andras Szalai:

In the class `logging.handlers.QueueListener` the `_sentinel` is `None`.

But
 a = None
 b = None
 a is b
True

Because of this, the QueueListener stops if it receives a `None`.
Were the sentinel a proper instance, like:
_sentinel = {}

This would not happen.

--
messages: 177385
nosy: Andras.Szalai
priority: normal
severity: normal
status: open
title: logging.handlers.QueueListener sentinel should not be None
type: behavior
versions: Python 3.1, Python 3.2, Python 3.3, Python 3.4, Python 3.5

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



[issue16659] Pure Python implementation of random

2012-12-12 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Patch updated. Comments and docstrings a little enhanced. Thanks Brett for 
review.

Also Python implementation of core generator now is threadsafe (in particular 
random() and getrandbits() methods) as its C implementation and its private 
members now are more hidden (to prevent unintentional conflicts). See 
differences between patches for details.

--
Added file: http://bugs.python.org/file28296/random_pure_python_4.patch

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



[issue16607] Bad examples in documentation

2012-12-12 Thread myreallycoolname

myreallycoolname added the comment:

I am updating my bug report unfortunatly I am unable to give you a specific 
link due to the fact that I can not find the python3.2 documentation online. I 
do assure you that the docs from my computer are for python3.2 (as I have no 
other docs installed.) To find the docs I'm complaining about go to the index 
select tutorial and click on the classes section. The bad code along with the 
start of the chapter it is located in and the trace backs follow. Please note 
that errors are cumulative. In other words if you use variable a and variable a 
has no value (not created deffined etc.) then every time you use it you will 
get an error. Code follows:



9.2.1. Scopes and Namespaces Example
This is an example demonstrating how to reference the different scopes and 
namespaces, and howglobal and nonlocal affect variable binding:





 def scope_test():
... def do_local():
... spam = local spam
... def do_nonlocal():
... nonlocal spam
... spam = nonlocal spam
... def do_global():
... global spam
... spam = global spam
... 
SyntaxError: no binding for nonlocal 'spam' found
 spam = test spam
  File stdin, line 1
spam = test spam
^
IndentationError: unexpected indent
 do_local()
  File stdin, line 1
do_local()
^
IndentationError: unexpected indent
 print(After local assignment:, spam)
  File stdin, line 1
print(After local assignment:, spam)
^
IndentationError: unexpected indent
 do_nonlocal()
  File stdin, line 1
do_nonlocal()
^
IndentationError: unexpected indent
 print(After nonlocal assignment:, spam)
  File stdin, line 1
print(After nonlocal assignment:, spam)
^
IndentationError: unexpected indent
 do_global()
  File stdin, line 1
do_global()
^
IndentationError: unexpected indent
 print(After global assignment:, spam)
  File stdin, line 1
print(After global assignment:, spam)
^
IndentationError: unexpected indent
 
 scope_test()
Traceback (most recent call last):
  File stdin, line 1, in module
NameError: name 'scope_test' is not defined
 print(In global scope:, spam)
Traceback (most recent call last):
  File stdin, line 1, in module
NameError: name 'spam' is not defined




9.3.3. Instance Objects
Now what can we do with instance objects? The only operations understood by 
instance objects are attribute references. There are two kinds of valid 
attribute names, data attributes and methods.
data attributes correspond to “instance variables” in Smalltalk, and to “data 
members” in C++. Data attributes need not be declared; like local variables, 
they spring into existence when they are first assigned to. For example, if x 
is the instance of MyClass created above, the following piece of code will 
print the value 16, without leaving a trace:





 x.counter = 1
 while x.counter  10:
... x.counter = x.counter * 2
... print(x.counter)
  File stdin, line 3
print(x.counter)
^
SyntaxError: invalid syntax
 del x.counter


9.9. Iterators
By now you have probably noticed that most container objects can be looped over 
using a forstatement:




 for element in [1, 2, 3]:
... print(element)
... for element in (1, 2, 3):
  File stdin, line 3
for element in (1, 2, 3):
  ^
SyntaxError: invalid syntax
 print(element)
  File stdin, line 1
print(element)
^
IndentationError: unexpected indent
 for key in {'one':1, 'two':2}:
... print(key)
... for char in 123:
  File stdin, line 3
for char in 123:
  ^
SyntaxError: invalid syntax
 print(char)
  File stdin, line 1
print(char)
^
IndentationError: unexpected indent
 for line in open(myfile.txt):
... print(line)
... 
Traceback (most recent call last):
  File stdin, line 1, in module
IOError: [Errno 2] No such file or directory: 'myfile.txt'
 



This is one html page of errors not just one section. You may also want to 
check the python 3.3 docs for these errors.

--
status: closed - open

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



[issue16607] Bad examples in documentation

2012-12-12 Thread John Hampton

John Hampton added the comment:

The documentation is correct.  The problem that you seem to be having are due 
to copy and pasting in the interpreter.

The source of you first error is that after you copy

 def scope_test():
... def do_local():
... spam = local spam
... def do_nonlocal():
... nonlocal spam
... spam = nonlocal spam
... def do_global():
... global spam
... spam = global spam
... 

into the interpreter, you press enter and the blank line tells the interpreter 
that you're done defining the class.  However, if you look at the docs, the 
following statements:

spam = test spam
do_local()
print(After local assignment:, spam)
do_nonlocal()
print(After nonlocal assignment:, spam)
do_global()
print(After global assignment:, spam)

are supposed to be part of the class.  A similar issue exists for the issues 
you're experiencing with the loops.  Except it's the opposite.  In this case:

 for element in [1, 2, 3]:
... print(element)
... for element in (1, 2, 3):
  File stdin, line 3
for element in (1, 2, 3):
  ^
SyntaxError: invalid syntax

the interpreter is expecting a blank line after the print statement to indicate 
that the loop is done.  Since the second loop starts on the lien after print, 
it thinks there is an indentation error.

--
nosy: +pacopablo

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



[issue6792] Distutils-based installer does not detect 64bit versions of Python

2012-12-12 Thread Roy Jacobson

Roy Jacobson added the comment:

This bug is a really annoying one, any chance it will be fixed in 2.7? It's 
really a matter when you want to deploy a program using distutils (my case), 
because you cannot really require your clients to edit the registry themselves 
:/

Is there any problem with just adding the x32 compatibility path entry to the 
python x64 .msi? It's a very easy fix that shouldn't cause any harm.

--
nosy: +Roy.Jacobson

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



[issue16671] logging.handlers.QueueListener sentinel should not be None

2012-12-12 Thread Antoine Pitrou

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


--
nosy: +vinay.sajip

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



[issue16672] improve tracing performances when f_trace is NULL

2012-12-12 Thread Xavier de Gaye

New submission from Xavier de Gaye:

When f_trace is NULL, only PyTrace_CALL tracing events trigger the invocation of
the trace function (see trace_trampoline).
maybe_call_line_trace() does quite some work though _PyCode_CheckLineNumber to
find out if the instruction should be traced, and all this work is useless when 
f_trace
is NULL. The patch checks for f_trace on all tracing events that are not
PyTrace_CALL.

The performance gain with the following test is about 30%. The first test is
with python on the default branch, the second one with the patch applied.
Note: a breakpoint is set at line 1 to ensure that tracing is enabled, without
any breakpoint, pdb sets the trace function to None after a continue.

$ ./python -m pdb /tmp/foo.py
 /tmp/foo.py(1)module()
- import timeit
(Pdb) break 1
Breakpoint 1 at /tmp/foo.py:1
(Pdb) continue
9.22638593106
The program finished and will be restarted
 /tmp/foo.py(1)module()
- import timeit
(Pdb) q
[62276 refs]


$ ./python -m pdb /tmp/foo.py 
 /tmp/foo.py(1)module()
- import timeit
(Pdb) break 1
Breakpoint 1 at /tmp/foo.py:1
(Pdb) continue
7.199809867001022
The program finished and will be restarted
 /tmp/foo.py(1)module()
- import timeit
(Pdb)

--
components: Interpreter Core
files: f_trace_perfs.diff
keywords: patch
messages: 177390
nosy: xdegaye
priority: normal
severity: normal
status: open
title: improve tracing performances when f_trace is NULL
type: enhancement
versions: Python 3.4
Added file: http://bugs.python.org/file28297/f_trace_perfs.diff

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



[issue16672] improve tracing performances when f_trace is NULL

2012-12-12 Thread Xavier de Gaye

Changes by Xavier de Gaye xdeg...@gmail.com:


Added file: http://bugs.python.org/file28298/foo.py

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



[issue16672] improve tracing performances when f_trace is NULL

2012-12-12 Thread Xavier de Gaye

Changes by Xavier de Gaye xdeg...@gmail.com:


Added file: http://bugs.python.org/file28299/bar.py

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



[issue16672] improve tracing performances when f_trace is NULL

2012-12-12 Thread Xavier de Gaye

Xavier de Gaye added the comment:

 When f_trace is NULL, only PyTrace_CALL tracing events trigger the invocation
 of the trace function (see trace_trampoline).

This may be confusing. I meant that when f_trace is NULL, PyTrace_LINE,
PyTrace_RETURN and PyTrace_EXCEPTION are not traced.

--

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



[issue16660] Segmentation fault when importing hashlib

2012-12-12 Thread ashwani

ashwani added the comment:

Ok , It did not crash when I recompiled with --with-pydebug.
I observed crash when I was working with the urllib.request.
It  was crashing when I  imported urllib.request. I drill down the code of 
urllib.request and found that it was crashing because of hashlib import.
Now, it is not crashing when I import hashlib and urllib.request.
But urllib.request.urlopen fails to open a site. It does open few other sites.
Now this might be completely different issue.

I think we first need to find why it is not crashing after the recompilation.

Following is comparison of urlopen on the same machine using two different 
python versions.


ir[40] [~/Python-3.3.0/]$ python3
Python 3.3.0 (default, Dec 12 2012, 17:26:56) 
[GCC 4.4.6 20110731 (Red Hat 4.4.6-3)] on linux
Type help, copyright, credits or license for more information.
 import hashlib
[71516 refs]
 import urllib
[71550 refs]
 import urllib.request
[123410 refs]
 u = urllib.request.urlopen('http://en.wikipedia.org/wiki/Wikipedia')
]Traceback (most recent call last):
  File stdin, line 1, in module
  File /usa/arao/Python-3.3.0/lib/python3.3/urllib/request.py, line 160, in 
urlopen
return opener.open(url, data, timeout)
  File /usa/arao/Python-3.3.0/lib/python3.3/urllib/request.py, line 479, in 
open
response = meth(req, response)
  File /usa/arao/Python-3.3.0/lib/python3.3/urllib/request.py, line 591, in 
http_response
'http', request, response, code, msg, hdrs)
  File /usa/arao/Python-3.3.0/lib/python3.3/urllib/request.py, line 517, in 
error
return self._call_chain(*args)
  File /usa/arao/Python-3.3.0/lib/python3.3/urllib/request.py, line 451, in 
_call_chain
result = func(*args)
  File /usa/arao/Python-3.3.0/lib/python3.3/urllib/request.py, line 599, in 
http_error_default
raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 403: Forbidden
[126943 refs]
 u = urllib.request.urlopen('http://mit.edu/')
[127082 refs]
 len(u.read())
13857
[127068 refs]

It does open some other sites.


r[37] [~/Python-3.3.0/]$ python
Python 2.6.6 (r266:84292, Dec  7 2011, 20:48:22) 
[GCC 4.4.6 20110731 (Red Hat 4.4.6-3)] on linux2
Type help, copyright, credits or license for more information.
 import urllib
 u = urllib.urlopen('http://en.wikipedia.org/wiki/Wikipedia')
 len(u.read())
3000
 import hashlib
 


Thanks,
Ashwin

--

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



[issue16669] Docstrings for namedtuple

2012-12-12 Thread Raymond Hettinger

Raymond Hettinger added the comment:

I don't think it is worth complicating the API for this.  There have been zero 
requests for this functionality.  Even the doc field of property() is rarely 
used.

--
assignee:  - rhettinger
priority: normal - low

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



[issue16670] [docs] class Point in collections.namedtuples may be not that good example

2012-12-12 Thread Raymond Hettinger

Raymond Hettinger added the comment:

I like the current example.  It does a great job teaching people how 
namedtuples work.  Also, I think you've drawn the wrong conclusions from Jack's 
talk.

--
assignee: docs@python - rhettinger
nosy: +jackdied, rhettinger
priority: normal - low

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



[issue16671] logging.handlers.QueueListener sentinel should not be None

2012-12-12 Thread Vinay Sajip

Vinay Sajip added the comment:

Why do you think None is a valid value to send for normal operation? Since the 
queue is only meant for sending logging events (records), it seems reasonable 
to send None as a sentinel - it should never be seen during operation.

The QueueListener is *supposed* to stop if it sees a None, so don't send those 
over the queue - just send logging events - until you want to shut the listener 
down.

You can of course set the sentinel to whatever you want, in your own code, and 
then send that. The default value of None seems OK to me.

So I don't believe this is a valid issue - marking as such and as pending, and 
I will close this shortly unless you come back with some more information.

--
assignee:  - vinay.sajip
resolution:  - invalid
status: open - pending
versions:  -Python 3.1

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



[issue16326] distutils build_ext fails to set library_dirs in 2.7.2 on Linux

2012-12-12 Thread Vinay Sajip

Vinay Sajip added the comment:

In terms of the venv code, I don't see how doing the test in that way would 
cause problems - as long as the value of sys.executable doesn't change, then as 
I see it, the venv code should operate as it's meant to.

--

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



[issue16660] Segmentation fault when importing hashlib

2012-12-12 Thread Gregory P. Smith

Gregory P. Smith added the comment:

given the behavior you are seeing, I'm not inclined to trust your computer or 
however it is configured.  I do not believe this is a Python issue.

3.3 works fine on RHEL 6 so it should work fine on CentOS 6.  
http://buildbot.python.org/all/builders/x86%20RHEL%206%203.3

next steps as far as debugging the crash goes still stand: run python under gdb 
and get the C stacktrace from the crash.

--
resolution:  - invalid
status: open - closed

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



[issue13590] extension module builds fail with python.org OS X installers on OS X 10.7 and 10.6 with Xcode 4.2

2012-12-12 Thread Ned Deily

Ned Deily added the comment:

 Ned: do you have time to backport this to 3.2 and 2.7?

Yes, I'll be taking care of it shortly.

 Also, the code might not be entirely correct for all machines: on my
 machine 'gcc-4.2' still exists in /usr/bin but doesn't work because the
 actual compiler (/usr/bin/i686-apple-darwin11-gcc-4.2.1) is no longer
 present. This is with Xcode 4.5.2.

AFAIK, the file /usr/bin/gcc-4.2 is not installed with any version of Xcode 4, 
only Xcode 3.x.  It should have been removed by the command line tools 
uninstaller that used to be provided in Xcode, prior to the consolidation under 
Xcode.app in Xcode 4.2(?):

   sudo /Developer/Library/uninstall-devtools --mode=unixdev

Presumably that functionality should now exist in Xcode.app itself.  FWIW, I've 
not seen /usr/bin/gcc-4.2 left behind with any Xcode 4 installation I've done.

--

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