[issue22568] Use of "utime" as variable name in Modules/posixmodule.c causes errors

2014-10-06 Thread Georg Brandl

Georg Brandl added the comment:

Patch LGTM.

--
nosy: +georg.brandl

___
Python tracker 

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



[issue18216] gettext doesn't check MO versions

2014-10-06 Thread Berker Peksag

Changes by Berker Peksag :


--
nosy: +berker.peksag
stage:  -> patch review
type:  -> behavior
versions: +Python 2.7, Python 3.4, Python 3.5

___
Python tracker 

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



[issue22524] PEP 471 implementation: os.scandir() directory scanning function

2014-10-06 Thread Akira Li

Changes by Akira Li <4kir4...@gmail.com>:


--
nosy: +akira

___
Python tracker 

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



[issue22564] ssl: post-commit review of the new memory BIO API

2014-10-06 Thread Geert Jansen

Geert Jansen added the comment:

> newPySSLSocket() expects a char* string and use PyUnicode_Decode() to decode 
> bytes.

Yup, and this value is available as SSLSocket._sslobj.server_hostname. But 
SSLSocket.server_hostname is not this, it is what was passed to the constructor 
which can be a bytes instance.

For total cleanness maybe the constructor should raise a TypeError if 
server_hostname is passes as a bytes.

--

___
Python tracker 

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



[issue12458] Tracebacks should contain the first line of continuation lines

2014-10-06 Thread R. David Murray

Changes by R. David Murray :


--
nosy: +dingo_dasher

___
Python tracker 

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



[issue22573] AttributeErrors in statements split up into multiple linse with \ showing 'wrong' line as being responsible in error message

2014-10-06 Thread R. David Murray

R. David Murray added the comment:

This is a duplicate of issue 12458.

--
nosy: +r.david.murray
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> Tracebacks should contain the first line of continuation lines

___
Python tracker 

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



[issue22524] PEP 471 implementation: os.scandir() directory scanning function

2014-10-06 Thread Ben Hoyt

Ben Hoyt added the comment:

Attaching my first patch here. It includes docs, the implementation of scandir 
and DirEntry in posixmodule.c, and tests in test_scandir.py. It does not yet 
include the changes for os.walk() to use scandir; I'm hoping to do that in a 
separate patch for easier code review.

I'd love some code and documentation review, as well as some thoughts on these 
open questions:

1) posixmodule.c is getting kinda huge and unwieldy; it'd be nice to implement 
this in a separate C file, but that comes with its own problems, as several 
functions would need to be made available externally.

2) While writing the tests, I was getting issues with Windows (apparently) not 
deleting the symlinks immediately in my teardown function, so for the moment I 
just don't call the teardown function at all. Not great; I think we'll want a 
better solution.

3) Partly due to #2, I haven't yet added tests for the file-not-found condition 
if a file is found by the directory scanning but then deleted before a 
DirEntry.is_dir() or DirEntry.is_file() call. I intend to add these tests, and 
there's a TODO comment in test_scandir.py so I remember.

4) test_scandir.py will need some further cleanup for inclusion in CPython; 
it's currently taken straight from my scandir module, which supports Python 
down to Python 2.6.

--
keywords: +patch
Added file: http://bugs.python.org/file36831/scandir-1.patch

___
Python tracker 

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



[issue22572] NoneType object is not iterable error when asyncio Server.close() called

2014-10-06 Thread R. David Murray

R. David Murray added the comment:

The 'Server did not stop' error was lying in wait for the NoneType bug to be 
fixed :)  So, if you didn't the NoneType, my test case isn't reproducing the 
problem for you, which is odd.  Using call_soon_threadsafe from an addCleanup 
in the _server method makes it work for me.  (Seems to work even without the 
threadsafe, but I think I'll keep it!)  Perhaps seeing the NoneType error is a 
timing issue, given that the problem is thread safety.

So, my apologies for the noise.  I guess I'm too used to threads, where it is 
typical to call the close or stop method from another thread.

--
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue22573] AttributeErrors in statements split up into multiple linse with \ showing 'wrong' line as being responsible in error message

2014-10-06 Thread dingo_dasher

Changes by dingo_dasher :


--
title: AttributeErrors in long lines showing 'wrong' line in error message -> 
AttributeErrors in statements split up into multiple linse with \ showing 
'wrong' line as being responsible in error message

___
Python tracker 

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



[issue22573] AttributeErrors in long lines showing 'wrong' line in error message

2014-10-06 Thread dingo_dasher

New submission from dingo_dasher:

I am using Flask, and I had the following code:

modules = models.Module.query.join(models.ModuleAccess).\
 filter(models.Model.owner_id == current_user.id).\
 filter(models.ModuleAccess.user_id == 
current_user.id).\
 filter(models.ModuleAccess.module_id == 
models.Module.id).\
 filter(models.ModuleAccess.write_access == True)

This code had a bug -> "models.Model.owner_id" in the first line. This was a 
typo, and Python gave me an AttributeError, just as I would expect. However, 
this is the error I was given:

Traceback (most recent call last):
  File "/usr/local/lib/python3.4/dist-packages/flask/app.py", line 1836, in 
__call__
return self.wsgi_app(environ, start_response)
  File "/usr/local/lib/python3.4/dist-packages/flask/app.py", line 1820, in 
wsgi_app
response = self.make_response(self.handle_exception(e))
  File "/usr/local/lib/python3.4/dist-packages/flask/app.py", line 1403, in 
handle_exception
reraise(exc_type, exc_value, tb)
  File "/usr/local/lib/python3.4/dist-packages/flask/_compat.py", line 33, in 
reraise
raise value
  File "/usr/local/lib/python3.4/dist-packages/flask/app.py", line 1817, in 
wsgi_app
response = self.full_dispatch_request()
  File "/usr/local/lib/python3.4/dist-packages/flask/app.py", line 1477, in 
full_dispatch_request
rv = self.handle_user_exception(e)
  File "/usr/local/lib/python3.4/dist-packages/flask/app.py", line 1381, in 
handle_user_exception
reraise(exc_type, exc_value, tb)
  File "/usr/local/lib/python3.4/dist-packages/flask/_compat.py", line 33, in 
reraise
raise value
  File "/usr/local/lib/python3.4/dist-packages/flask/app.py", line 1475, in 
full_dispatch_request
rv = self.dispatch_request()
  File "/usr/local/lib/python3.4/dist-packages/flask/app.py", line 1461, in 
dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
  File "/usr/local/lib/python3.4/dist-packages/flask_login.py", line 758, in 
decorated_view
return func(*args, **kwargs)
  File "/home/dingo/UIM/app/views.py", line 175, in modules
filter(models.ModuleAccess.write_access == True)
AttributeError: 'module' object has no attribute 'Model'

It shows me the last line of that long statement, 
"models.ModuleAccess.write_access == True" as the beginning of the trace. The 
trace doesn't show the models.Module.whatever line that actually caused the 
error.

It seems to be like Python here takes the last line of the exception-causing 
statement and shows that along with the "actual" error message (which was on 
the money): AttributeError: 'module' object has no attribute 'Model'

This seems to me slightly misleading. I submit that a better behaviour would be 
to show the line that caused the exception (I assume/hope that is possible 
since python knew it was accessing the Model attribute of the module object 
that caused the error).

I classified this as a behaviour bug rather than an enhancement, because I 
believe this would not be intended behaviour. I don't know if that's the case.

I apologise if this doesn't fit in "Intepreter core", but exceptions are 
builtins... I didn't know where else to put it.

--
components: Interpreter Core
messages: 228749
nosy: dingo_dasher
priority: normal
severity: normal
status: open
title: AttributeErrors in long lines showing 'wrong' line in error message
type: behavior
versions: Python 3.4

___
Python tracker 

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



[issue21072] Python docs and downloads not available for Egypt

2014-10-06 Thread Benjamin Peterson

Changes by Benjamin Peterson :


--
status: open -> closed

___
Python tracker 

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



[issue18119] urllib.FancyURLopener does not treat URL fragments correctly

2014-10-06 Thread karl

karl added the comment:

In class urlopen_HttpTests
https://hg.python.org/cpython/file/4f314dedb84f/Lib/test/test_urllib.py#l191

there is a test for invalid redirects

def test_invalid_redirect(self):
https://hg.python.org/cpython/file/4f314dedb84f/Lib/test/test_urllib.py#l247

And one for fragments
def test_url_fragment(self):
https://hg.python.org/cpython/file/4f314dedb84f/Lib/test/test_urllib.py#l205

which refers to http://bugs.python.org/issue11703

code in 
https://hg.python.org/cpython/file/d5688a94a56c/Lib/urllib.py

--

___
Python tracker 

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



[issue7830] Flatten nested functools.partial

2014-10-06 Thread Alexander Belopolsky

Alexander Belopolsky added the comment:

I would say that getting "maximum recursion depth exceeded" error from 
evaluating a deeply nested partial is a bug, but I am not sure we should fix it 
by flattening partial objects in the constructor or by being smarter at 
evaluation time.

--
components: +Extension Modules
resolution: rejected -> 
stage: resolved -> 
status: closed -> open
versions: +Python 3.5 -Python 3.2

___
Python tracker 

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



[issue21072] Python docs and downloads not available for Egypt

2014-10-06 Thread Leo Butcher

Leo Butcher added the comment:

Yes, all subdomains are working now for me

--
status: pending -> open

___
Python tracker 

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



[issue22572] NoneType object is not iterable error when asyncio Server.close() called

2014-10-06 Thread Yury Selivanov

Yury Selivanov added the comment:

I think that the main problem is that '_stop_server' is called from a main 
thread (by unittest machinery via addCleanup), whereas the loop is in the other 
thread. asyncio code is not thread-safe in general.

If I change your code slightly to avoid using addCleanup, then everything 
works: https://gist.github.com/1st1/8dd0a2d4aa1ffd895c52

FWIW I couldn't reproduce the "NoneType object is not iterable" error. On my 
machine with python3.4.1 it crashes with another error "AssertionError: server 
did not stop" on line 35.

--

___
Python tracker 

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



[issue18119] urllib.FancyURLopener does not treat URL fragments correctly

2014-10-06 Thread karl

karl added the comment:

Takahashi-san,

Ah sorry misunderstood which part your were talking about. I assume wrongly you 
were talking about navigation. 

Yes for the request which is sent to the server it should be
http://tools.ietf.org/html/rfc7230#section-5.3.1
So refactoring your example.

1st request:

GET /foo HTTP/1.1
Accept: text/html
Host: example.com

server response
HTTP/1.1 302 Found
Location: /bar#test

second request must be
GET /bar HTTP/1.1
Accept: text/html
Host: example.com

As for the navigation context is indeed part of the piece of code taking in 
charge the document after being parsed and not the one doing the HTTP request. 
(putting it here just that people understand)


(to be tested)
For server side receiving invalid Request-line 
http://tools.ietf.org/html/rfc7230#section-3.1.1

   Recipients of an invalid request-line SHOULD respond with either a
   400 (Bad Request) error or a 301 (Moved Permanently) redirect with
   the request-target properly encoded.  A recipient SHOULD NOT attempt
   to autocorrect and then process the request without a redirect, since
   the invalid request-line might be deliberately crafted to bypass
   security filters along the request chain.

--

___
Python tracker 

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



[issue7830] Flatten nested functools.partial

2014-10-06 Thread Josh Rosenberg

Josh Rosenberg added the comment:

The use case in question, simplified, was:

from functools import partial

class Foo:
Bar = othermodule.Bar

def __new__(cls, ...):
...
cls.Bar(...)
...

def bind_stuff(cls, *args, **kwargs):
cls.Bar = partial(Bar, *args, **kwargs)

Every time they created an instance of Foo, there would be a Foo.bind_stuff 
call beforehand that fixed some settings they didn't want to make a part of 
Foo's __new__ profile. And in fact, in practice, they were only binding the 
same keyword args over and over, so they could have solved the problem by just 
rebinding the base othermodule.Bar. I'm not defending this design, but from 
what I can tell, it's a textbook example of where your patch would solve the 
problem. cls.Bar has no instance variables assigned (hence no __dict__?), and 
it's always functools.partial that's used, not some special variant.

A simple way to repro the fundamental problem they were experiencing is to just 
wrap int a lot:

>>> for i in range(1001):
int = partial(int)
>>> int(5) # Kaboom! Which I assume your patch would prevent

--

___
Python tracker 

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



[issue22572] NoneType object is not iterable error when asyncio Server.close() called

2014-10-06 Thread R. David Murray

New submission from R. David Murray:

I'm writing a little web server using aiohttp.  I tried to write a unit 
test...since this is a client server situation I launched the asyncio program 
in a thread and did a urlopen from the main thread.  That all works fine...the 
problem is in the cleanup code.  When I try to stop the server I created via 
create_server, I get the error in the title.

I've attached a stripped down version of my attempted unit test.  It does 
require aiohttp...I'm not well enough versed in asyncio yet to rewrite it using 
more fundamental pieces.

I may be doing something stupid here, but it seems to me that even if I am 
close should not throw this error (the error implies that it is already shut 
down, so I'd think the close would be a no-op).

--
components: asyncio
files: waiter_bug.py
messages: 228742
nosy: gvanrossum, haypo, r.david.murray, yselivanov
priority: normal
severity: normal
status: open
title: NoneType object is not iterable error when asyncio Server.close() called
type: behavior
versions: Python 3.4, Python 3.5
Added file: http://bugs.python.org/file36830/waiter_bug.py

___
Python tracker 

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



[issue22564] ssl: post-commit review of the new memory BIO API

2014-10-06 Thread STINNER Victor

STINNER Victor added the comment:

> However I think that in theory SSLSocket.server_hostname could be a bytes, if 
> a bytes was passed into the constructor.

newPySSLSocket() expects a char* string and use PyUnicode_Decode() to decode 
bytes.

--

___
Python tracker 

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



[issue22462] Modules/pyexpat.c violates PEP 384

2014-10-06 Thread Georg Brandl

Georg Brandl added the comment:

> I think it is unreasonable to expect authors of 3rd party modules to respect 
> PEP 384 if the standard library does not.

I don't understand why you think that.  PEP 384 is intended to provide the 
means to maintain binary compatibility of extension modules so that they don't 
have to be recompiled for every minor version. Standard library extensions are 
recompiled for every Python release anyway.

Also, we don't expect authors to respect PEP 384. Either they choose to do so, 
and get the benefits, or they don't.

> I have simply moved a function from ctypes.c to traceback.c (and renamed it 
> accordingly) so that pyexpat.c can access it.

I can see that. It would be cleaner to do the change in two steps, first move 
the utility function out from ctypes, then use it from pyexpat.  On the other 
hand we haven't been adamant about one-patch-one-change in the past.

--

___
Python tracker 

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



[issue22462] Modules/pyexpat.c violates PEP 384

2014-10-06 Thread Antoine Pitrou

Antoine Pitrou added the comment:

FWIW, I think the patch's approach is ok. I just did a small comment on the 
review UI.

--

___
Python tracker 

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



[issue22462] Modules/pyexpat.c violates PEP 384

2014-10-06 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
stage:  -> patch review
type:  -> behavior
versions: +Python 3.4

___
Python tracker 

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



[issue22462] Modules/pyexpat.c violates PEP 384

2014-10-06 Thread Mark Shannon

Mark Shannon added the comment:

W.r.t PEP 384:
Every module, except pyexpat, in the stdlib library treats frames as opaque 
objects, as PEP 384 requires.
(I'm exempting builtins and sys here)
I think it is unreasonable to expect authors of 3rd party modules to respect 
PEP 384 if the standard library does not.

W.r.t. the change to ctypes: I have simply moved a function from ctypes.c to 
traceback.c (and renamed it accordingly) so that pyexpat.c can access it.

--

___
Python tracker 

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



[issue7830] Flatten nested functools.partial

2014-10-06 Thread Alexander Belopolsky

Alexander Belopolsky added the comment:

Josh,

Would issue7830.diff solve your use-case as is?  See msg108980 for the 
limitations.  If so, I don't mind reopening this issue.

--

___
Python tracker 

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



[issue22559] [backport] ssl.MemoryBIO

2014-10-06 Thread Alex Gaynor

Alex Gaynor added the comment:

New patch is the same, it just rebases the socket changes out since Benjamin 
landed that (thanks!)

--
Added file: http://bugs.python.org/file36829/issue22559.diff

___
Python tracker 

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



[issue7830] Flatten nested functools.partial

2014-10-06 Thread Josh Rosenberg

Josh Rosenberg added the comment:

If it affects the decision, I just had to debug some code at work that 
triggered a "excessive recursion" bug because they used functools.partial over 
and over on the same base function, thinking they could safely replace some 
keyword bindings over and over. This patch would have prevented the problem.

Any chance of reopening it?

--
nosy: +josh.rosenberg

___
Python tracker 

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



[issue22571] Remove import * recommendations and examples in doc?

2014-10-06 Thread Terry J. Reedy

New submission from Terry J. Reedy:

PEP 8 recommends against 'from mod import *' because it makes reading harder 
and is bad for code analysis.  My experience with retrofitting tests to idlelib 
modules with tkinter * imports is that it also makes testing harder since the 
testing strategy depends on the specific tkinter objects actually used.  So 
either an explicit list ('from tkinter import x, y, z') or a searchable prefix 
('tk.') makes testing easier.  

Some time ago, 'from tkinter import *' was changed to 'import tkinter as tk' in 
the tkinter doc examples, though *not* the text.  ##10031 changed the import 
section of the FAQ to "remove the advice to use "from ... import *" with some 
modules" (from the commit message).  Should we finish the job?  Or leave the 
issue to individual chapter authors?

Here is the edited result of grepping 'import *' in ...\py34\Doc\*.rst with 
Idle.

F:\Python\dev\4\py34\Doc\distutils\apiref.rst: 1289: This module is safe to use 
in ``from ... import *`` mode; it only exports
F:\Python\dev\4\py34\Doc\library\cmd.rst: 234: from turtle import *
F:\Python\dev\4\py34\Doc\library\collections.abc.rst: 14:from collections 
import *
F:\Python\dev\4\py34\Doc\library\collections.rst: 11: from collections 
import *
F:\Python\dev\4\py34\Doc\library\ctypes.rst: 54:>>> from ctypes import *
F:\Python\dev\4\py34\Doc\library\ctypes.rst: 86:>>> from ctypes import *
F:\Python\dev\4\py34\Doc\library\ctypes.rst: 320:>>> from ctypes import *
F:\Python\dev\4\py34\Doc\library\ctypes.rst: 562:>>> from ctypes import *
F:\Python\dev\4\py34\Doc\library\ctypes.rst: 671:>>> from ctypes import *
F:\Python\dev\4\py34\Doc\library\ctypes.rst: 695:>>> from ctypes import *
F:\Python\dev\4\py34\Doc\library\ctypes.rst: 714:>>> from ctypes import *
F:\Python\dev\4\py34\Doc\library\ctypes.rst: 914:>>> from ctypes import *
F:\Python\dev\4\py34\Doc\library\ctypes.rst: 1074:>>> from ctypes import *
F:\Python\dev\4\py34\Doc\library\ctypes.rst: 1122:>>> from ctypes import *
F:\Python\dev\4\py34\Doc\library\decimal.rst: 20:from decimal import *
F:\Python\dev\4\py34\Doc\library\decimal.rst: 56:  >>> from decimal import *
F:\Python\dev\4\py34\Doc\library\decimal.rst: 125:>>> from decimal import *
F:\Python\dev\4\py34\Doc\library\difflib.rst: 13:from difflib import *
F:\Python\dev\4\py34\Doc\library\itertools.rst: 12:from itertools import *
F:\Python\dev\4\py34\Doc\library\stat.rst: 104:from stat import *
F:\Python\dev\4\py34\Doc\library\statistics.rst: 13:from statistics import *
F:\Python\dev\4\py34\Doc\library\struct.rst: 313:>>> from struct import *
F:\Python\dev\4\py34\Doc\library\tkinter.rst: 63:from tkinter import *
F:\Python\dev\4\py34\Doc\library\tkinter.rst: 580:from tkinter import *
F:\Python\dev\4\py34\Doc\library\tkinter.tix.rst: 60:   from 
tkinter.constants import *
F:\Python\dev\4\py34\Doc\library\tkinter.ttk.rst: 38:from tkinter import *
F:\Python\dev\4\py34\Doc\library\tkinter.ttk.rst: 39:from tkinter.ttk 
import *
F:\Python\dev\4\py34\Doc\library\turtle.rst: 11:from turtle import *

F:\Python\dev\4\py34\Doc\tutorial\modules.rst: 102:>>> from fibo import *
F:\Python\dev\4\py34\Doc\tutorial\modules.rst: 461: Now what happens when the 
user writes ``from sound.effects import *``?  Ideally,
F:\Python\dev\4\py34\Doc\tutorial\modules.rst: 470: list of module names that 
should be imported when ``from package import *`` is
F:\Python\dev\4\py34\Doc\tutorial\modules.rst: 479: This would mean that ``from 
sound.effects import *`` would import the three
F:\Python\dev\4\py34\Doc\tutorial\modules.rst: 482: If ``__all__`` is not 
defined, the statement ``from sound.effects import *``
F:\Python\dev\4\py34\Doc\tutorial\modules.rst: 493:from sound.effects 
import *
F:\Python\dev\4\py34\Doc\tutorial\modules.rst: 501: patterns when you use 
``import *``, it is still considered bad practise in
F:\Python\dev\4\py34\Doc\tutorial\stdlib2.rst: 372:>>> from decimal import *

I removed the reference hits that simply explain.  I have not looked at whether 
the tutorial goes beyond explanation, but should this even be mentioned in so 
many places?

--
assignee: docs@python
components: Documentation
messages: 228734
nosy: docs@python, georg.brandl, terry.reedy
priority: normal
severity: normal
stage: needs patch
status: open
title: Remove import * recommendations and examples in doc?
versions: Python 2.7, Python 3.4, Python 3.5

___
Python tracker 

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



[issue22568] Use of "utime" as variable name in Modules/posixmodule.c causes errors

2014-10-06 Thread Jeffrey Armstrong

Jeffrey Armstrong added the comment:

So in my original report, I actually got things backwards.  The failure is 
because utime is a local variable, but a call to utime() is then attempted.

Regardless, the code is still completely broken in Modules/posixmodule.c under 
the conditions I described.

--

___
Python tracker 

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



[issue22568] Use of "utime" as variable name in Modules/posixmodule.c causes errors

2014-10-06 Thread Jeffrey Armstrong

Jeffrey Armstrong added the comment:

Under the conditions I described in Modules/posixmodules.c on line 4815, the 
utime() function is called.  With the current code, the following correct 
compiler error is emitted:

./Modules/posixmodule.c(4815): Error! E1012: Expression is not a function

The above occurs because utime is treated as a local variable and an attempt is 
made at calling it as a function.

The use of a possible (and fairly standard) function name as a local variable 
is unfortunate, and I'm guessing these conditions haven't been tested in a 
while.

--

___
Python tracker 

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



[issue22568] Use of "utime" as variable name in Modules/posixmodule.c causes errors

2014-10-06 Thread Arfrever Frehtes Taifersar Arahesis

Arfrever Frehtes Taifersar Arahesis added the comment:

Maybe it is unnecessary strictness in Open Watcom compiler.

If renaming was necessary, then I suggest utime_obj instead of ut.

--
nosy: +Arfrever

___
Python tracker 

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



[issue7676] IDLE shell shouldn't use TABs

2014-10-06 Thread Terry J. Reedy

Terry J. Reedy added the comment:

They potentially could be.  However, if the result is something like
>>> if a:
if b:
print(a+b)
or worse, with Lucida Sans Unicode, the visual equivalent of
>>> if a:
  if b:
print(a+b)
then I do not find result very satisfactory.  I think moving the prompt to a 
sidebar, as with line numbers (forthcoming), is a better solution.  This will 
make code look good both in the shell and when copied and pasted elsewhere.  I 
hope to have a patch in a month or two.

--

___
Python tracker 

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



[issue22568] Use of "utime" as variable name in Modules/posixmodule.c causes errors

2014-10-06 Thread Larry Hastings

Larry Hastings added the comment:

I don't understand.  If utime is a *function*, then the local variable should 
simply take precedence.  Do you possibly mean that utime is a *macro*?

What compilation error do you get?

--

___
Python tracker 

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



[issue22566] International keyboard makes IDLE crash on OSX

2014-10-06 Thread Mc128k

Mc128k added the comment:

Hi
Thank you a lot for the help, installing 
ActiveTcl8.5.15.1.297588-macosx10.5-i386-x86_64-threaded solved the problem 
immediately.

--

___
Python tracker 

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



[issue4832] IDLE does not supply a default ext of .py on Windows or OS X for new file saves

2014-10-06 Thread Brian Curtin

Changes by Brian Curtin :


--
nosy:  -brian.curtin

___
Python tracker 

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



[issue4832] IDLE does not supply a default ext of .py on Windows or OS X for new file saves

2014-10-06 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Thank you. It was in particular the switching between a -> a.py and a -> a.txt 
that I described and wanted verified for linux.  The fact that names with 
extensions are left unchanged is important too.  I will have to think about how 
to describe this succinctly.

--

___
Python tracker 

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



[issue18216] gettext doesn't check MO versions

2014-10-06 Thread Aaron Hill

Changes by Aaron Hill :


--
keywords: +patch
nosy: +Aaron1011
Added file: http://bugs.python.org/file36828/gettext-mo-version.patch

___
Python tracker 

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



[issue22569] Add support for weakrefs to _socket.socket

2014-10-06 Thread Roundup Robot

Roundup Robot added the comment:

New changeset d5688a94a56c by Benjamin Peterson in branch '2.7':
make _socket.socket weakrefable (closes #22569)
https://hg.python.org/cpython/rev/d5688a94a56c

--
nosy: +python-dev
resolution:  -> fixed
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue22566] International keyboard makes IDLE crash on OSX

2014-10-06 Thread Ned Deily

Ned Deily added the comment:

This crash behavior is due to an old bug in the OS X Cocoa implementation of 
Tk.  It has been fixed in the most recent releases of Tk 8.5.x and 8.6.x but, 
unfortunately, Apple has not yet shipped the fix in any version of the OS X 
system Tk 8.5 (since OS X 10.6).  If you are building your own Python 3.5, you 
can install the most recent copy of ActiveTcl 8.5.x or 8.6.x (assuming the 
license terms are acceptable) or you could build your own Tcl/Tk and then 
rebuild _tkinter.so.  For more information: 
https://www.python.org/download/mac/tcltk and
http://sourceforge.net/p/tktoolkit/bugs/2722/

--
assignee: ronaldoussoren -> 
nosy: +ned.deily
resolution:  -> third party
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue22561] PyUnicode_InternInPlace crashes

2014-10-06 Thread Ned Deily

Ned Deily added the comment:

Also note that there were major internal changes in Python strings for 3.3 
(http://legacy.python.org/dev/peps/pep-0393/) so you might want to look at 
those especially if this worked OK with Python 3.2.  Since it seems unlikely 
that there would be any further progress on resolving this without more 
analysis on the UNO end, I am closing this issue as presumed to be a 
third-party problem.  Feel free to re-open if evidence of a problem in Python 
itself is uncovered.

--
assignee: ronaldoussoren -> 
resolution:  -> third party
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue22559] [backport] ssl.MemoryBIO

2014-10-06 Thread Alex Gaynor

Alex Gaynor added the comment:

New patch works and passes all tests. It's on top of issue22569.

--
Added file: http://bugs.python.org/file36827/issue225593.diff

___
Python tracker 

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



[issue22570] Better stdlib support for Path objects

2014-10-06 Thread R. David Murray

Changes by R. David Murray :


--
nosy: +r.david.murray

___
Python tracker 

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



[issue21278] Running the test suite with -v makes the test_ctypes and the test_zipimport erroneously reported as failed

2014-10-06 Thread ddve...@ucar.edu

ddve...@ucar.edu added the comment:

If no one is able to reproduce it, I guess we can close it.

I am sure I can reproduce it if I run it in the same situation I ran
it the first time. However, I initially reported the bug for python
2.7.6 i.e. two versions ago, so it might have been fixed by something
that happened meanwhile (or did the ones who tried used the exact
version I reported the bug against?)

If I experience the bug again while installing v2.7.9, I will report
it here again (you all receive updates even if the bug is closed,
right? I am asking because I don't thing I have the rights to re-open
it).

Thanks,
Davide

On Sat, Oct 4, 2014 at 6:47 PM, Mark Lawrence  wrote:
>
> Mark Lawrence added the comment:
>
> As there has been no response can this be closed?
>
> --
> nosy: +BreamoreBoy
> status: pending -> open
>
> ___
> Python tracker 
> 
> ___

--

___
Python tracker 

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



[issue10583] Encoding issue with chm help in 2.7.1

2014-10-06 Thread Georg Brandl

Georg Brandl added the comment:

Agreed, closing.

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

___
Python tracker 

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



[issue18119] urllib.FancyURLopener does not treat URL fragments correctly

2014-10-06 Thread Shuhei Takahashi

Shuhei Takahashi added the comment:

Hi karl,

Of course it is correct that the user agent is redirected to 
http://example.com/bar#test when it got such response. However, it never means 
UA can send an HTTP request containing fragment part.

In RFC7230 section 3.1.1, HTTP request line is defined as:
request-line   = method SP request-target SP HTTP-version CRLF
where request-target is defined in section 5.3. In usual case, it is 
origin-form:
origin-form= absolute-path [ "?" query ]
which never includes fragment part.

This means current urllib behavior violates HTTP/1.1 spec.

--

___
Python tracker 

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



[issue7676] IDLE shell shouldn't use TABs

2014-10-06 Thread Stephen Paul Chappell

Stephen Paul Chappell added the comment:

In Lib\idlelib\PyShell.py, there are usetabs and indentwidth attributes in the 
PyShell class. Is there some reason that these settings cannot be reconfigured 
in the Options > Configure IDLE... menu? I just edited these to False and 4 
respectively and am quite content with the resulting behavior.

--

___
Python tracker 

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



[issue22570] Better stdlib support for Path objects

2014-10-06 Thread Antoine Pitrou

Antoine Pitrou added the comment:

As for adding convenience methods to Path objects, yes, I'm quite open to that. 
Best is to open an issue when you have a specific idea (and a patch :-)).

--

___
Python tracker 

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



[issue22570] Better stdlib support for Path objects

2014-10-06 Thread Georg Brandl

Georg Brandl added the comment:

> That would be a rather horrible solution.

I know :)

--

___
Python tracker 

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



[issue22570] Better stdlib support for Path objects

2014-10-06 Thread Antoine Pitrou

Antoine Pitrou added the comment:

> I was about to suggest deriving your own Path class from Path and str

That would be a rather horrible solution.
It has already been suggested to create a "path protocol". I would suggest 
Barry tries to float and investigate the idea on python-ideas:
https://mail.python.org/pipermail/python-ideas/2014-May/027869.html

--

___
Python tracker 

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



[issue22570] Better stdlib support for Path objects

2014-10-06 Thread Georg Brandl

Georg Brandl added the comment:

I was about to suggest deriving your own Path class from Path and str, but got 
a base class layout conflict because Path objects define lots of __slots__ :(

--

___
Python tracker 

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



[issue22566] International keyboard makes IDLE crash on OSX

2014-10-06 Thread Mc128k

Mc128k added the comment:

2014-10-06 18:01:38.139 Python[13297:1294014] An uncaught exception was raised
2014-10-06 18:01:38.139 Python[13297:1294014] -[__NSCFConstantString 
characterAtIndex:]: Range or index out of bounds
2014-10-06 18:01:38.139 Python[13297:1294014] (
0   CoreFoundation  0x7fff89f3e64c 
__exceptionPreprocess + 172
1   libobjc.A.dylib 0x7fff8c8e56de 
objc_exception_throw + 43
2   CoreFoundation  0x7fff89f3e4fd 
+[NSException raise:format:] + 205
3   CoreFoundation  0x7fff89e12c46 
-[__NSCFString characterAtIndex:] + 102
4   Tk  0x00010243d5a8 
TkpInitKeymapInfo + 751
5   Tk  0x00010244360b 
Tk_MacOSXSetupTkNotifier + 880
6   Tcl 0x00010231849c 
Tcl_DoOneEvent + 316
7   _tkinter.so 0x000102290831 
Tkapp_MainLoop + 177
8   Python  0x0001000e542b 
PyEval_EvalFrameEx + 31291
9   Python  0x0001000e665d 
PyEval_EvalCodeEx + 2349
10  Python  0x0001000e51f7 
PyEval_EvalFrameEx + 30727
11  Python  0x0001000e665d 
PyEval_EvalCodeEx + 2349
12  Python  0x0001000e671f 
PyEval_EvalCode + 63
13  Python  0x000100e7 
PyRun_StringFlags + 183
14  Python  0x000100111271 
PyRun_SimpleStringFlags + 65
15  Python  0x000100127e55 Py_Main + 
1445
16  Python  0x00010e32 Python + 3634
17  Python  0x00010c84 Python + 3204
)
2014-10-06 18:01:38.140 Python[13297:1294014] *** Terminating app due to 
uncaught exception 'NSRangeException', reason: '-[__NSCFConstantString 
characterAtIndex:]: Range or index out of bounds'
*** First throw call stack:
(
0   CoreFoundation  0x7fff89f3e64c 
__exceptionPreprocess + 172
1   libobjc.A.dylib 0x7fff8c8e56de 
objc_exception_throw + 43
2   CoreFoundation  0x7fff89f3e4fd 
+[NSException raise:format:] + 205
3   CoreFoundation  0x7fff89e12c46 
-[__NSCFString characterAtIndex:] + 102
4   Tk  0x00010243d5a8 
TkpInitKeymapInfo + 751
5   Tk  0x00010244360b 
Tk_MacOSXSetupTkNotifier + 880
6   Tcl 0x00010231849c 
Tcl_DoOneEvent + 316
7   _tkinter.so 0x000102290831 
Tkapp_MainLoop + 177
8   Python  0x0001000e542b 
PyEval_EvalFrameEx + 31291
9   Python  0x0001000e665d 
PyEval_EvalCodeEx + 2349
10  Python  0x0001000e51f7 
PyEval_EvalFrameEx + 30727
11  Python  0x0001000e665d 
PyEval_EvalCodeEx + 2349
12  Python  0x0001000e671f 
PyEval_EvalCode + 63
13  Python  0x000100e7 
PyRun_StringFlags + 183
14  Python  0x000100111271 
PyRun_SimpleStringFlags + 65
15  Python  0x000100127e55 Py_Main + 
1445
16  Python  0x00010e32 Python + 3634
17  Python  0x00010c84 Python + 3204
)
libc++abi.dylib: terminating with uncaught exception of type NSException
Abort trap: 6

--

___
Python tracker 

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



[issue19071] Documentation on what self is for module-level functions is misleading/wrong.

2014-10-06 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 59fe0ff02c90 by Georg Brandl in branch '2.7':
Closes #19071: "self" argument is not the module for module functions in 2.x.
https://hg.python.org/cpython/rev/59fe0ff02c90

--
nosy: +python-dev
resolution:  -> fixed
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue22570] Better stdlib support for Path objects

2014-10-06 Thread Barry A. Warsaw

Barry A. Warsaw added the comment:

On Oct 06, 2014, at 03:43 PM, Georg Brandl wrote:

>I'd rather write str(path) all over the place than having to look up in the
>docs each time if that specific API happens to support passing Paths
>directly.

Have you tried to write a large-ish application using path objects?
str-infection is definitely a disincentive to using pathlib. :/

--

___
Python tracker 

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



[issue16155] Some minor doc fixes in Doc/faq

2014-10-06 Thread Georg Brandl

Georg Brandl added the comment:

Thanks!

--
nosy: +georg.brandl

___
Python tracker 

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



[issue16155] Some minor doc fixes in Doc/faq

2014-10-06 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 96eab476d45e by Georg Brandl in branch '3.4':
Closes #16155: fix a few errors in doctest output of the FAQ pages.
https://hg.python.org/cpython/rev/96eab476d45e

--

___
Python tracker 

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



[issue16155] Some minor doc fixes in Doc/faq

2014-10-06 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 09782fad1825 by Georg Brandl in branch '2.7':
Closes #16155: fix a few errors in doctest output of the FAQ pages.
https://hg.python.org/cpython/rev/09782fad1825

--
nosy: +python-dev
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

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



[issue17078] string.Template.safe_substitute hard-wires "braces" as {}

2014-10-06 Thread Georg Brandl

Changes by Georg Brandl :


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

___
Python tracker 

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



[issue17078] string.Template.safe_substitute hard-wires "braces" as {}

2014-10-06 Thread Georg Brandl

Georg Brandl added the comment:

Done in 8a98ee6baa1e. Thanks!

--
nosy: +georg.brandl

___
Python tracker 

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



[issue17057] Data model documentation grammar

2014-10-06 Thread Roundup Robot

Roundup Robot added the comment:

New changeset b6fab5c89ca9 by Georg Brandl in branch '2.7':
Closes #17057: fix grammar in old-style vs new-style class docs.
https://hg.python.org/cpython/rev/b6fab5c89ca9

--
nosy: +python-dev
resolution:  -> fixed
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue22570] Better stdlib support for Path objects

2014-10-06 Thread Georg Brandl

Georg Brandl added the comment:

Since we're unlikely to ever change all the places, I'd say it's better to be 
consistent.  I'd rather write str(path) all over the place than having to look 
up in the docs each time if that specific API happens to support passing Paths 
directly.

However, Antoine has been positive towards more utility methods on Path 
objects.  (Not that ConfigParser read() would fall in that category :)

--
nosy: +georg.brandl

___
Python tracker 

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



[issue1686] string.Template.safe_substitute fail when overriding pattern attribute

2014-10-06 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 8a98ee6baa1e by Florent Xicluna in branch '2.7':
Issue #1686: Fix string.Template when overriding the pattern attribute.
https://hg.python.org/cpython/rev/8a98ee6baa1e

--
nosy: +python-dev

___
Python tracker 

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



[issue22570] Better stdlib support for Path objects

2014-10-06 Thread Barry A. Warsaw

Changes by Barry A. Warsaw :


--
nosy: +pitrou

___
Python tracker 

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



[issue22570] Better stdlib support for Path objects

2014-10-06 Thread Barry A. Warsaw

Changes by Barry A. Warsaw :


--
components: +Library (Lib)

___
Python tracker 

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



[issue22570] Better stdlib support for Path objects

2014-10-06 Thread Barry A. Warsaw

New submission from Barry A. Warsaw:

pathlib is really nice, but currently it's rather inconvenient to use due to 
the lack of support in other parts of the stdlib for Path objects.  For 
historical reasons, everything accepts string paths, but few places accept 
Paths.  As an example: configparser.ConfigParser.read() but there are lots of 
others.

I'm opening this bug to start a conversation about better support for Path 
objects in the stdlib.  Against all hope, I wish there was a simple way to 
extend the compatibility, but I don't like having to sprinkle `str(some_path)` 
calls everywhere (kind of defeats the purpose of having the nicer pathlib API 
IMHO).  I suspect instead that it will be a matter of adding type tests or 
str() conversions to the relevant methods, but there may be other issues to 
discuss, like is it even a good idea to do this? ;)

--
messages: 228704
nosy: barry
priority: normal
severity: normal
status: open
title: Better stdlib support for Path objects
versions: Python 3.5

___
Python tracker 

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



[issue19642] shutil to support equivalent of: rm -f /dir/*

2014-10-06 Thread Barry A. Warsaw

Changes by Barry A. Warsaw :


--
nosy: +barry

___
Python tracker 

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



[issue22562] Singleton pattern for namedtuple

2014-10-06 Thread Eric V. Smith

Eric V. Smith added the comment:

You might want to check out https://bitbucket.org/ctismer/namelesstuple, which 
uses a similar approach.

--
nosy: +eric.smith

___
Python tracker 

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



[issue21072] Python docs and downloads not available for Egypt

2014-10-06 Thread Georg Brandl

Changes by Georg Brandl :


--
resolution:  -> fixed
status: open -> pending

___
Python tracker 

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



[issue22292] pickle whichmodule RuntimeError

2014-10-06 Thread STINNER Victor

Changes by STINNER Victor :


--
superseder:  -> RuntimeError in pickle.whichmodule  when sys.modules if mutated

___
Python tracker 

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



[issue12148] Clarify "or-ing together" doctest option flags

2014-10-06 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 1439619daf42 by Georg Brandl in branch '3.4':
Closes #12148: clarify "or's together option flags" in doctest docs.
https://hg.python.org/cpython/rev/1439619daf42

--
nosy: +python-dev
resolution:  -> fixed
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue18165] Add 'unexpected_type' to TypeError

2014-10-06 Thread Brett Cannon

Brett Cannon added the comment:

There's actually nothing to remind here since there is no one waiting on input 
from anyone. Plus this particular issue is covered by 
http://legacy.python.org/dev/peps/pep-0473/ .

--

___
Python tracker 

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



[issue21782] hashable documentation error: shouldn't mention id

2014-10-06 Thread Roundup Robot

Roundup Robot added the comment:

New changeset bfaf434a6f10 by Georg Brandl in branch '3.4':
Closes #21782: the default hash(x) is not exactly id(x) but derived from it.
https://hg.python.org/cpython/rev/bfaf434a6f10

--
nosy: +python-dev
resolution:  -> fixed
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue13101] Module Doc viewer closes when browser window closes on Windows 8

2014-10-06 Thread Georg Brandl

Georg Brandl added the comment:

pydoc.gui() no longer exists in supported versions.

--
nosy: +georg.brandl
resolution:  -> out of date
status: open -> closed

___
Python tracker 

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



[issue21784] __init__.py can be a directory

2014-10-06 Thread Georg Brandl

Georg Brandl added the comment:

I agree, closing.

--
nosy: +georg.brandl
resolution:  -> wont fix
status: open -> closed

___
Python tracker 

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



[issue14303] Incorrect documentation for socket.py on linux

2014-10-06 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 6e2a72e05b4f by Georg Brandl in branch '2.7':
Closes #14303: socket.makefile() does not call dup() anymore on the socket fd.
https://hg.python.org/cpython/rev/6e2a72e05b4f

--
nosy: +python-dev
resolution:  -> fixed
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue22559] [backport] ssl.MemoryBIO

2014-10-06 Thread Alex Gaynor

Alex Gaynor added the comment:

As suggested by Benjamin, I've filed issue22569 to add weakref support to 
_socket.socket; that will address this and further reduce teh diff with Python3.

--
dependencies: +Add support for weakrefs to _socket.socket

___
Python tracker 

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



[issue22569] Add support for weakrefs to _socket.socket

2014-10-06 Thread Alex Gaynor

New submission from Alex Gaynor:

This is needed to keep the _ssl module reasonably in sync with it's Python3 
counterpart.

--
files: weakref-me-captain.diff
keywords: needs review, patch
messages: 228695
nosy: alex, benjamin.peterson
priority: normal
severity: normal
status: open
title: Add support for weakrefs to _socket.socket
versions: Python 2.7
Added file: http://bugs.python.org/file36826/weakref-me-captain.diff

___
Python tracker 

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



[issue22568] Use of "utime" as variable name in Modules/posixmodule.c causes errors

2014-10-06 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
nosy: +larry

___
Python tracker 

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



[issue16518] add "buffer protocol" to glossary

2014-10-06 Thread Georg Brandl

Georg Brandl added the comment:

Please open a new issue for those.

--
nosy: +georg.brandl

___
Python tracker 

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



[issue22564] ssl: post-commit review of the new memory BIO API

2014-10-06 Thread Geert Jansen

Geert Jansen added the comment:

> +.. attribute:: SSLSocket.server_hostname
> +
> +   A ``bytes`` instance (...)
>
> Ah, this is a mistake. It's actually always a str instance (on SSLObject as 
> well).

It is indeed, I stand corrected. I was confused by the decode -> encode 
roundtrip that happens in _ssl.

However I think that in theory SSLSocket.server_hostname could be a bytes, if a 
bytes was passed into the constructor. _ssl parses this argument with the "et" 
format which means it will let a correctly encoded byte string through. Not 
sure if anybody is using this though.

--

___
Python tracker 

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



[issue10031] Withdraw anti-recommendation of relative imports from documentation

2014-10-06 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 9d321235f1f9 by Georg Brandl in branch '2.7':
Closes #10031: overhaul the "imports" section of the programming FAQ.
https://hg.python.org/cpython/rev/9d321235f1f9

--

___
Python tracker 

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



[issue10031] Withdraw anti-recommendation of relative imports from documentation

2014-10-06 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 8c33440d1f64 by Georg Brandl in branch '3.4':
Closes #10031: overhaul the "imports" section of the programming FAQ.
https://hg.python.org/cpython/rev/8c33440d1f64

--
nosy: +python-dev
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

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



[issue22568] Use of "utime" as variable name in Modules/posixmodule.c causes errors

2014-10-06 Thread Jeffrey Armstrong

New submission from Jeffrey Armstrong:

Under certain circumstances, Modules/posixmodule.c will fail to compile due to 
a number of utime-related functions using a variable named "utime" when a 
function named "utime" already exists in the compiler's C header files.  
Specifically, if the following are undefined:

HAVE_UTIMENSAT
HAVE_UTIMES

and the following are defined:

HAVE_UTIMENSAT
HAVE_LUTIMES
HAVE_UTIME_H

the compiler will fail because the UTIME_TO_UTIMBUF module attempts to access 
utime->now when utime is acutually a function included from utime.h.

I've attached a patch that renames the uname functions' parameter "utime" to 
"ut" to avoid the conflict.

This bug was encountered using Open Watcom 2.0 (owcc) under GNU/Linux 32-bit.

--
components: Interpreter Core
files: utime-3.4.1.patch
keywords: patch
messages: 228690
nosy: Jeffrey.Armstrong
priority: normal
severity: normal
status: open
title: Use of "utime" as variable name in Modules/posixmodule.c causes errors
type: compile error
versions: Python 3.4
Added file: http://bugs.python.org/file36825/utime-3.4.1.patch

___
Python tracker 

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



[issue22526] file iteration SystemError for huge lines (2GiB+)

2014-10-06 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Serhiy's patch looks ok to me (haven't tested it).

--
nosy: +pitrou

___
Python tracker 

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



[issue22562] Singleton pattern for namedtuple

2014-10-06 Thread Leo

Leo added the comment:

A use case for the singleton pattern arises when
- field names are known only at runtime, and
- you have a large number of instances with the same field names.

An example is the storage of metadata for datasets when a hashable
type is needed.

I agree that it will generally be possible to implement the singleton
pattern by wrapping collections.namedtuple. And I recognise that the
singleton pattern would make both old and new code vulnerable to side
effects caused by "mutated" classes. These side effects may well
outweigh any efficiency gains to be reaped.
I therefore withdraw the idea.

Leo

On 06/10/2014, R. David Murray  wrote:
>
> R. David Murray added the comment:
>
> Agreed.  If you want it to be a singleton in your code, use the singleton
> pattern in your code...but it is hard for me to see why that would be a good
> idea :) (ie: DRY).  Globally, it does not seem to me that there are likely
> to be any significant number of identical definitions in non-related
> codebases, even absent the mutable-class issue.
>
> --
> nosy: +r.david.murray
> resolution:  -> rejected
> stage:  -> resolved
> status: open -> closed
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue22564] ssl: post-commit review of the new memory BIO API

2014-10-06 Thread Antoine Pitrou

Antoine Pitrou added the comment:

+.. attribute:: SSLSocket.server_hostname
+
+   A ``bytes`` instance (...)

Ah, this is a mistake. It's actually always a str instance (on SSLObject as 
well).

--

___
Python tracker 

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



[issue22567] doctest handle ignored execption

2014-10-06 Thread R. David Murray

R. David Murray added the comment:

This tracker is not a place to get answers to questions, you should use the 
python-list mailing list for that.  (That said, here's a hint: the only way to 
capture that message is to run it in a subprocess; the message is generated 
asynchronously, during garbage collection.)

--
nosy: +r.david.murray
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue1284316] Win32: Security problem with default installation directory

2014-10-06 Thread Brian Curtin

Changes by Brian Curtin :


--
nosy:  -brian.curtin

___
Python tracker 

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



[issue8110] subprocess.py doesn't correctly detect Windows machines

2014-10-06 Thread Brian Curtin

Changes by Brian Curtin :


--
nosy:  -brian.curtin

___
Python tracker 

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



[issue22567] doctest handle ignored execption

2014-10-06 Thread Yoav Caspi

New submission from Yoav Caspi:

When implementing a class with a __del__ function that raise an exception the 
exception ignored.
is it possible to add this printed message to be tested by doc test?

something like when running this script the script will pass:
 
"""
Usage Example:
>>> cls = Module()
>>> del cls
Exception Exception: Exception('oops',) in > ignored
"""

class Module(object):
def __del__(self):
raise Exception("oops")

if __name__ == '__main__':
from doctest import testmod
print testmod()

--
components: Tests
messages: 228685
nosy: Yoav.Caspi
priority: normal
severity: normal
status: open
title: doctest handle ignored execption
type: enhancement
versions: Python 2.7

___
Python tracker 

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



[issue22327] test_gdb failures on Ubuntu 14.10

2014-10-06 Thread Matěj Stuchlík

Matěj Stuchlík added the comment:

Suddenly started to see the same error on Fedora rawhide [0].

[0] https://kojipkgs.fedoraproject.org//work/tasks/3551/7773551/build.log

--
nosy: +sYnfo

___
Python tracker 

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



[issue16429] Emit SyntaxWarning for code that risks UnboundLocalError

2014-10-06 Thread Georg Brandl

Georg Brandl added the comment:

I seem to recall that this was rejected into the realm of linters in a 
python-dev discussion.

If there is a chance of false positives, having Python emit the warning would 
be annoying because there is no convenient way of telling it to shut up about 
it.  At least people can choose not to run linters, or configure them to their 
taste.

--
nosy: +georg.brandl
resolution:  -> rejected
status: open -> pending

___
Python tracker 

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



[issue22292] pickle whichmodule RuntimeError

2014-10-06 Thread Attilio Di Nisio

Attilio Di Nisio added the comment:

Duplicate of #21905
Fixed in https://hg.python.org/cpython/rev/86ba3bdfac15

--
resolution:  -> duplicate
status: open -> closed
versions: +Python 3.5

___
Python tracker 

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



[issue22563] namedtuple: raise an exception when the given class name would override an existing name

2014-10-06 Thread Leo

Leo added the comment:

The idea was based on a misunderstanding of the typename argument. I
had erroneously inferred that the namedtuple class object would be
bound to some namespace whereas the only binding is achieved by the
assignment to a local name which may be different from the typename.
And typename can probably even be an empty string.

I agree that the oddities shown in the two code examples are just an
example of a misuse of the freedom a dynamic language grants.

Rereading the docs on nametuple, I think a clarification on the
purpose and proper use of typename might be in order. Most people have
been declaring classes for many years using the class statement. This
implicitly binds the class name to the current namespace. This is why
I was mislead.

Thanks for the helpful feedback.

Leo

On 06/10/2014, Mark Dickinson  wrote:
>
> Mark Dickinson added the comment:
>
> Right; the underlying problem of having objects that appear to be instances
> of  the wrong class has nothing to do with namedtuples.  After this
> sequence:
>
 class A: pass
> ...
 a = A()

 class A: pass
> ...
>
> We get the following somewhat confusing results:
>
 type(a)
> 
 A
> 
 isinstance(a, A)
> False
>
> Class factories like namedtuple make it somewhat easier to run into this
> issue, but it's nothing really to do with namedtuple itself, and it's not
> something that could be "fixed" without significant language redesign.
>
> --
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue22564] ssl: post-commit review of the new memory BIO API

2014-10-06 Thread Alex Gaynor

Changes by Alex Gaynor :


--
nosy: +alex

___
Python tracker 

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



[issue22462] Modules/pyexpat.c violates PEP 384

2014-10-06 Thread Georg Brandl

Georg Brandl added the comment:

Not sure how this can violate PEP 384, as it doesn't make it mandatory for 
builtin extensions to use the stable ABI.

The other concerns seem valid, although I don't like how the patch includes an 
unrelated change to ctypes.

--
nosy: +georg.brandl, pitrou

___
Python tracker 

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



[issue6359] pyexpat.c calls trace function incorrectly for exceptions

2014-10-06 Thread Georg Brandl

Georg Brandl added the comment:

A more complete patch that also fixes up pyexpat's frame trickery is tracked in 
#22462.

--
nosy: +georg.brandl
resolution:  -> duplicate
status: open -> closed
superseder:  -> Modules/pyexpat.c violates PEP 384

___
Python tracker 

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



[issue22562] Singleton pattern for namedtuple

2014-10-06 Thread R. David Murray

R. David Murray added the comment:

Agreed.  If you want it to be a singleton in your code, use the singleton 
pattern in your code...but it is hard for me to see why that would be a good 
idea :) (ie: DRY).  Globally, it does not seem to me that there are likely to 
be any significant number of identical definitions in non-related codebases, 
even absent the mutable-class issue.

--
nosy: +r.david.murray
resolution:  -> rejected
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue21480] A build now requires...

2014-10-06 Thread Georg Brandl

Georg Brandl added the comment:

asdl.py is fixed to work with 2.7 as of 3b2af26f4638.

--
nosy: +georg.brandl

___
Python tracker 

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



[issue21480] A build now requires...

2014-10-06 Thread Roundup Robot

Roundup Robot added the comment:

New changeset eefed1ecfd47 by Georg Brandl in branch '3.4':
Closes #21480: better explanation of "hg touch" in the Makefile.
https://hg.python.org/cpython/rev/eefed1ecfd47

--
nosy: +python-dev
resolution:  -> fixed
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue22561] PyUnicode_InternInPlace crashes

2014-10-06 Thread STINNER Victor

STINNER Victor added the comment:

> Shall I bounce this issue back to the LibreOffice folks and see if I can find 
> whoever owns that piece of code?  (If anybody does...)

For me, it's an issue in the uno module.

--

___
Python tracker 

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



[issue9417] Declaring a class creates circular references

2014-10-06 Thread Georg Brandl

Georg Brandl added the comment:

I don't think this can go somewhere useful.

--
resolution:  -> wont fix
status: open -> closed

___
Python tracker 

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



  1   2   >