[issue16278] os.rename documentation slightly inaccurate

2012-10-30 Thread Todd Rovito

Todd Rovito added the comment:

False alarm my test case was buggy.

--

___
Python tracker 

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



[issue16278] os.rename documentation slightly inaccurate

2012-10-30 Thread Todd Rovito

Changes by Todd Rovito :


Removed file: http://bugs.python.org/file27804/OSRename_test_os.patch

___
Python tracker 

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



[issue16261] Fix bare excepts in various places in std lib

2012-10-30 Thread Ramchandra Apte

Ramchandra Apte added the comment:

This seems quite difficult for one person;there are 589 lines having "except:"
I'll work on the Tools directory.
If anybody wants to help, please tell which folder you will do.

--

___
Python tracker 

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



[issue16362] _LegalCharsPatt in cookies.py includes illegal characters

2012-10-30 Thread Graham Dumpleton

Graham Dumpleton added the comment:

For that cookie string to be valid in the first place, shouldn't it have been 
sent as:

'HTTP_COOKIE': 'yaean_djsession=23ab7bf8b260cbb2f2bc80b1c1fd98fa; 
yaean_yasession=ff2a3030ee3f428f91c6f554a63b459c'

IOW, semicolon as separator.

What client generated that HTTP Cookie header with commas in it?

Only way I could see you ending up with that, if client isn't broken, is if 
when sent by application originally it sent it as only one Set-Cookie response 
header and had tried to set both values at same time with comma as separator. 
Then when it has come back from client like that to application, the cookie 
parser has then done the wrong thing on it.

If this is a browser client, check the browser cookie cache to see what it is 
stored as in there.

--
nosy: +grahamd

___
Python tracker 

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



[issue16362] _LegalCharsPatt in cookies.py includes illegal characters

2012-10-30 Thread Simon Blanchard

Simon Blanchard added the comment:

I have a real world example. Using Apache, mod_wsgi and Django. Given this in 
the META dict:

 'HTTP_COOKIE': 'yaean_djsession=23ab7bf8b260cbb2f2bc80b1c1fd98fa, 
yaean_yasession=ff2a3030ee3f428f91c6f554a63b459c',

Django via the Python cookie api gives this:

COOKIES:{'yaean_djsession': '23ab7bf8b260cbb2f2bc80b1c1fd98fa,',
 'yaean_yasession': 'ff2a3030ee3f428f91c6f554a63b459c'},

Note the comma on the end of the cookie named yaean_djsession in COOKIES. It 
should not be there. In this case session lookup fails.

--

___
Python tracker 

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



[issue16271] weird dual behavior with changing __qualname__; different values observed through attribute and descriptor

2012-10-30 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 1d700e1aff33 by Benjamin Peterson in branch '3.3':
don't shadow the __qualname__ descriptor with __qualname__ in the class's 
__dict__ (closes #16271)
http://hg.python.org/cpython/rev/1d700e1aff33

--
nosy: +python-dev
resolution:  -> fixed
stage:  -> committed/rejected
status: open -> closed

___
Python tracker 

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



[issue13659] Add a help() viewer for IDLE's Shell.

2012-10-30 Thread Ramchandra Apte

Ramchandra Apte added the comment:

Bump.

--

___
Python tracker 

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



[issue16278] os.rename documentation slightly inaccurate

2012-10-30 Thread Todd Rovito

Todd Rovito added the comment:

While writing test cases I discovered another conflict with the documentation.  
The phrase "On Unix, if dst exists and is a file, it will be replaced silently 
if the user has permission and src is a file." is not correct.  According to 
the test cases I wrote in the attached patch see the method 
test_rename_src_file_dest_file_exists in the class FileTests the destination 
file is not replaced and the source file actually is removed.  I will seek 
advice from Python Core Mentorship to see if this is a bug or normal behavior. 

First time writing test cases so I hope I am on the right track.

--
Added file: http://bugs.python.org/file27804/OSRename_test_os.patch

___
Python tracker 

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



[issue16268] dir(closure) does not find __dir__

2012-10-30 Thread Benjamin Peterson

Changes by Benjamin Peterson :


--
resolution:  -> duplicate
status: open -> closed
superseder:  -> Global PyTypeObjects not initialized with PyType_Ready(...)

___
Python tracker 

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



[issue16369] Global PyTypeObjects not initialized with PyType_Ready(...)

2012-10-30 Thread Roundup Robot

Roundup Robot added the comment:

New changeset eec0cafe171d by Benjamin Peterson in branch '3.2':
initialize more global type objects (closes #16369)
http://hg.python.org/cpython/rev/eec0cafe171d

New changeset 9371bf2287c4 by Benjamin Peterson in branch '3.3':
merge 3.2 (#16369)
http://hg.python.org/cpython/rev/9371bf2287c4

New changeset aa52d8559ce5 by Benjamin Peterson in branch 'default':
merge 3.3 (#16369)
http://hg.python.org/cpython/rev/aa52d8559ce5

New changeset 315bd0ceb97a by Benjamin Peterson in branch '2.7':
initialize more global type objects (closes #16369)
http://hg.python.org/cpython/rev/315bd0ceb97a

--
nosy: +python-dev
resolution:  -> fixed
stage:  -> committed/rejected
status: open -> closed

___
Python tracker 

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



[issue16344] Traceback Internationalization Proposal

2012-10-30 Thread Ramchandra Apte

Ramchandra Apte added the comment:

I said
>> Schools put a priority on English but not on native languages. Languages 
>> must be preserved because they contain culture
Charles-François Natali said
> Of course, but the main goal of a language is to communicate.

> As it stand, English is the language which is the most likely to be 
> understood by Python users and developers (I don't count Esperanto ;-).

>It'll get tricky if in a couple months, we start getting bug reports with 
>traceback in Finnish or French...
I was saying in general.

--

___
Python tracker 

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



[issue16369] Global PyTypeObjects not initialized with PyType_Ready(...)

2012-10-30 Thread Bradley Froehle

New submission from Bradley Froehle:

In Python 3.3.0, several global `PyTypeObject`s are not initialized using 
PyType_Ready(...).

The list of uninitialized type objects::

  PyCapsule_Type
  PyLongRangeIter_Type
  PyFieldNameIter_Type
  PyFormatterIter_Type
  PySTEntry_Type
  PyCell_Type
  PyInstanceMethod_Type
  PyClassMethodDescr_Type
  PyMethodDescr_Type
  PyCallIter_Type
  PySeqIter_Type
  PyDictDummy_Type

Each of these can be verified using gdb::

  $ gdb -quiet python3.3
  Reading symbols from /opt/python/3.3.0/bin/python3.3...done.
  (gdb) break Py_Finalize
  Breakpoint 1 at 0x4a40a0: file Python/pythonrun.c, line 478.
  (gdb) run -c "pass"
  Starting program: /opt/python/3.3.0/bin/python3.3 -c "pass"
  [Thread debugging using libthread_db enabled]
  Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".

  Breakpoint 1, Py_Finalize () at Python/pythonrun.c:478
  478   if (!initialized)
  (gdb) print PyCell_Type->tp_mro
  $1 = (PyObject *) 0x0

(The list of uninitialized types was built by searching "info variables" in gdb 
to produce a list of PyTypeObjects. Those with ->tp_mro != NULL were 
treated as properly initialized. The remainder were further inspected by hand 
to throw out additional false positives, like those from modules which had been 
statically compiled into the Python binary).

I'm not sure if any of these actually need fixing, but for PyCell_Type this 
issue already resulted in one obscure bug: #16268.

--
components: Interpreter Core
messages: 174255
nosy: bfroehle
priority: normal
severity: normal
status: open
title: Global PyTypeObjects not initialized with PyType_Ready(...)
type: behavior
versions: Python 3.3

___
Python tracker 

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



[issue16268] dir(closure) does not find __dir__

2012-10-30 Thread Bradley Froehle

Bradley Froehle added the comment:

Your patch looks good to me, and I can verify that it properly tests for the 
issue in Python 3.3.

On a related note, I've found that PyType_Ready(...) isn't called for a few 
other core PyTypeObjects... see #16369.

--

___
Python tracker 

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



[issue16368] error when logging message

2012-10-30 Thread R. David Murray

R. David Murray added the comment:

Yep, that would do it.  format is supposed to be a format string.

--
status: open -> closed

___
Python tracker 

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



[issue16368] error when logging message

2012-10-30 Thread Tom Kuiper

Tom Kuiper added the comment:

On 10/30/2012 05:29 PM, R. David Murray wrote:
> R. David Murray added the comment:
>
> Do none of those submodules import logging?
>
> It is unlikely that this is a Python bug.  Somewhere _fmt is getting set to 
> an integer.  The way to prove this one way or another is to start deleting 
> things until you find the code that is triggering the issue.
>
After tortuous digging I found a subsubmodule that does this:

import logging
logging_options = [logging.DEBUG,
logging.INFO,
logging.WARNING,
logging.ERROR,
logging.CRITICAL]
logging_level = logging_options[2]
logging.basicConfig(format=logging_level)

Commenting out that last line fixed the problem.  I've now cleared out 
all the code shown here. Thanks for the tip.

Tom
> --
> nosy: +r.david.murray
> resolution:  ->  invalid
> stage:  ->  committed/rejected
> status: open ->  pending
>
> ___
> Python tracker
> 
> ___
>

--

___
Python tracker 

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



[issue16368] error when logging message

2012-10-30 Thread Tom Kuiper

Tom Kuiper added the comment:

Give me a few moments to dig further.  I may have found the submodule 
culprit.  Checking.

Tom

On 10/30/2012 05:29 PM, R. David Murray wrote:
> R. David Murray added the comment:
>
> Do none of those submodules import logging?
>
> It is unlikely that this is a Python bug.  Somewhere _fmt is getting set to 
> an integer.  The way to prove this one way or another is to start deleting 
> things until you find the code that is triggering the issue.
>
> --
> nosy: +r.david.murray
> resolution:  ->  invalid
> stage:  ->  committed/rejected
> status: open ->  pending
>
> ___
> Python tracker
> 
> ___
>

--
status: pending -> open

___
Python tracker 

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



[issue16368] error when logging message

2012-10-30 Thread R. David Murray

R. David Murray added the comment:

Do none of those submodules import logging?

It is unlikely that this is a Python bug.  Somewhere _fmt is getting set to an 
integer.  The way to prove this one way or another is to start deleting things 
until you find the code that is triggering the issue.

--
nosy: +r.david.murray
resolution:  -> invalid
stage:  -> committed/rejected
status: open -> pending

___
Python tracker 

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



[issue12890] cgitb displays tags when executed in text mode

2012-10-30 Thread R. David Murray

R. David Murray added the comment:

Thanks everyone.

--
stage: patch review -> committed/rejected
status: open -> closed

___
Python tracker 

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



[issue12890] cgitb displays tags when executed in text mode

2012-10-30 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 7648b7ed6d91 by R David Murray in branch '3.3':
#12890: fix test on windows
http://hg.python.org/cpython/rev/7648b7ed6d91

New changeset d24befb680d6 by R David Murray in branch 'default':
#12890: fix test on windows
http://hg.python.org/cpython/rev/d24befb680d6

--

___
Python tracker 

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



[issue15478] UnicodeDecodeError on OSError on Windows with undecodable (bytes) filename

2012-10-30 Thread Roundup Robot

Roundup Robot added the comment:

New changeset ef87bd0797de by Victor Stinner in branch 'default':
Issue #15478: Fix test_os on FreeBSD
http://hg.python.org/cpython/rev/ef87bd0797de

--

___
Python tracker 

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



[issue16368] error when logging message

2012-10-30 Thread Tom Kuiper

New submission from Tom Kuiper:

This error comes from the logging module when a message is logged, but only 
when I also import another module which does use logging at all:

Traceback (most recent call last):
  File "/usr/lib/python2.6/logging/__init__.py", line 776, in emit
msg = self.format(record)
  File "/usr/lib/python2.6/logging/__init__.py", line 654, in format
return fmt.format(record)
  File "/usr/lib/python2.6/logging/__init__.py", line 437, in format
if string.find(self._fmt,"%(asctime)") >= 0:
  File "/usr/lib/python2.6/string.py", line 361, in find
return s.find(*args)
AttributeError: 'int' object has no attribute 'find'

The module source is attached.  Some of it's submodules were built with f2py.

--
components: Library (Lib)
files: __init__.py
messages: 174247
nosy: kuiper
priority: normal
severity: normal
status: open
title: error when logging message
type: behavior
versions: Python 2.6
Added file: http://bugs.python.org/file27803/__init__.py

___
Python tracker 

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



[issue9566] Compilation warnings under x64 Windows

2012-10-30 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 96fc87997ce9 by Victor Stinner in branch 'default':
Issue #9566: Explicit downcast to fix compiler warnings on Win64
http://hg.python.org/cpython/rev/96fc87997ce9

New changeset dabe2486e2ce by Victor Stinner in branch 'default':
Issue #9566: Use the right type to fix a compiler warnings on Win64
http://hg.python.org/cpython/rev/dabe2486e2ce

--

___
Python tracker 

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



[issue15478] UnicodeDecodeError on OSError on Windows with undecodable (bytes) filename

2012-10-30 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 01cc9fb52887 by Victor Stinner in branch 'default':
Issue #15478: Fix test_os on Windows (os.chown is missing)
http://hg.python.org/cpython/rev/01cc9fb52887

--

___
Python tracker 

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



[issue16367] io.FileIO.readall() is not 64-bit safe on Windows

2012-10-30 Thread STINNER Victor

New submission from STINNER Victor:

The changeset 374dc910db33 fixed FileIO.readinto(), FileIO.write() and 
os.write() on Windows for issues #9015, #9611, but FileIO.readall() was not 
fixed and it has a similar bug.

It uses "int n;" to store the result of read(), so FileIO.readall() may also 
fail to read a file longer than 2 GB on other platforms.

Attached patch should fix both issues.

--
components: Library (Lib)
files: fileio_readall.patch
keywords: patch
messages: 174244
nosy: haypo, pitrou
priority: normal
severity: normal
status: open
title: io.FileIO.readall() is not 64-bit safe on Windows
versions: Python 2.7, Python 3.2, Python 3.3, Python 3.4
Added file: http://bugs.python.org/file27802/fileio_readall.patch

___
Python tracker 

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



[issue16344] Traceback Internationalization Proposal

2012-10-30 Thread Mariano Reingart

Mariano Reingart added the comment:

Sorry for taking so long to replying, and for this long follow up...

> Antoine Pitrou added the comment:

> I think the PEP should be proposed on python-dev or python-ideas.
> Also, it's probably better if the PEP is encoded in utf-8, not 
> latin-1.

Ok, I'll update, polish, encode in utf-8 and send to python-dev
It was already discussed in Python-ideas (maybe not in particular/detail), but 
it seems that no one have more to add there, or they are bussy with the Async 
API :-).


> Terry J. Reedy added the comment:

> I am sympathetic with non-English speakers wanting a native-language
> translation. 

Sympathetic is a kind of compassion?
It may be a correct meaning here. 
Just read that almost every of you complain arguing that you'll hesitate 
because you can/could receive a message in a foreign language that could not 
understand.
Well, that's is what is already happening to non-English speakers of the python 
language IMHO. 
And it is not just frustrating, sometimes it is also a wasting of time because 
of the distractions and delays it produces.

> But I think the interpreter should *always* emit the standard message
> and that any translation should be an addition, not a replacement.
> This would maintain discoverablity and help people learn the English
> version, not hinder it.

I'll explore the alternatives to show both messages (original and translated), 
but I think that would be more confusing.
I do not think that it hinders the meaning, it just translates it, and I didn't 
see any other language / tool that puts both messages, but I'll investigate 
more (maybe the  exception name -that is untranslated-  plus an error code like 
in PostgreSQL would be more helpful to discoverablity)

Learning English by showing both messages may be a interesting experiment, but, 
for me, it's like traditional education focus on "memorizing" things instead of 
understanding them, and depending on the context, it can be lead to good 
results or misleading repetition.

> The real question to me is how deep in the interpreter such support
> should go. Third party shells can (and sometimes do) intercept
> tracebacks and reformat (and translate) as they wish. But there would
> be advantages and disadvanteges is adding the translation sooner.

About except hook approach, it doesn't work very reliable because you don't 
have the original unformatted message, so you have to interpolate the results 
to find the correct translation. 
Beside that it will be slower and it could be error prone, the main problem is 
not technical, but "social", as it could lead to translation effort 
duplication, segregation and proliferation of custom tools, with the 
aggravation that in some scenarios except hook is not honoured:

http://bugs.python.org/issue12643 (just an example)

You can take a look at one of my attempt trying to translate using 
interpolation (my algorithm is some kind of brute force "guessing" using 
regular expressions just to test the idea):

http://code.google.com/p/pydiversity/source/browse/__diversity__/__init__.py

I think that approach "left in the wild" (and/or "do it yourself") is not only 
more complex, also it could be more dangerous that having a unified translation 
resources, where all messages all listed, a common infrastructure is used and 
general rules are agreed.


> Ezio Melotti added the comment:

> There are two solutions to this problem:
> 1) adapt the language to the users;
> 2) teach the users English;
>
> While the first (i.e. what you are proposing) works as a short term 
> solution, I believe the second is a much better long term solution, 
> because IMHO users will anyway have to learn English sooner or later.

Teach the users English may be an altruist goal in the long term, but for many 
teachers (like my case) it a barrier right now that can tip the balance to 
other "more friendly languages"

Anyway, and don't get me wrong, but, force novice users to learn a second 
language, aside it is likely impractical, it may sound at least rude, 
ethnocentric or as a neocolonialism in some contexts (if we want to go 
further...). 
Education takes a lot of resources, I don't think it would happen just showing 
some English messages (BTW, English may be one of the most difficult languages 
to learn as a second tongue, depending on the part of the world you live... at 
least in my country you only can archive an acceptable skill before 6 to 9 
years, depending your age and other socio-economical factors)

IMHO, it would be more encouraging a message like "we can help you in your 
first programming steps with python localized for your language, but please 
consider to learn English to better communicate in the international community"

> I've seen buildbots reporting unintelligible error messages in 
> German, and just a few days ago I even came across a mercurial 
> version in Russian.

Well, I think this only reinforces my point.
Ignoring that many people out t

[issue16086] tp_flags: Undefined behaviour with 32 bits long

2012-10-30 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

See also issue9307.

--

___
Python tracker 

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



[issue16086] tp_flags: Undefined behaviour with 32 bits long

2012-10-30 Thread STINNER Victor

STINNER Victor added the comment:

> Note that Py_TPFLAGS_INT_SUBCLASS already not used in Python 3.x. One bit of 
> tp_flags can be freed.

Please open a new issue if you consider this issue important enough.

--

___
Python tracker 

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



[issue16086] tp_flags: Undefined behaviour with 32 bits long

2012-10-30 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Note that Py_TPFLAGS_INT_SUBCLASS already not used in Python 3.x. One bit of 
tp_flags can be freed.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue14625] Faster utf-32 decoder

2012-10-30 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

> I applied the patch "A" with minor changes: replace multiple goto with
> classic break/continue and if/else.

Looks good. Thanks.

--

___
Python tracker 

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



[issue16311] Use _PyUnicodeWriter API in text decoders

2012-10-30 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I will do some experiments and review tomorrow.

--

___
Python tracker 

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



[issue16086] tp_flags: Undefined behaviour with 32 bits long

2012-10-30 Thread STINNER Victor

Changes by STINNER Victor :


--
resolution:  -> fixed
status: open -> closed

___
Python tracker 

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



[issue16268] dir(closure) does not find __dir__

2012-10-30 Thread Amaury Forgeot d'Arc

Changes by Amaury Forgeot d'Arc :


--
stage:  -> patch review

___
Python tracker 

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



[issue16268] dir(closure) does not find __dir__

2012-10-30 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc added the comment:

The same fix, but with a unit test.
Note that object.__dir__ did not exist in previous versions, but I found a 
similar failure with __format__, which also applies to 2.7.

--
nosy: +amaury.forgeotdarc
Added file: http://bugs.python.org/file27801/init_cell_type-2.patch

___
Python tracker 

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



[issue16351] Add a function to get GC statistics

2012-10-30 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

> Because it's much simpler like that.

Well, I wrote a patch with structure sequences, it is really much more 
expansive.

I have some comments.

1. You can allocate list of NUM_GENERATIONS elements and then use 
PyList_SET_ITEM(result, i, stat). This is 4 lines shorter.

2. And may be return the tuple? get_count() and get_threshold() return tuples.

3. You forgot to add get_stats() to the module docstring.

--

___
Python tracker 

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



[issue16086] tp_flags: Undefined behaviour with 32 bits long

2012-10-30 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 10795aac6df7 by Victor Stinner in branch 'default':
Issue #16086: PyTypeObject.tp_flags and PyType_Spec.flags are now unsigned
http://hg.python.org/cpython/rev/10795aac6df7

--
nosy: +python-dev

___
Python tracker 

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



[issue16344] Traceback Internationalization Proposal

2012-10-30 Thread R. David Murray

Changes by R. David Murray :


--
nosy: +r.david.murray

___
Python tracker 

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



[issue14625] Faster utf-32 decoder

2012-10-30 Thread STINNER Victor

STINNER Victor added the comment:

I applied the patch "A" with minor changes: replace multiple goto with classic 
break/continue and if/else.

--

___
Python tracker 

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



[issue14625] Faster utf-32 decoder

2012-10-30 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 9badfe3a31a7 by Victor Stinner in branch 'default':
Close #14625: Rewrite the UTF-32 decoder. It is now 3x to 4x faster
http://hg.python.org/cpython/rev/9badfe3a31a7

--
nosy: +python-dev
resolution:  -> fixed
stage: patch review -> committed/rejected
status: open -> closed

___
Python tracker 

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



[issue16344] Traceback Internationalization Proposal

2012-10-30 Thread Antoine Pitrou

Antoine Pitrou added the comment:

> You anyway have to know English to understand the docs and Python's
> grammar is English.

I don't think Python's grammar is relevant. I took my first steps in 
programming when I was around 10 and I barely knew English at the time, it 
didn't stop me from mastering "FOR i = 1 TO N ;... NEXT i" :-)

--

___
Python tracker 

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



[issue16351] Add a function to get GC statistics

2012-10-30 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Now committed.

--
resolution:  -> fixed
stage: patch review -> committed/rejected
status: open -> closed

___
Python tracker 

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



[issue16351] Add a function to get GC statistics

2012-10-30 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 43d87cdf9457 by Antoine Pitrou in branch 'default':
Issue #16351: New function gc.get_stats() returns per-generation collection 
statistics.
http://hg.python.org/cpython/rev/43d87cdf9457

--
nosy: +python-dev

___
Python tracker 

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



[issue16365] IDLE for Windows 8

2012-10-30 Thread Abhijeet Joshi

Abhijeet Joshi added the comment:

will leave it open so that some win8 developer will check it out.

--

___
Python tracker 

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



[issue16365] IDLE for Windows 8

2012-10-30 Thread Roger Serwy

Roger Serwy added the comment:

I wonder if there is a bug in the Python installer on the new Windows 8 
platform, though it is unlikely. 

I will leave this issue open for Windows 8 developers to comment. (I don't have 
Win8 for testing just yet.) Feel free to close.

--
components: +Installation, Windows
nosy: +brian.curtin, tim.golden

___
Python tracker 

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



[issue15721] PEP 3121, 384 Refactoring applied to tkinter module

2012-10-30 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 4eb6e07e8171 by Andrew Svetlov in branch 'default':
Issue #15721: apply PEP 384 Refactoring to tkinter module.
http://hg.python.org/cpython/rev/4eb6e07e8171

--

___
Python tracker 

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



[issue15721] PEP 3121, 384 Refactoring applied to tkinter module

2012-10-30 Thread Andrew Svetlov

Andrew Svetlov added the comment:

Amaury, you are right: 
PyTclObject_Type_slots[3].pfunc = PyObject_GenericGetAttr;
is not required.

--

___
Python tracker 

___
___
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-10-30 Thread Andy Salnikov

Andy Salnikov added the comment:

Hi Éric,

I am attaching a patch that fixes the problem. The patch is tiny, basically 
1-line. This replaces the direct use of sys.executable with the 
symlink-resolved version of the same path. I made the change for linux/unix 
platforms and also for cygwin/atheos (I'm sure cygwin has symlinks, not sure if 
atheos does but resolving symlinks can't hurt in general). 

The patch was created from default hg branch (3.4.0a0 I guess), I have built it 
and tested in my simple setup. The problem that we have (in 2.7) is indeed 
reproducible without this patch and it is fixed with this patch applied. 

Concerning the unit test - I'm not sure how to write one but if you have 
suggestions I could try. The complications in this case are that python needs 
to be installed in its configured location and the symlink needs to be created 
outside python install directory which points to the installed interpreter. If 
unit test could handle this then it might be possible.

I did not update any documentation, could not find any place to mention this 
change. Sure you will know better what else is needed to be updated. I'd be 
happy to help you with whatever else is necessary to commit this patch.

Cheers,
Andy

--
keywords: +patch
Added file: http://bugs.python.org/file27800/distutils-sysexecutable.patch

___
Python tracker 

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



[issue16365] IDLE for Windows 8

2012-10-30 Thread Abhijeet Joshi

Abhijeet Joshi added the comment:

Thanks for your reply.

I have tried re-installing it 3-4 times and it started working now.

--

___
Python tracker 

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



[issue16365] IDLE for Windows 8

2012-10-30 Thread Roger Serwy

Roger Serwy added the comment:

Can you launch Python from a command line and then launch IDLE from there?

cd c:\python33
python

After python starts, enter the following:

import idlelib.idle

--
nosy: +serwy

___
Python tracker 

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



[issue14965] super() and property inheritance behavior

2012-10-30 Thread Ronny Pfannschmidt

Changes by Ronny Pfannschmidt :


--
nosy: +Ronny.Pfannschmidt

___
Python tracker 

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



[issue1553375] Add traceback.print_full_exception()

2012-10-30 Thread Andrew Svetlov

Changes by Andrew Svetlov :


--
nosy: +asvetlov

___
Python tracker 

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



[issue16366] _handleError not very informative

2012-10-30 Thread Antoine Pitrou

New submission from Antoine Pitrou:

logging's _handleError will tell you in which code line the error happened, but 
it's not very useful when application code has its own logging wrappers. You 
need more of the stack to get useful information. The attached script showcases 
this, along with a possible solution.

--
components: Library (Lib)
files: log.py
messages: 174222
nosy: pitrou, vinay.sajip
priority: normal
severity: normal
status: open
title: _handleError not very informative
type: enhancement
versions: Python 3.4
Added file: http://bugs.python.org/file27799/log.py

___
Python tracker 

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



[issue16341] In examples, "except:" should use new syntax

2012-10-30 Thread Andrew Svetlov

Changes by Andrew Svetlov :


--
resolution:  -> fixed
stage: patch review -> committed/rejected
status: open -> closed

___
Python tracker 

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



[issue16341] In examples, "except:" should use new syntax

2012-10-30 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 4e9617d3c514 by Andrew Svetlov in branch '2.7':
Issue #16341: convert examples to use except ... as ... syntax.
http://hg.python.org/cpython/rev/4e9617d3c514

--
nosy: +python-dev

___
Python tracker 

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



[issue1553375] Add traceback.print_full_exception()

2012-10-30 Thread Antoine Pitrou

Antoine Pitrou added the comment:

I recently re-wrote something like this, so I think this is useful.
I wonder if it wouldn't be nice to add a caret or some similar marker 
indicating the frame where the exception was caught, e.g.:


Traceback (most recent call last, catch point highlighted):
  File "testmod.py", line 13, in 
upper()
> File "testmod.py", line 11, in upper
foo()
  File "testmod.py", line 6, in foo
raise Exception
Exception

--
nosy: +pitrou
versions: +Python 3.4 -Python 3.3

___
Python tracker 

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



[issue16361] HTTPS/TLS Problem in Python 3.3

2012-10-30 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Note that you could work around the issue by forcing a lower SSL version:

ssl_context = ssl.SSLContext(ssl.PROTOCOL_SSLv3)
opener = urllib.request.build_opener(
urllib.request.HTTPCookieProcessor(cj), 
   
urllib.request.HTTPSHandler(context=ssl_context))
urllib.request.install_opener(opener)

(I would suggest doing this only for this particular HTTPS site, not globally, 
since using a lower SSL version may make the exchanges potentially less secure)

--

___
Python tracker 

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



[issue16197] Several small errors in winreg documentation

2012-10-30 Thread Zachary Ware

Zachary Ware added the comment:

Thanks for the commit! 3.2 looks good now.

3.3 and default still need a little work, though; the docstrings still say 
"WindowsError" instead of "OSError" and the docs say "a OSError" instead of "an 
OSError".

The attached patch cleans up both issues, as well as consolidating all the 
versionchanged notices about WindowsError == OSError.

--
resolution: fixed -> 
status: closed -> open
Added file: http://bugs.python.org/file27798/winreg_3.3+.patch

___
Python tracker 

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



[issue16365] IDLE for Windows 8

2012-10-30 Thread Abhijeet Joshi

New submission from Abhijeet Joshi:

Hello,

I have installed Idle for python 3.3 on windows 8 and trying to open the GUI 
but unable to open anything.
The screen doesn't show up on monitor.

Please help me here.

Thanks
Abhijeet

--
components: IDLE
messages: 174217
nosy: jabhijeet
priority: normal
severity: normal
status: open
title: IDLE for Windows 8
type: behavior
versions: Python 3.3

___
Python tracker 

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



[issue16361] HTTPS/TLS Problem in Python 3.3

2012-10-30 Thread Antoine Pitrou

Changes by Antoine Pitrou :


Added file: http://bugs.python.org/file27797/windows-tls12-handshake.txt

___
Python tracker 

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



[issue16361] HTTPS/TLS Problem in Python 3.3

2012-10-30 Thread Antoine Pitrou

Changes by Antoine Pitrou :


Added file: http://bugs.python.org/file27796/linux-tls10-handshake.txt

___
Python tracker 

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



[issue16361] HTTPS/TLS Problem in Python 3.3

2012-10-30 Thread Antoine Pitrou

Antoine Pitrou added the comment:

It looks like we use OpenSSL 1.0.1c for Python 3.3 Windows builds, which would 
explain the different Client Hello. In your capture, the client identifies 
itself as TLS 1.2, while on my Linux box it's TLS 1.0.

I'm uploading the decoded protocol tree of the two handshakes.

--

___
Python tracker 

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



[issue16344] Traceback Internationalization Proposal

2012-10-30 Thread Terry J. Reedy

Terry J. Reedy added the comment:

>It'll get tricky if in a couple months, we start getting bug reports with 
>traceback in Finnish or French...

That is another reason to *always* output the standard English message first. I 
think this was discussed a couple of years ago on PyDev, or maybe another 
issue. I think the proposal to *replace* English messages should be rejected.

--

___
Python tracker 

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



[issue16361] HTTPS/TLS Problem in Python 3.3

2012-10-30 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Your script works for me under Linux with Python 3.2, 3.3 and 3.4.
Perhaps the problem has to do with the version of OpenSSL that we package 
Windows binaries with? My OpenSSL version here (as given by 
ssl.OPENSSL_VERSION) is 'OpenSSL 1.0.0d 8 Feb 2011'.

--
components: +Windows
nosy: +loewis
versions: +Python 3.4

___
Python tracker 

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



[issue10966] eliminate use of ImportError implicitly representing SkipTest

2012-10-30 Thread Brett Cannon

Changes by Brett Cannon :


--
versions: +Python 3.4 -Python 3.3

___
Python tracker 

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



[issue10966] eliminate use of ImportError implicitly representing SkipTest

2012-10-30 Thread Brett Cannon

Changes by Brett Cannon :


--
assignee:  -> brett.cannon

___
Python tracker 

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



[issue16338] pysnmp/asyncore - timeout ineffective?

2012-10-30 Thread Charles-François Natali

Charles-François Natali added the comment:

It's a little too vague :-)

You should probably report this on pysnmp mailing list.
If you want to debug this, you should perform a tcpdump/wireshark capture while 
running your script, and see what happens (according to your description, it 
may simply be that the remote snmp agent takes too long to answer, maybe 
because of a loaded machine, crappy network, of NFS mounts timeouts on the 
target host).

--
nosy: +neologix

___
Python tracker 

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



[issue16344] Traceback Internationalization Proposal

2012-10-30 Thread Charles-François Natali

Charles-François Natali added the comment:

> Schools put a priority on English but not on native languages. Languages must 
> be preserved because they contain culture

Of course, but the main goal of a language is to communicate.

As it stand, English is the language which is the most likely to be understood 
by Python users and developers (I don't count Esperanto ;-).

It'll get tricky if in a couple months, we start getting bug reports with 
traceback in Finnish or French...

--
nosy: +neologix

___
Python tracker 

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



[issue16261] Fix bare excepts in various places in std lib

2012-10-30 Thread Ramchandra Apte

Changes by Ramchandra Apte :


--
type:  -> behavior

___
Python tracker 

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



[issue16363] super cannot invoke descriptors

2012-10-30 Thread R. David Murray

R. David Murray added the comment:

I believe this is a duplicate of issue 14965.  If you agree please add yourself 
to nosy there and review the proposed patch and/or make your own proposal.  If 
you think your issue is different you can reopen this one.

--
nosy: +r.david.murray
resolution:  -> duplicate
stage:  -> committed/rejected
status: open -> closed
superseder:  -> super() and property inheritance behavior

___
Python tracker 

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



[issue16362] _LegalCharsPatt in cookies.py includes illegal characters

2012-10-30 Thread R. David Murray

R. David Murray added the comment:

This is a pragmatic choice.  Try searching the tracker for 'cookie comma', and 
read about the lack of adherence to cookie RFCs by the major browsers.  
Specifically, I think issue 1210326 is relevant here, and am closing this as a 
duplicate of that issue.  If you disagree, I think we'll need examples from 
real-world browser/server situations where this is an incorrect choice in order 
to consider changing it.

You will note that the comment block before that equate mentions that it does 
not follow the RFCs for pragmatic reasons.

--
nosy: +r.david.murray
resolution:  -> duplicate
stage:  -> committed/rejected
status: open -> closed
superseder:  -> comma separated cookie values

___
Python tracker 

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



[issue16344] Traceback Internationalization Proposal

2012-10-30 Thread Ramchandra Apte

Ramchandra Apte added the comment:

Unless Python's grammar is translated into other languages I'm -1 on this.
I don't see any use of this. You anyway have to know English to understand the 
docs and Python's grammar is English.
@Ezio melotti
>> In some places (like my country, public schools), English is not
>> teach formally until the University.

> This is very unfortunate -- I was under the impression that teaching
> English in middle/high schools was already common in most of the
> countries.

English is actually oppressing other languages. Schools put a priority on 
English but not on native languages. Languages must be preserved because they 
contain culture (in one language, the future is behind because you can't see it 
and the past is in front of you.)

--
nosy: +ramchandra.apte

___
Python tracker 

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



[issue9351] argparse set_defaults on subcommands should override top level set_defaults

2012-10-30 Thread Petri Lehtinen

Petri Lehtinen added the comment:

LGTM. Steven?

--
stage: needs patch -> commit review

___
Python tracker 

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



[issue2005] posixmodule expects sizeof(pid_t/gid_t/uid_t) <= sizeof(long)

2012-10-30 Thread Petri Lehtinen

Petri Lehtinen added the comment:

Christian Heimes wrote:
> AFAIK C89 doesn't specify integer overflows:

Casting a signed integer to an unsigned integer is always defined, if
that's what you're talking about.

See http://flash-gordon.me.uk/ansi.c.txt, section 3.2.1.2.

If you're talking about PyLong_AsLongWithOverflow() and friends, they
do bitshift magic to detect overflows.

--

___
Python tracker 

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



[issue9351] argparse set_defaults on subcommands should override top level set_defaults

2012-10-30 Thread Jyrki Pulliainen

Changes by Jyrki Pulliainen :


Removed file: http://bugs.python.org/file27794/issue9351.patch

___
Python tracker 

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



[issue9351] argparse set_defaults on subcommands should override top level set_defaults

2012-10-30 Thread Jyrki Pulliainen

Changes by Jyrki Pulliainen :


Removed file: http://bugs.python.org/file27677/issue9351.patch

___
Python tracker 

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



[issue9351] argparse set_defaults on subcommands should override top level set_defaults

2012-10-30 Thread Jyrki Pulliainen

Changes by Jyrki Pulliainen :


Added file: http://bugs.python.org/file27794/issue9351.patch

___
Python tracker 

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



[issue9351] argparse set_defaults on subcommands should override top level set_defaults

2012-10-30 Thread Jyrki Pulliainen

Changes by Jyrki Pulliainen :


Added file: http://bugs.python.org/file27795/issue9351.patch

___
Python tracker 

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



[issue9351] argparse set_defaults on subcommands should override top level set_defaults

2012-10-30 Thread Jyrki Pulliainen

Changes by Jyrki Pulliainen :


Removed file: http://bugs.python.org/file27793/issue9351.patch

___
Python tracker 

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



[issue9351] argparse set_defaults on subcommands should override top level set_defaults

2012-10-30 Thread Jyrki Pulliainen

Jyrki Pulliainen added the comment:

Yeah, I tried figuring out something more clever, as this, in the current form, 
has a bit too hackish feeling in it, but I couldn't find a proper tool for the 
job.

Anyway, attached a patch with the getattr removed.

--
Added file: http://bugs.python.org/file27793/issue9351.patch

___
Python tracker 

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



[issue2005] posixmodule expects sizeof(pid_t/gid_t/uid_t) <= sizeof(long)

2012-10-30 Thread Christian Heimes

Christian Heimes added the comment:

AFAIK C89 doesn't specify integer overflows:

If an exceptional condition occurs during the evaluation of an expression (that 
is, if the result is not mathematically defined or not in the range of 
representable values for its type), the behavior is undefined.

With GCC and -fwrapv integer overflow work as you have expected. But other (and 
mostly older) compilers can fail.

--

___
Python tracker 

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



[issue16363] super cannot invoke descriptors

2012-10-30 Thread Berker Peksag

Changes by Berker Peksag :


--
versions:  -Python 3.1, Python 3.5

___
Python tracker 

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



[issue16364] datetime.strftime and locale.getdefaultlocale conflict on Windows ?

2012-10-30 Thread jamesf

jamesf added the comment:

i just found that locale.getlocale does return (None, None),
maybe defaultlocale just return the DEFAULT, which is the hints.

i will use locale.setlocale in my app, so close this issue.

--
status: open -> closed

___
Python tracker 

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



[issue16364] datetime.strftime and locale.getdefaultlocale conflict on Windows ?

2012-10-30 Thread jamesf

New submission from jamesf:

on windows(windows 7), python 2.7.3 compiled with VS 2008 and code page "cp936".

locale.getdefaultlocale call Win32 API GetACP and return "cp936",
but a small test program return "C" from 'getlocale' CRT function.
I am not sure if this behaviour is expected or bug?

It seems that datetime.strftime call the CRT function strftime to
do the real work, since the CRT locale is C, it use that to format
locale dependent directive like "%B" and "%x"; 
But since locale.getdefaultlocale return "cp936", so i expect
datetime.strftime to return locale formatted string.

--
components: Library (Lib)
messages: 174203
nosy: jwfang
priority: normal
severity: normal
status: open
title: datetime.strftime and locale.getdefaultlocale conflict on Windows ?
type: behavior
versions: Python 2.7

___
Python tracker 

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



[issue16330] Use surrogate-related macros

2012-10-30 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

It was a rhetorical question.  This code compiled only if Py_UNICODE_SIZE == 2. 
 But I should be more careful.

--

___
Python tracker 

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



[issue16310] zipfile: allow surrogates in filenames

2012-10-30 Thread STINNER Victor

STINNER Victor added the comment:

> If I am the only one to think this is wrong, then so be it.
> Our current workaround is to disallow surrogates in the manifest. /me shrugs.

You are not alone, that's why there are 3 open issues. But someone
should finish the different proposition and write a new fully
functionnal patch to support bytes filenames.

--

___
Python tracker 

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



[issue16330] Use surrogate-related macros

2012-10-30 Thread STINNER Victor

STINNER Victor added the comment:

> Oh, how could I miss this?

The code does compile with error on Linux with GCC. I don't understand how.

--

___
Python tracker 

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



[issue16306] Multiple error line for unknown command line parameter

2012-10-30 Thread Hieu Nguyen

Hieu Nguyen added the comment:

Serhiy, actually I have submitted my contributor form to Petri Lehtinen in  a 
sprint here in Finland.

--

___
Python tracker 

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



[issue11566] hypot define in pyconfig.h clashes with g++'s cmath

2012-10-30 Thread Václav Šmilauer

Václav Šmilauer added the comment:

Just for the record: a workaround (mentioned at 
http://boost.2283326.n4.nabble.com/Boost-Python-Compile-Error-s-GCC-via-MinGW-w64-td3165793.html#a3166760)
 is to always include  before .

--

___
Python tracker 

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



[issue11566] hypot define in pyconfig.h clashes with g++'s cmath

2012-10-30 Thread Mark Dickinson

Mark Dickinson added the comment:

I think there's something generally smelly about the way hypot is handled;  
this isn't the only hypot-related build issue that's turned up.  I'm wondering 
whether the code can be reworked to deal with hypot in the same way that 
functions like log1p, etc. are dealt with in the math module---i.e., define a 
_Py_hypot wrapper function, and use that everywhere internally.  One difference 
is that log1p is only used in cmath and math, while hypot is also needed in the 
Python core.

--

___
Python tracker 

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



[issue16310] zipfile: allow surrogates in filenames

2012-10-30 Thread Stefan Holek

Stefan Holek added the comment:

> It's possible to distribute Python packages with non-ASCII filenames.

Well, it wasn't until very recently (distribute 0.6.29):
https://bitbucket.org/tarek/distribute/issue/303/no-support-for-unicode-manifest-files
Unless we are not talking about the same thing, which is possible. ;-)

>> So yes, I have Latin-1 bytes on the filesystem,
>> even though my locale is UTF-8.

> You system is not configured correctly. If you would like to distribute such 
> invalid filename,
> how do you plan to access it on other platforms where the filename is decoded 
> differently?
> It would be safer to build your project on a well configured system.

This was done on purpose, to test how Python fares. Such files can easily come 
into existence, e.g. when cloning a Git repo created on a different system. I 
am not after "correct" ZIP files in this case, I am after Python not raising 
UnicodeErrors when it is supposed to a) support non-ASCII module names and b) 
support surrogates.

python setup.py sdist --formats=gztar -> works

python setup.py sdist --formats=zip -> UnicodeError

If I am the only one to think this is wrong, then so be it. Our current 
workaround is to disallow surrogates in the manifest. /me shrugs.

--

___
Python tracker 

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



[issue14897] struct.pack raises unexpected error message

2012-10-30 Thread Petri Lehtinen

Petri Lehtinen added the comment:

Matti Mäki wrote:
> I filled up the contributor form and gave it to Petri Lehtinen 2012-10-22

Yeah, and I posted it (along with 14 other contributor forms received
at PyCon Finland) to the PSF last week. They just seem to be a bit
slow to process them.

--

___
Python tracker 

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



[issue16322] time.tzname on Python 3.3.0 for Windows is decoded by wrong encoding

2012-10-30 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
nosy:  -serhiy.storchaka

___
Python tracker 

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



[issue14897] struct.pack raises unexpected error message

2012-10-30 Thread Matti Mäki

Matti Mäki added the comment:

I filled up the contributor form and gave it to Petri Lehtinen 2012-10-22

--

___
Python tracker 

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



[issue16306] Multiple error line for unknown command line parameter

2012-10-30 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Hieu Nguyen, can you please submit a contributor form?

http://python.org/psf/contrib/contrib-form/
http://python.org/psf/contrib/

--

___
Python tracker 

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



[issue15478] UnicodeDecodeError on OSError on Windows with undecodable (bytes) filename

2012-10-30 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

See also issue16074.

> The patch changes also os.link(), os.rename() and os.replace() to use the 
> source, not the destination, in the error message. It is maybe a mistake 
> because these functions can also fail in the directory of the destination 
> does not exist.

Yes, in different cases it can be the source, the destination, both, unknown or 
none of them.

--
nosy: +serhiy.storchaka
type:  -> behavior

___
Python tracker 

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



[issue14897] struct.pack raises unexpected error message

2012-10-30 Thread Petri Lehtinen

Petri Lehtinen added the comment:

> You probably should have used the word 'fix' rather than 'enhance' here:  
> else it smells like you're putting new features into a maintenance release. 
> :-)

Ah, true. But unfixable now :(

--

___
Python tracker 

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



[issue16335] Integer overflow in unicode-escape decoder

2012-10-30 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

(b'\\N{WHITE SMILING FACE' + b'x' * 2**32 + '}').decode('unicode-escape') may 
pass on platform with 32-bit int and more than 32-bit size_t if there is enough 
memory.

I don't have so much memory.

--

___
Python tracker 

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



[issue14897] struct.pack raises unexpected error message

2012-10-30 Thread Mark Dickinson

Mark Dickinson added the comment:

> "Enhance error messages of struct.pack and struct.pack_into"

You probably should have used the word 'fix' rather than 'enhance' here:  else 
it smells like you're putting new features into a maintenance release. :-)

--

___
Python tracker 

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



[issue11566] hypot define in pyconfig.h clashes with g++'s cmath

2012-10-30 Thread Mark Dickinson

Changes by Mark Dickinson :


--
nosy: +mark.dickinson

___
Python tracker 

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



[issue14625] Faster utf-32 decoder

2012-10-30 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

> I don't know any application using UTF-32-LE or UTF-32-BE. So I don't want to 
> waste Python memory/code size with a heavily optimized decoder. The patch A 
> looks to be enough.

Agree.  I had the same doubts.  That's why I proposed two patches for your 
choice.

--

___
Python tracker 

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



[issue16330] Use surrogate-related macros

2012-10-30 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Thanks.

> Issue #16330: Fix compilation on Windows

Oh, how could I miss this?

--
resolution:  -> fixed
stage: patch review -> committed/rejected
status: open -> closed

___
Python tracker 

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



  1   2   >