[issue16123] IDLE - deprecate running without a subprocess

2015-11-23 Thread Terry J. Reedy

Terry J. Reedy added the comment:

I have some different ideas for this issue that would not necessarily involve 
removing -n.  While -n is can be an inferior experience for users (user code 
blocks the GUI, other interference, especially tkinter), the reason given for 
deprecation is to simplify IDLE maintenance by eliminating alternate code paths.

Summary: a new rpc_local module might allow us to simplify code now, without 
removing -n, and provide a path to switching subprocess communication from 
sockets to pipes.

1. Simplify maintenance by instead isolating -n code in a new 'rpc_local' 
module that is imported 'as rpc' when -n is given.  (A 'run_local' module might 
also be needed.)  The goal would be to have the rest of IDLE as oblivious as 
possible as to where user code is executed.  Other modules would send messages 
via rpc and not know whether they go to another process (currently via a 
socket) or or back to the main thread in the same process.  I don't know how 
far this is possible.  It would certainly involve some refactoring.

2. Make rpc_local less of a dummy by executing user code in a separate thread 
connected by a pair of Queues (and call it rpc_thread).  I believe this would 
solve the problem of user code freezing IDLE.  On the other hand, it might make 
user code importing tkinter worse.  If so, I would consider declaring that 
unsupported and not run code containing 'tkinter'.  Perhaps I am overlooking 
some important reason a thread is not already used.

3. If rpc_thread worked, multiprocessing could be used to turn it into a new 
rpc remote process module that communicated with pipes instead of socket ports.

--

___
Python tracker 

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



[issue25709] Problem with string concatenation and utf-8 cache.

2015-11-23 Thread Terry J. Reedy

Terry J. Reedy added the comment:

It would be good to get this in 3.4.4.

--
components: +Library (Lib) -IDLE
nosy: +benjamin.peterson, ezio.melotti, haypo, lemburg, pitrou -kbk, roger.serwy
title: greek alphabet bug it is very disturbing... -> Problem with string 
concatenation and utf-8 cache.

___
Python tracker 

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



[issue25709] greek alphabet bug it is very disturbing...

2015-11-23 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Yes, I have came to the same as random832. String objects have "fast path" for 
concatenating, and in this path cached UTF8 representation is not cleaned. 
Pickle is one of simplest ways to reproduce this issue. May be it can be 
reproduced with compile() or type(), but these ways looks too heavyweighted to 
me.

Here is a patch that fixes strings concatenation.

--
keywords: +patch
stage:  -> patch review
Added file: http://bugs.python.org/file41140/issue25709.patch

___
Python tracker 

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



[issue25710] zipimport is not PEP 3147 or PEP 488 compliant

2015-11-23 Thread Stéphane Wirtel

Changes by Stéphane Wirtel :


--
nosy: +matrixise

___
Python tracker 

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



[issue5680] Command-line arguments when running in IDLE

2015-11-23 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Today on SO: 
https://stackoverflow.com/questions/33866724/read-data-from-file-idle.  Person 
writing script to open a file given on command line asks 'How to test from 
IDLE?' He found PyCharm, but I would like to add a better answer than the 
workaround I gave above.  It does not have to be either perfect or necessarily 
permanent.  There are two subissues.  

1) Get a command line from the user.  1a. What dialog?  1b. Retain it for as 
least the current session?  Same for all editors? Specific to file?

2) Use the command line.  2a. parse with shlex or custom parser. 2b integrate 
in ScriptBinding.py when starting user code so code sees arguments in sys.argv.

Looking *briefly* at the patches:

M.B.: Get command line with new extension module argumentDialog.py. Parse with 
re.findall(arg_regex).  Modifies ScriptBinding, including the deletin of a 
condition for setting user sys.argv.

G.G.: Get command line with tkSimpleDialog._QueryString. Split with shlex.  
Reuses MB's ScriptBinding patch.

S.H.: Get command line with custom dialog. Use custom parser. Add new tests.

My inclination is to start as simple as possible.  Use a message box to get a 
single string (no error checking is needed).  Set for specific file only, not 
all.  The setting could be added to status bar.  Parse with shlex.  Question: 
is basic command line parsing system specific?  Does MAC stick with unix/posix 
rules?  Should shlex.split use non-posix mode on Windows?

--
assignee: asvetlov -> terry.reedy
nosy: +markroseman
type: behavior -> enhancement
versions: +Python 3.6

___
Python tracker 

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



Re: pip does not work anymore

2015-11-23 Thread Cecil Westerhof
On Monday 23 Nov 2015 14:08 CET, Steven D'Aprano wrote:

> On Mon, 23 Nov 2015 06:48 pm, Cecil Westerhof wrote:
>
>> When I try to install something with pip2 I get:
>> Traceback (most recent call last):
> [...]
>> from urllib2 import (Request, urlopen, URLError, HTTPError,
>> ImportError: cannot import name HTTPSHandler
>
> Before blaming SUSE for breaking this, please run this at the
> interactive interpreter:
>
> import urllib2
> print urllib2.__file__
>
>
> Have you perhaps accidentally shadowed the std lib module?

It worked without fail before the update, but you never know:
Python 2.7.9 (default, Dec 13 2014, 18:02:08) [GCC] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import urllib2
>>> print urllib2.__file__
/usr/lib64/python2.7/urllib2.pyc

So I did not shadow I would think.

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
-- 
https://mail.python.org/mailman/listinfo/python-list


Designing DBI compliant SQL parameters for module

2015-11-23 Thread Israel Brewster
My company uses a database (4th dimension) for which there was no python DBI 
compliant driver available (I had to use ODBC, which I felt was cludgy). 
However, I did discover that the company had a C driver available, so I went 
ahead and used CFFI to wrap this driver into a DBI compliant python module 
(https://pypi.python.org/pypi/p4d). This works well (still need to make it 
python 3.x compatible), but since the underlying C library uses "qmark" style 
parameter markers, that's all I implemented in my module.

I would like to expand the module to be able to use the more-common (or at 
least easier for me) "format" and "pyformat" parameter markers, as indicated in 
the footnote to PEP-249 (https://www.python.org/dev/peps/pep-0249/#id2 at least 
for the pyformat markers). Now I am fairly confidant that I can write code to 
convert such placeholders into the qmark style markers that the underlying 
library provides, but before I go and re-invent the wheel, is there already 
code that does this which I can simply use, or modify?
---
Israel Brewster
Systems Analyst II
Ravn Alaska
5245 Airport Industrial Rd
Fairbanks, AK 99709
(907) 450-7293
---




-- 
https://mail.python.org/mailman/listinfo/python-list


[issue25709] greek alphabet bug it is very disturbing...

2015-11-23 Thread random832

random832 added the comment:

I can't reproduce without pickle. I did some further digging, though, and it 
*looks like*...

1. Pickle causes the built-in UTF-8 representation of a string to be populated, 
whereas encode('utf-8') does not. Can anyone think of any other operations that 
do this?
2. After the UTF-8 representation of the 2-character string is populated, 
concatenating a new character to it does not update or clear it.
3. However, it worked just fine with the 1-character string - concatenating it 
caused the UTF-8 representation to be cleared.

The actual operation that creates an inconsistent string is the concatenate 
operation, but it only happens with a string that has been "primed" by having 
its UTF-8 representation materialized.

--

___
Python tracker 

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



[issue25713] Setuptools included with 64-bit Windows installer is outdated

2015-11-23 Thread James Paget

New submission from James Paget:

This applies to Python 3.5.1rc1 only.  The Windows 64-bit standalone installer 
installs setuptools 18.2, but the latest version is 18.5.  It should be noted 
that the Python 2.7.11rc1 Windows 64-bit standalone installer installs 
setuptools 18.5.  Other Python 3.5.1.rc1 installers (web based, or for other 
platforms) may have this problem as well, but I have not tried them out.

--
components: Extension Modules
messages: 255208
nosy: James.Paget
priority: normal
severity: normal
status: open
title: Setuptools included with 64-bit Windows installer is outdated
type: performance
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



[issue25704] Update the devguide to 3.5

2015-11-23 Thread Berker Peksag

Berker Peksag added the comment:

> My first opinion when I have read the documentation was "but this doc is out 
> of date".

Yes, some parts of the devguide is outdated and I already gave +1 to update 
those parts. But most of the other changes are use 3.4 as an example so 
changing it to 3.5 won't make the devguide up-to-date. For example,

+must not be broken at any point between sibling minor releases (3.5.1, 
etc.).
+For both rules, only rare exceptions are accepted and **must** be discussed
+first.

and

-while the maintenance branch names (``2.7``, ``3.4``, etc) are mapped
+while the maintenance branch names (``2.7``, ``3.5``, etc) are mapped

>> It might also worth to update the build-dep command in setup.rst.
> I agree, I am going to check that

You've already changed setup.rst :) But it would great if you could test "sudo 
apt-get build-dep python3.5" and build Python on a modern Debian/Ubuntu since 
I'm still on 12.04.

It's very hard to point which parts are OK in the patch without Rietveld. I'll 
update it myself and attach here to save both of us some time :)

Thanks!

--

___
Python tracker 

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



[issue25714] Consider isinstance(..., numbers.Integral) instead of isinstance(..., int) or isinstance(..., (int, long)) in datetime.py

2015-11-23 Thread Matt Bogosian

New submission from Matt Bogosian:

datetime.py is peppered with ``assert`` statements that are two restrictive. 
Specifically, ``isinstance(..., int)`` does not afford compatibility with 
alternate ``int``-like implementations (e.g., ``future.types.newint``). Some 
background:

* https://github.com/PythonCharmers/python-future/issues/187
* 
https://bitbucket.org/pypy/pypy/issues/2193/datetimetimedelta-chokes-on-seconds

In all cases that I can find, ``assert isinstance(..., int)`` is unnecessarily 
restrictive, since it is always followed by another ``assert`` which validates 
that the boundaries are far smaller than a Python 2 native `int` type. (See, 
e.g., `datetype.py at line 395 
`__).

I propose replacing instances of ``assert isinstance(..., int)`` and ``assert 
isinstance(..., (int, long))`` with ``assert isinstance(..., 
numbers.Integral)`` akin to `this patch 
`__.

--
components: Library (Lib)
messages: 255211
nosy: posita
priority: normal
severity: normal
status: open
title: Consider isinstance(..., numbers.Integral) instead of isinstance(..., 
int) or isinstance(..., (int, long)) in datetime.py
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



Re: Bi-directional sub-process communication

2015-11-23 Thread Ian Kelly
On Mon, Nov 23, 2015 at 10:54 AM, Israel Brewster  wrote:
> Concern: Since the master process is multi-threaded, it seems likely enough 
> that multiple threads on the master side would make requests at the same 
> time. I understand that the Queue class has locks that make this fine (one 
> thread will complete posting the message before the next is allowed to 
> start), and since the child process only has a single thread processing 
> messages from the queue, it should process them in order and post the 
> responses (if any) to the master_queue in order. But now I have multiple 
> master processes all trying to read master_queue at the same time. Again, the 
> locks will take care of this and prevent any overlapping reads, but am I 
> guaranteed that the threads will obtain the lock and therefore read the 
> responses in the right order? Or is there a possibility that, say, thread 
> three will get the response that should have been for thread one? Is this 
> something I need to take into consideration, and if so, how?

Yes, if multiple master threads are waiting on the queue, it's
possible that a master thread could get a response that was not
intended for it. As far as I know there's no guarantee that the
waiting threads will be woken up in the order that they called get(),
but even if there are, consider this case:

Thread A enqueues a request.
Thread B preempts A and enqueues a request.
Thread B calls get on the response queue.
Thread A calls get on the response queue.
The response from A's request arrives and is given to B.

Instead of having the master threads pull objects off the response
queue directly, you might create another thread whose sole purpose is
to handle the response queue. That could look like this:


request_condition = threading.Condition()
response_global = None

def master_thread():
global response_global
with request_condition:
request_queue.put(request)
request_condition.wait()
# Note: the Condition should remain acquired until
response_global is reset.
response = response_global
response_global = None
if wrong_response(response):
raise RuntimeError("got a response for the wrong request")
handle_response(response)

def response_thread():
global response_global
while True:
response = response_queue.get()
with request_condition:
response_global = response
request_condition.notify()


As another option you could use a multiprocessing.Manager to
coordinate passing the response back more directly, but starting a
third process seems like overkill for this.
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue5680] Command-line arguments when running in IDLE

2015-11-23 Thread Terry J. Reedy

Terry J. Reedy added the comment:

When  file is run with command line args, it might be nice to add an additional 
separator line with the line entered.  That way, if someone ran a series of 
experiments with different command lines, they would have the command line and 
output together as documentation that can be saved.

--

___
Python tracker 

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



[issue8256] input() doesn't catch _PyUnicode_AsString() exception; io.StringIO().encoding is None

2015-11-23 Thread Erik Bray

Erik Bray added the comment:

I just recently discovered this myself.  In the process of debugging the issue 
I also noticed the same bug that is now fixed via Issue 24402.

While I agree that Issue 24402 mostly mitigates the issue I think this patch is 
still worthwhile, as the current behavior still leads to cryptic, hard to debug 
errors.  For example (although this is not great code, bear with me...) one 
could write a stdout wrapper like:

>>> class WrappedStream:
... encoding = 'utf8'
... errors = None
... def __getattr__(self, attr):
... return getattr(sys.__stdout__, attr)
... 
>>> sys.stdout = WrappedStream()
>>> sys.stdout.fileno()
1
>>> sys.stdout.isatty()
True
>>> sys.stdout.errors
>>> input('Prompt: ')
Traceback (most recent call last):
  File "", line 1, in 
TypeError: bad argument type for built-in operation

This still goes down the path for ttys, but because the 'errors' attribute does 
not defer to the underlying stream it still leads to a hard to debug exception. 
 To be clear, I think the above code *should* break, just not as cryptically.

--
nosy: +erik.bray

___
Python tracker 

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



[issue25709] Problem with string concatenation and utf-8 cache.

2015-11-23 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Added test without using pickle.

--
nosy: +larry
priority: high -> release blocker
Added file: http://bugs.python.org/file41141/issue25709_2.patch

___
Python tracker 

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



[issue25709] Problem with string concatenation and utf-8 cache.

2015-11-23 Thread Eryk Sun

Eryk Sun added the comment:

Serhiy, when does sharing UTF-8 data occur in a compact object? It has to be 
ASCII since non-ASCII UTF-8 isn't sharable, but PyASCIIObject doesn't have the 
utf8 field. So it has to be a PyCompactUnicodeObject. But isn't ASCII always 
allocated as a PyASCIIObject? I need a bit of help getting from point A to 
point B. Thanks.

--

___
Python tracker 

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



[issue8256] input() doesn't catch _PyUnicode_AsString() exception; io.StringIO().encoding is None

2015-11-23 Thread Erik Bray

Erik Bray added the comment:

> I think the above code *should* break

Actually, I see now that Serhiy's patch would allow this example to just pass 
through to the non-interactive fallback.  So I take it back that my example 
should break--I think using the fallback would also be fine.

--

___
Python tracker 

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



[issue25715] Python 3.5.1 installer shows wrong upgrade path

2015-11-23 Thread Steve Dower

New submission from Steve Dower:

When launching the installer to upgrade from a Python 3.5.0 install to 3.5.1, 
the path shown on the Install button is incorrect. Clicking the button installs 
to the correct location.

This is a regression from 3.5.0 that will cause a lot of confusion. It ought to 
be fixed.

--
assignee: steve.dower
components: Installation, Windows
keywords: 3.5regression
messages: 255219
nosy: larry, paul.moore, steve.dower, tim.golden, zach.ware
priority: release blocker
severity: normal
stage: needs patch
status: open
title: Python 3.5.1 installer shows wrong upgrade path
type: behavior
versions: Python 3.5, Python 3.6

___
Python tracker 

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



[issue25711] Rewrite zipimport from scratch

2015-11-23 Thread Eric Snow

Changes by Eric Snow :


--
nosy: +eric.snow, superluser

___
Python tracker 

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



[issue25710] zipimport is not PEP 3147 or PEP 488 compliant

2015-11-23 Thread Eric Snow

Changes by Eric Snow :


--
nosy: +superluser

___
Python tracker 

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



[issue4744] asynchat documentation needs to be more precise

2015-11-23 Thread R. David Murray

R. David Murray added the comment:

OK, let's close it then.  If someone finds something wrong they can open a new 
issue.

--
resolution:  -> fixed
stage: needs patch -> 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



[issue25711] Rewrite zipimport from scratch

2015-11-23 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

It was my intension.

--

___
Python tracker 

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



[issue25711] Rewrite zipimport from scratch

2015-11-23 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
Removed message: http://bugs.python.org/msg255223

___
Python tracker 

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



[issue25711] Rewrite zipimport from scratch

2015-11-23 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
Removed message: http://bugs.python.org/msg255222

___
Python tracker 

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



[issue25711] Rewrite zipimport from scratch

2015-11-23 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I was my intention.

--

___
Python tracker 

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



[issue25624] shutil.make_archive makes invalid directory entries

2015-11-23 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Larry, I think this patch is enough important to go into 3.5.1 final. It fixes 
a regression in common operation.

--

___
Python tracker 

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



pip does not work anymore

2015-11-23 Thread Cecil Westerhof
When I try to install something with pip2 I get:
Traceback (most recent call last):
  File "/usr/bin/pip2", line 9, in 
load_entry_point('pip==7.1.2', 'console_scripts', 'pip2')()
  File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 
558, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
  File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 
2682, in load_entry_point
return ep.load()
  File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 
2355, in load
return self.resolve()
  File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 
2361, in resolve
module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/usr/lib/python2.7/site-packages/pip/__init__.py", line 15, in 

from pip.vcs import git, mercurial, subversion, bazaar  # noqa
  File "/usr/lib/python2.7/site-packages/pip/vcs/subversion.py", line 9, in 

from pip.index import Link
  File "/usr/lib/python2.7/site-packages/pip/index.py", line 30, in 
from pip.wheel import Wheel, wheel_ext
  File "/usr/lib/python2.7/site-packages/pip/wheel.py", line 35, in 
from pip._vendor.distlib.scripts import ScriptMaker
  File "/usr/lib/python2.7/site-packages/pip/_vendor/distlib/scripts.py", 
line 14, in 
from .compat import sysconfig, detect_encoding, ZipFile
  File "/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.py", 
line 31, in 
from urllib2 import (Request, urlopen, URLError, HTTPError,
ImportError: cannot import name HTTPSHandler

With pip3 I get the same problem.

It looks like openSUSE has done an upgrade in which it disabled ssl2.
How can I get pip2/3 working again?

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: pip does not work anymore

2015-11-23 Thread Laura Creighton
In a message of Mon, 23 Nov 2015 08:48:54 +0100, Cecil Westerhof writes:
>When I try to install something with pip2 I get:
>Traceback (most recent call last):
>  File "/usr/bin/pip2", line 9, in 
>load_entry_point('pip==7.1.2', 'console_scripts', 'pip2')()
>  File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 
> 558, in load_entry_point
>return get_distribution(dist).load_entry_point(group, name)
>  File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 
> 2682, in load_entry_point
>return ep.load()
>  File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 
> 2355, in load
>return self.resolve()
>  File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 
> 2361, in resolve
>module = __import__(self.module_name, fromlist=['__name__'], level=0)
>  File "/usr/lib/python2.7/site-packages/pip/__init__.py", line 15, in 
> 
>from pip.vcs import git, mercurial, subversion, bazaar  # noqa
>  File "/usr/lib/python2.7/site-packages/pip/vcs/subversion.py", line 9, 
> in 
>from pip.index import Link
>  File "/usr/lib/python2.7/site-packages/pip/index.py", line 30, in 
> 
>from pip.wheel import Wheel, wheel_ext
>  File "/usr/lib/python2.7/site-packages/pip/wheel.py", line 35, in 
> 
>from pip._vendor.distlib.scripts import ScriptMaker
>  File "/usr/lib/python2.7/site-packages/pip/_vendor/distlib/scripts.py", 
> line 14, in 
>from .compat import sysconfig, detect_encoding, ZipFile
>  File "/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.py", 
> line 31, in 
>from urllib2 import (Request, urlopen, URLError, HTTPError,
>ImportError: cannot import name HTTPSHandler
>
>With pip3 I get the same problem.
>
>It looks like openSUSE has done an upgrade in which it disabled ssl2.
>How can I get pip2/3 working again?
>
>-- 
>Cecil Westerhof
>Senior Software Engineer
>LinkedIn: http://www.linkedin.com/in/cecilwesterhof
>-- 
>https://mail.python.org/mailman/listinfo/python-list

Reading 
https://forums.opensuse.org/showthread.php/488962-OpenSuse-python-amp-openssl
seems to indicatew that you are supposed to use python-pip and not pip
for OpenSuse, but I don't have one, so that is just my interpretation.

Laura
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue25695] test___all__ and test_support alter execution environment

2015-11-23 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

defer-TESTDIRN.patch LGTM.

--
nosy: +serhiy.storchaka
stage: patch review -> commit review

___
Python tracker 

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



Creating a Dynamic Website Using Python

2015-11-23 Thread Cai Gengyang
Ok, 

So I have gone through the CodeAcademy Python modules and decided to jump 
straight into a project. 

I want to create a dynamic web-based site like this --- https://www.wedpics.com 
using Python 

How / where do I start ?

Thanks a lot !

Gengyang 
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue25657] virtualenv's activate does not update LD_LIBRARY_PATH

2015-11-23 Thread Ronald Oussoren

Ronald Oussoren added the comment:

Hi,

This appears to be a description of an issue for 
, not a component of CPython or its 
standard library.

The issue tracker for virtualenv is at 
.

--
nosy: +ronaldoussoren

___
Python tracker 

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



Re: Creating a Dynamic Website Using Python

2015-11-23 Thread Mark Lawrence

On 23/11/2015 09:55, Cai Gengyang wrote:

Ok,

So I have gone through the CodeAcademy Python modules and decided to jump 
straight into a project.

I want to create a dynamic web-based site like this --- https://www.wedpics.com 
using Python

How / where do I start ?



With a search engine, or do you need instructions on how to use one?

--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.

Mark Lawrence

--
https://mail.python.org/mailman/listinfo/python-list


[issue25657] virtualenv's activate does not update LD_LIBRARY_PATH

2015-11-23 Thread serge-sans-paille

serge-sans-paille added the comment:

ok, I'll report there then. Sorry for the noise :-/

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

___
Python tracker 

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



[issue6478] time.tzset does not reset _strptime's locale time cache

2015-11-23 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I forgot about this issue and proposed similar patch for issue25168. It doesn't 
recalculate timezone values (a tuple of frozensets) on every _strptime call, 
but uses cheaper tests for time.tzname and time.daylight.

issue6478_v3.diff has a bug, it doesn't clear _regex_cache after changing 
_TimeRE_cache. And I doubt that after fixing this the benefit of not recreating 
the entire _TimeRE_cache will be worth the complication of the code.

Looks as this bug is a cause of random order depending tests failure 
(issue22067).

--
stage: needs patch -> patch review
versions: +Python 3.5, Python 3.6 -Python 3.3
Added file: http://bugs.python.org/file41134/strptime_cache_timezone.patch

___
Python tracker 

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



Re: What is a function parameter =[] for?

2015-11-23 Thread BartC

On 23/11/2015 07:47, Steven D'Aprano wrote:


I think it would be cleaner and better if Python had dedicated syntax for
declaring static local variables:


Interesting. So why is it that when /I/ said:

> On Mon, 23 Nov 2015 12:21 am, BartC wrote:
>
>> But if it's used for static storage, then why not just use static
>> storage?

You replied with the insulting:

> /head-desk

?

Maybe it's my turn to bang my head on the desk.

--
Bartc

--
https://mail.python.org/mailman/listinfo/python-list


[issue25688] File leak in ElementTree.iterparse()

2015-11-23 Thread Martin Panter

Martin Panter added the comment:

Patch 2 looks good. I like the new version of the tests better.

--

___
Python tracker 

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



Re: Is there an meaning of '[[]]' in a list?

2015-11-23 Thread Peter Otten
Quivis wrote:

> On Thu, 19 Nov 2015 12:40:17 +0100, Peter Otten wrote:
> 
>> those questions that are a little harder
> 
> And just how is he going to determine what is hard?

Note that I said "a little harder", not "hard".

Write down your next ten or so questions, then work through the tutorial or 
another introductory text, then use a search engine, then post the one or 
two questions that are still unanswered.


-- 
https://mail.python.org/mailman/listinfo/python-list


Re: What is a function parameter =[] for?

2015-11-23 Thread Mark Lawrence

On 23/11/2015 00:37, BartC wrote:

On 23/11/2015 00:04, Mark Lawrence wrote:

On 22/11/2015 23:44, Steven D'Aprano wrote:

On Mon, 23 Nov 2015 12:21 am, BartC wrote:


But if it's used for static storage, then why not just use static
storage? That's a simpler and more general concept than memoisation.


/head-desk

"But if it's used for cooking, why not just cook? That's a simpler and
more
general concept than roasting."


With 'it' being a washing machine perhaps? But I'll let this other chap
have the last word as he puts it across better:

 > Steven D'Aprano wrote:
 >> Memoisation isn't "esoteric", it is a simple, basic and widely-used
 >> technique used to improve performance of otherwise expensive functions.

On 22/11/2015 23:43, Gregory Ewing wrote:

 > That may be true, but I don't think it's a good example
 > of a use for a shared, mutable default value, because
 > it's arguably an *abuse* of the default value mechanism.


What happened to "Please do not feed the trolls"?


You mean, people with different opinions?

I think I'm done here.



Wow, so there is a God.

--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.

Mark Lawrence

--
https://mail.python.org/mailman/listinfo/python-list


[issue25702] Link Time Optimizations support for GCC and CLANG

2015-11-23 Thread Antoine Pitrou

Antoine Pitrou added the comment:

LTO only exists on recent versions of gcc, so the configure script should 
probably do some version checking.

Also we can't enable it by default as 1) it makes compile times much longer 2) 
there are some bugs in some gcc versions (see e.g. 
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=753134).

--
nosy: +pitrou
stage:  -> patch review

___
Python tracker 

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



[issue25702] Link Time Optimizations support for GCC and CLANG

2015-11-23 Thread Alecsandru Patrascu

Alecsandru Patrascu added the comment:

LTO exists in GCC since version 4.5, but it is true that only recent versions 
(>=4.8) perform it in good conditions. It is not enabled by default in this 
patch, it is only available when building with PGO support. Running just "make" 
will not activate the LTO flags.

Do you see it as an configure option (using, for example, an explicit 
--with-lto flag) rather than using it automatically?

--

___
Python tracker 

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



[issue19316] devguide: compiler - wording

2015-11-23 Thread Stéphane Wirtel

Stéphane Wirtel added the comment:

Hi everybody,

Here is a new version of the script for the last version of the devguide.
198554fa82c2

Please review and apply.

--
nosy: +matrixise

___
Python tracker 

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



Re: pip does not work anymore

2015-11-23 Thread Cecil Westerhof
On Monday 23 Nov 2015 08:48 CET, Cecil Westerhof wrote:

> When I try to install something with pip2 I get: Traceback (most
> recent call last): File "/usr/bin/pip2", line 9, in 
> load_entry_point('pip==7.1.2', 'console_scripts', 'pip2')() File
> "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line
> 558, in load_entry_point return
> get_distribution(dist).load_entry_point(group, name) File
> "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line
> 2682, in load_entry_point return ep.load() File
> "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line
> 2355, in load return self.resolve() File
> "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line
> 2361, in resolve module = __import__(self.module_name,
> fromlist=['__name__'], level=0) File
> "/usr/lib/python2.7/site-packages/pip/__init__.py", line 15, in
>  from pip.vcs import git, mercurial, subversion, bazaar #
> noqa File "/usr/lib/python2.7/site-packages/pip/vcs/subversion.py",
> line 9, in  from pip.index import Link File
> "/usr/lib/python2.7/site-packages/pip/index.py", line 30, in
>  from pip.wheel import Wheel, wheel_ext File
> "/usr/lib/python2.7/site-packages/pip/wheel.py", line 35, in
>  from pip._vendor.distlib.scripts import ScriptMaker File
> "/usr/lib/python2.7/site-packages/pip/_vendor/distlib/scripts.py",
> line 14, in  from .compat import sysconfig, detect_encoding,
> ZipFile File
> "/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.py",
> line 31, in  from urllib2 import (Request, urlopen,
> URLError, HTTPError, ImportError: cannot import name HTTPSHandler
>
> With pip3 I get the same problem.
>
> It looks like openSUSE has done an upgrade in which it disabled
> ssl2. How can I get pip2/3 working again?

Can I make pip work with ssl3?

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
-- 
https://mail.python.org/mailman/listinfo/python-list


Let urllib3 use ssl3 instead of ssl2

2015-11-23 Thread Cecil Westerhof
For a program I need to import urllib3, but this gives:
ImportError: /usr/lib64/python2.7/lib-dynload/_ssl.so: undefined symbol: 
SSLv2_method

This probably has to do with that openSUSE removed ssl2 because it is
not secure. Is there a way to let urllib3 use ssl3 instead of ssl2?

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: What is a function parameter =[] for?

2015-11-23 Thread Ned Batchelder
On Monday, November 23, 2015 at 6:35:35 AM UTC-5, Mark Lawrence wrote:
> On 23/11/2015 00:37, BartC wrote:
> > On 23/11/2015 00:04, Mark Lawrence wrote:
> >> What happened to "Please do not feed the trolls"?
> >
> > You mean, people with different opinions?
> >
> > I think I'm done here.
> >
> 
> Wow, so there is a God.

Mark, you aren't helping.

--Ned.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Creating a Dynamic Website Using Python

2015-11-23 Thread Chris Angelico
On Mon, Nov 23, 2015 at 8:55 PM, Cai Gengyang  wrote:
> So I have gone through the CodeAcademy Python modules and decided to jump 
> straight into a project.
>
> I want to create a dynamic web-based site like this --- 
> https://www.wedpics.com using Python
>
> How / where do I start ?

While it's *possible* to create a web site using just a base Python
install, it's a lot more work than you need. What you should instead
do is pick up one of the popular web frameworks like Django, Flask,
Bottle, etc, and use that. Pick a framework (personally, I use Flask,
but you can use any of them), and work through its tutorial. Then,
depending on how fancy you want your site to be, you'll need anywhere
from basic to advanced knowledge of the web's client-side technologies
- HTML, CSS, JavaScript, and possibly some libraries like Bootstrap,
jQuery, etc. Again, pick up any that you want to use, and work through
their tutorials.

This is a massively open-ended goal. You can make this as big or small
as you want.

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: What is a function parameter =[] for?

2015-11-23 Thread Marko Rauhamaa
BartC :

> I think I'm done here.

Bart, this is the internet. Just skip the articles you don't find
uplifting.


Marko
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue25455] Some repr implementations don't check for self-referential structures

2015-11-23 Thread Eli Bendersky

Changes by Eli Bendersky :


--
nosy:  -eli.bendersky

___
Python tracker 

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



[issue25705] Fix regex_compile benchmark crash

2015-11-23 Thread Florin Papa

New submission from Florin Papa:

Hi all,

This is Florin Papa from the Server Languages Optimizations Team at Intel 
Corporation.

The patch submitted here solves a crash occurring on Python 2.7 and 3.6 when 
running the regex_compile benchmark. The clear_cache() call was replaced with 
re.purge().

To apply the patch please follow these steps:

hg clone https://hg.python.org/benchmarks
cd benchmarks/
copy fix_regex_compile.patch to the current directory
hg import --no-commit fix_regex_compile.patch

Thank you,
Florin Papa

--
components: Benchmarks
files: fix_regex_compile.patch
keywords: patch
messages: 255152
nosy: brett.cannon, florin.papa, pitrou
priority: normal
severity: normal
status: open
title: Fix regex_compile benchmark crash
type: crash
versions: Python 2.7, Python 3.6
Added file: http://bugs.python.org/file41136/fix_regex_compile.patch

___
Python tracker 

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



Re: pip does not work anymore

2015-11-23 Thread Steven D'Aprano
On Mon, 23 Nov 2015 06:48 pm, Cecil Westerhof wrote:

> When I try to install something with pip2 I get:
> Traceback (most recent call last):
[...]
> from urllib2 import (Request, urlopen, URLError, HTTPError,
> ImportError: cannot import name HTTPSHandler

Before blaming SUSE for breaking this, please run this at the interactive
interpreter:

import urllib2
print urllib2.__file__


Have you perhaps accidentally shadowed the std lib module?



-- 
Steven

-- 
https://mail.python.org/mailman/listinfo/python-list


[issue25669] unittest.assertEqual() on un-equal types inheriting from collections.Mapping

2015-11-23 Thread Michael Foord

Michael Foord added the comment:

assertEqual *does* do type checking and it's strict that it will only resort to 
the "type specific" assert checks if both types are of the same type. In the 
general case it's impossible to know whether comparing a subclass with the type 
specific check is the right thing to do - so unittest doesn't guess.

As you have a simple workaround ( dict(foo) ) I'm closing this.

--
resolution:  -> rejected
status: open -> closed

___
Python tracker 

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



[issue25704] Update the documentation to 3.5

2015-11-23 Thread Stéphane Wirtel

Changes by Stéphane Wirtel :


--
components: Devguide
nosy: ezio.melotti, matrixise, willingc
priority: normal
severity: normal
status: open
title: Update the documentation to 3.5
versions: Python 3.6

___
Python tracker 

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



[issue25704] Update the documentation to 3.5

2015-11-23 Thread Stéphane Wirtel

New submission from Stéphane Wirtel:

In this patch, I have updated the version of Python, from 3.4 to 3.5.
And added Ned Deily in the Release Manager for 3.6.

--
keywords: +patch
Added file: http://bugs.python.org/file41135/issue25704.patch

___
Python tracker 

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



Re: Late-binding of function defaults (was Re: What is a function parameter =[] for?)

2015-11-23 Thread Chris Angelico
On Fri, Nov 20, 2015 at 6:46 AM, Chris Angelico  wrote:
> The expressions would be evaluated as closures, using the same scope
> that the function's own definition used. (This won't keep things alive
> unnecessarily, as the function's body will be nested within that same
> scope anyway.) Bikeshed the syntax all you like, but this would be
> something to point people to: "here's how to get late-binding
> semantics". For the purposes of documentation, the exact text of the
> parameter definition could be retained, and like docstrings, they
> could be discarded in -OO mode.

Just out of interest, I had a shot at implementing this with a
decorator. Here's the code:

# -- cut --

import functools
import time

class lb:
def __repr__(self): return ""

def latearg(f):
tot_args = f.__code__.co_argcount
min_args = tot_args - len(f.__defaults__)
defs = f.__defaults__
# With compiler help, we could get the original text as well as something
# executable that works in the correct scope. Without compiler help, we
# either use a lambda function, or an exec/eval monstrosity that can't use
# the scope of its notional definition (since its *actual* definition will
# be inside this decorator). Instead, just show a fixed bit of text.
f.__defaults__ = tuple(lb() if callable(arg) else arg for arg in defs)
@functools.wraps(f)
def inner(*a,**kw):
if len(a) < min_args: return f(*a, **kw) # Will trigger TypeError
if len(a) < tot_args:
more_args = defs[len(a)-tot_args:]
a += tuple(arg() if callable(arg) else arg for arg in more_args)
return f(*a,**kw)
return inner

def sleeper(tm):
"""An expensive function."""
t = time.monotonic()
time.sleep(tm)
return time.monotonic() - t - tm

seen_args = []
@latearg
def foo(spam, ham=lambda: [], val=lambda: sleeper(0.5)):
print("%s: Ham %X with sleeper %s" % (spam, id(ham), val))
seen_args.append(ham) # Keep all ham objects alive so IDs are unique

@latearg
def x(y=lambda: []):
y.append(1)
return y

print("Starting!")
foo("one-arg 1")
foo("one-arg 2")
foo("two-arg 1", [])
foo("two-arg 2", [])
foo("tri-arg 1", [], 0.0)
foo("tri-arg 2", [], 0.0)
print(x())
print(x())
print(x())
print(x([2]))
print(x([3]))
print(x([4]))
print("Done!")

# -- cut --


This does implement late binding, but:
1) The adornment is the rather verbose "lambda:", where I'd much
rather have something shorter
2) Since there's no way to recognize "the ones that were adorned", the
decorator checks for "anything callable"
3) Keyword args aren't handled - they're passed through as-is (and
keyword-only arg defaults aren't rendered)
4) As commented, the help text can't pick up the text of the function

But it does manage to render args at execution time, and the help()
for the function identifies the individual arguments correctly (thanks
to functools.wraps and the modified defaults - though this
implementation is a little unfriendly, mangling the original function
defaults instead of properly wrapping).

Clock this one up as "useless code that was fun to write".

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue25702] Link Time Optimizations support for GCC and CLANG

2015-11-23 Thread Alecsandru Patrascu

New submission from Alecsandru Patrascu:

Title: Link Time Optimizations support for GCC and CLANG

Hi All,

This is Alecsandru from Server Scripting Languages Optimization team at Intel 
Corporation. I would like to submit a patch that adds support for Link Time 
Optimization (LTO) when using GCC and CLANG to compile CPython2 and CPython3. 
LTO is a compiler assisted optimization technique that is performed by the 
compiler at link time.

Combined with Profile Guided Optimization (PGO), enabled when running "make 
profile-opt", and running the Grand Unified Python Benchmark (GUPB), a speedup 
up to 11%, with a few regressions, was observed comparing with PGO only. 
Compared with a default build, a performance gain as high as 26% was observed 
from PGO+LTO. In addition, we are also seeing 2% boost in throughput rate from 
our OpenStack Swift setup comparing with PGO only. Our GUPB performance 
evaluation was conducted on Intel SkyLake/Broadwell systems running 
CentOS/Ubuntu, with CLANG/LLVM and GCC 4.*/5.*. Our OpenStack Swift performance 
was done on various systems consisting of XEON and Avoton processors.

Steps:
==

1. Get the CPython source codes
hg clone https://hg.python.org/cpython cpython
cd cpython
hg update 2.7 (for CPython2)

2. Build the binary
a) Default:
./configure
make

b) PGO:
./configure
make profile-opt

c) PGO+LTO:
Copy the attached patch files
hg import --no-commit lto-cpython3-v01.patch (for CPython3)
hg import --no-commit lto-cpython2-v01.patch (for CPython2)
./configure
make profile-opt


Hardware and OS Configuration
=
Hardware:   Intel XEON (Broadwell-DE) 8 Cores

BIOS settings:  Intel Turbo Boost Technology: false
Hyper-Threading: false  

OS: Ubuntu 14.04.3 LTS Server

OS configuration:   Address Space Layout Randomization (ASLR) disabled to 
reduce run
to run variation by echo 0 > 
/proc/sys/kernel/randomize_va_space
CPU frequency set fixed at 2.6GHz

GCC version:GCC version 4.9.2

Benchmark:  Grand Unified Python Benchmark from 
https://hg.python.org/benchmarks/


Measurements and Results

A. Repository:
GUPB Benchmark:
hg id :  2979f5ce6a0c tip
hg --debug id -i : 2979f5ce6a0cee994d5485401945d8457bb0afac

CPython3:
hg id : 21a28f6de358
hg id -r 'ancestors(.) and tag()': 374f501f4567 (3.5) v3.5.0
hg --debug id -i : 21a28f6de3582833652c958b8fd6ae8448b61c7c

CPython2:
hg id : a37ea1d56e98 (2.7)
hg id -r 'ancestors(.) and tag()': 15c95b7d81dc (2.7) v2.7.10
hg --debug id -i : a37ea1d56e98eb158750d3e495a5cf524e8c3980


B. Results: 
CPython2 and CPython3 sample results, measured on a Broadwell platform, can be 
viewed in Table 1 and 2. On the first column (Benchmark) you can see the 
benchmark name, on the second (%D) the speedup compared with the default 
version and on the third column (%PGO) the speedup compared with just PGO; a 
higher value is better.

Table 1. CPython2 results:
Benchmark   %D  %PGO

raytrace18  3
chaos   16  5
django_v2   16  6
mako16  6
pathlib 15  3
simple_logging  15  1
slowpickle  15  5
django  14  4
go  14  4
richards13  -1
float   12  4
slowunpickle12  4
etree_process   11  3
fastunpickle11  6
formatted_logging   11  3
nqueens 11  1
regex_compile   11  3
etree_iterparse 10  4
mako_v2 10  3
telco   10  5
pybench 9   1
hexiom2 9   1
html5lib_warmup 9   3
meteor_contest  9   4
pickle_list 9   5
2to38   2
bzr_startup 8   2
chameleon   8   0
etree_generate  8   2
regex_v88   3
silent_logging  8   1
fannkuch7   1
html5lib7   3
json_load   7   -5
tornado_http7   3
call_method_slots   6   3
json_dump_v26   -4
spambayes   6   2
unpickle_list   6   0
etree_parse 5   3
fastpickle  5   4
rietveld5   1
call_method 4   -1
normal_startup  4   2
startup_nosite  4   2
slowspitfire3   0
ssbench 4   2
call_method_unknown 1   -6
json_dump   1   -4
nbody   1   1
pidigits1   -10
pickle_dict 0   -1
regex_effbot0   -2
spectral_norm   0   -3
call_simple -3  -3

[issue25646] Distutils and Windows SDK 7.1

2015-11-23 Thread JGoutin

JGoutin added the comment:

OK, I'll look that.

--
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



[issue25703] test_sys is failed if standard stream is redirected in 2.7

2015-11-23 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

When stdout or stderr (but not both) are redirected and PYTHONIOENCODING is not 
set, test_sys is failed in 2.7.

==
FAIL: test_43581 (test.test_sys.SysModuleTest)
--
Traceback (most recent call last):
  File "/home/serhiy/py/cpython2.7-debug/Lib/test/test_sys.py", line 415, in 
test_43581
self.assertTrue(sys.__stdout__.encoding == sys.__stderr__.encoding)
AssertionError: False is not true

--

Can be reproduced by one of following commands:

$ ./python -m test.regrtest -v test_sys | cat
$ ./python -m test.regrtest -v test_sys 2>/dev/null

Proposed patch fixes the test.

--
assignee: serhiy.storchaka
components: Tests
files: test_sys_test_43581.patch
keywords: patch
messages: 255142
nosy: serhiy.storchaka
priority: normal
severity: normal
stage: patch review
status: open
title: test_sys is failed if standard stream is redirected in 2.7
type: behavior
versions: Python 2.7
Added file: http://bugs.python.org/file41132/test_sys_test_43581.patch

___
Python tracker 

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



Re: pip does not work anymore

2015-11-23 Thread Cecil Westerhof
On Monday 23 Nov 2015 09:11 CET, Laura Creighton wrote:

> In a message of Mon, 23 Nov 2015 08:48:54 +0100, Cecil Westerhof
> writes:
>> When I try to install something with pip2 I get: Traceback (most
>> recent call last): File "/usr/bin/pip2", line 9, in 
>> load_entry_point('pip==7.1.2', 'console_scripts', 'pip2')() File
>> "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line
>> 558, in load_entry_point return
>> get_distribution(dist).load_entry_point(group, name) File
>> "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line
>> 2682, in load_entry_point return ep.load() File
>> "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line
>> 2355, in load return self.resolve() File
>> "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line
>> 2361, in resolve module = __import__(self.module_name,
>> fromlist=['__name__'], level=0) File
>> "/usr/lib/python2.7/site-packages/pip/__init__.py", line 15, in
>>  from pip.vcs import git, mercurial, subversion, bazaar #
>> noqa File "/usr/lib/python2.7/site-packages/pip/vcs/subversion.py",
>> line 9, in  from pip.index import Link File
>> "/usr/lib/python2.7/site-packages/pip/index.py", line 30, in
>>  from pip.wheel import Wheel, wheel_ext File
>> "/usr/lib/python2.7/site-packages/pip/wheel.py", line 35, in
>>  from pip._vendor.distlib.scripts import ScriptMaker File
>> "/usr/lib/python2.7/site-packages/pip/_vendor/distlib/scripts.py",
>> line 14, in  from .compat import sysconfig,
>> detect_encoding, ZipFile File
>> "/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.py",
>> line 31, in  from urllib2 import (Request, urlopen,
>> URLError, HTTPError, ImportError: cannot import name HTTPSHandler
>>
>> With pip3 I get the same problem.
>>
>> It looks like openSUSE has done an upgrade in which it disabled
>> ssl2. How can I get pip2/3 working again?
>>
>
> Reading
> https://forums.opensuse.org/showthread.php/488962-OpenSuse-python-amp-openssl
> seems to indicatew that you are supposed to use python-pip and not
> pip for OpenSuse, but I don't have one, so that is just my
> interpretation.

python-pip is the package that you need to install to use pip2. I
removed it and then pip2 does not exist anymore. I reinstalled it, but
keep getting the same error. It looks like I need to install:

https://docs.python.org/2/library/urllib2.html?highlight=urllib2#urllib2.HTTPSHandler
but I need pip2 to do that. So I need a working pip2 to get it
working. :'-(


By the way openSUSE did a big update and broke other things also. For
example virtualbox. Probably time to really leave openSUSE for Debian.
But that will not be painless.

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue25698] test regressions introduced with the fix for #22995

2015-11-23 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

This can be related to issue25083. Can you look at the size of copy_reg.pyc and 
copy_reg.pyo files?

--

___
Python tracker 

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



[issue25702] Link Time Optimizations support for GCC and CLANG

2015-11-23 Thread Alecsandru Patrascu

Changes by Alecsandru Patrascu :


Added file: http://bugs.python.org/file41131/lto-cpython3-v01.patch

___
Python tracker 

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



[issue25702] Link Time Optimizations support for GCC and CLANG

2015-11-23 Thread Alecsandru Patrascu

Changes by Alecsandru Patrascu :


--
keywords: +patch
Added file: http://bugs.python.org/file41130/lto-cpython2-v01.patch

___
Python tracker 

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



[issue7990] xml.etree.cElementTree lacks full dir() on Element

2015-11-23 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
assignee:  -> serhiy.storchaka

___
Python tracker 

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



[issue7990] xml.etree.cElementTree lacks full dir() on Element

2015-11-23 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Here is a patch updated to 3.6.

--
nosy: +serhiy.storchaka
versions: +Python 3.6 -Python 3.3, Python 3.4
Added file: http://bugs.python.org/file41133/etree_attributes.patch

___
Python tracker 

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



[issue25706] problems in library/base64.rst

2015-11-23 Thread hiroaki itoh

New submission from hiroaki itoh:

* default of ignorechars for a85decode
b' tnrv' should be b' \t\n\r\v'
* explanation of newline for a85encode
"newline('n')" should be "newline('\n')"

--
assignee: docs@python
components: Documentation
messages: 255155
nosy: docs@python, xwhhsprings
priority: normal
severity: normal
status: open
title: problems in library/base64.rst
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



How to remember last position and size (geometry) of PyQt application?

2015-11-23 Thread Santosh Kumar
Hello all fellow Python programmers!

I am using PyQt5 (5.5.1) with Python 3.4.0 (64-bit) on Windows 8.1
64-bit. I don't think this much data was needed. :P

I am having trouble restoring the position and size (geometry) of my
very simple PyQt app.

What I read online is that this is the default behavior and we need to
use QSettings to save and retrieve settings from Windows registry,
which is stored in
`\\HKEY_CURRENT_USER\Software\[CompanyName]\[AppName]\`.

Here are some of the links are read:
http://doc.qt.io/qt-5.5/restoring-geometry.html
http://doc.qt.io/qt-5.5/qwidget.html#saveGeometry
http://doc.qt.io/qt-5.5/qsettings.html#restoring-the-state-of-a-gui-application
and the last one:
https://ic3man5.wordpress.com/2013/01/26/save-qt-window-size-and-state-on-closeopen/

I could have followed those tutorials but those tutorials/docs were
written for C++ users.

C++ is not my glass of beer. Should I expect help from you guys? :)

Here is minimal working application:


import sys
from PyQt5.QtWidgets import QApplication, QWidget

class sViewer(QWidget):
"""Main class of sViewer"""
def __init__(self):
super(sViewer, self).__init__()
self.initUI()


def initUI(self):
self.show()

if __name__ == '__main__':
app = QApplication(sys.argv)
view = sViewer()
sys.exit(app.exec_())
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue25706] problems in library/base64.rst

2015-11-23 Thread Stéphane Wirtel

Stéphane Wirtel added the comment:

Who can explain the problem ? I am ignorant about this issue.

--
nosy: +matrixise

___
Python tracker 

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



Re: What is a function parameter =[] for?

2015-11-23 Thread Steven D'Aprano
On Mon, 23 Nov 2015 09:40 pm, BartC wrote:

> On 23/11/2015 07:47, Steven D'Aprano wrote:
> 
>> I think it would be cleaner and better if Python had dedicated syntax for
>> declaring static local variables:
> 
> Interesting. So why is it that when /I/ said:
> 
>  > On Mon, 23 Nov 2015 12:21 am, BartC wrote:
>  >
>  >> But if it's used for static storage, then why not just use static
>  >> storage?
> 
> You replied with the insulting:
> 
>  > /head-desk
> 
> ?
> 
> Maybe it's my turn to bang my head on the desk.

Let me steal^W borrow an idea from Galileo, and present the explanation in
the form of a dialogue between two philosophers of computer science,
Salviati and Simplicio, and a third, intelligent layman, Sagredo.

https://en.wikipedia.org/wiki/Dialogue_Concerning_the_Two_Chief_World_Systems


Salviati: Function defaults can also be used for static storage.

Simplicio: If you want static storage, why not use static storage?

Salviati: Function defaults in Python *are* static storage.

Although they not the only way to get static storage, as closures can
also be used for that purpose, they are surely the simplest way to get
static storage in Python.

Sagredo: Simplest though it might be, surely a reasonable person would
consider that using function parameters for static storage is abuse of the
feature and a global variable would be better?

Salviati: Global variables have serious disadvantages. I will agree that
using function parameters for static storage is something of a code smell,
but good enough for rough and ready code. Nevertheless, it would be good if
Python had dedicated syntax for static storage.

Simplicio: Ah-ha! Gotcha!

Salviati: No, perhaps you missed that I was referring to a hypothetical
future addition to Python, not a current feature. But even if it did exist
today, your statement misses the point that by using function defaults I
*am* using static storage. In effect, you are telling me that rather than
using static storage I should instead use static storage.




-- 
Steven

-- 
https://mail.python.org/mailman/listinfo/python-list


[issue23914] pickle fails with SystemError

2015-11-23 Thread Roundup Robot

Roundup Robot added the comment:

New changeset bac3f63ea747 by Serhiy Storchaka in branch '3.4':
Issue #23914: Fixed SystemError raised by unpickler on broken pickle data.
https://hg.python.org/cpython/rev/bac3f63ea747

New changeset 531e2674f003 by Serhiy Storchaka in branch '3.5':
Issue #23914: Fixed SystemError raised by unpickler on broken pickle data.
https://hg.python.org/cpython/rev/531e2674f003

New changeset b08c3a733fda by Serhiy Storchaka in branch 'default':
Issue #23914: Fixed SystemError raised by unpickler on broken pickle data.
https://hg.python.org/cpython/rev/b08c3a733fda

New changeset 686fa9439d38 by Serhiy Storchaka in branch '2.7':
Issue #23914: Fixed SystemError raised by unpickler on broken pickle data.
https://hg.python.org/cpython/rev/686fa9439d38

--
nosy: +python-dev

___
Python tracker 

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



Re: Creating a Dynamic Website Using Python

2015-11-23 Thread Cai Gengyang
Ok, I will look through the Flask tutorials then ...


On Monday, November 23, 2015 at 8:21:28 PM UTC+8, Chris Angelico wrote:
> On Mon, Nov 23, 2015 at 8:55 PM, Cai Gengyang  wrote:
> > So I have gone through the CodeAcademy Python modules and decided to jump 
> > straight into a project.
> >
> > I want to create a dynamic web-based site like this --- 
> > https://www.wedpics.com using Python
> >
> > How / where do I start ?
> 
> While it's *possible* to create a web site using just a base Python
> install, it's a lot more work than you need. What you should instead
> do is pick up one of the popular web frameworks like Django, Flask,
> Bottle, etc, and use that. Pick a framework (personally, I use Flask,
> but you can use any of them), and work through its tutorial. Then,
> depending on how fancy you want your site to be, you'll need anywhere
> from basic to advanced knowledge of the web's client-side technologies
> - HTML, CSS, JavaScript, and possibly some libraries like Bootstrap,
> jQuery, etc. Again, pick up any that you want to use, and work through
> their tutorials.
> 
> This is a massively open-ended goal. You can make this as big or small
> as you want.
> 
> ChrisA

-- 
https://mail.python.org/mailman/listinfo/python-list


[issue25706] problems in library/base64.rst

2015-11-23 Thread hiroaki itoh

Changes by hiroaki itoh :


--
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



[issue25706] problems in library/base64.rst

2015-11-23 Thread hiroaki itoh

Changes by hiroaki itoh :


--
versions: +Python 3.6

___
Python tracker 

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



ANN: pandas v0.17.1 Released

2015-11-23 Thread Jeff Reback
Hi,

We are proud to announce that *pandas* has become a sponsored project of
the NUMFocus organization

This will help ensure the success of development of *pandas* as a
world-class open-source project.

This is a minor bug-fix release from 0.17.0 and includes a large number of
bug fixes along several new features, enhancements, and performance
improvements.
We recommend that all users upgrade to this version.

This was a release of 5 weeks with 176 commits by 61 authors encompassing
84 issues and 128 pull-requests.


*What is it:*

*pandas* is a Python package providing fast, flexible, and expressive data
structures designed to make working with “relational” or “labeled” data both
easy and intuitive. It aims to be the fundamental high-level building block
for
doing practical, real world data analysis in Python. Additionally, it has
the
broader goal of becoming the most powerful and flexible open source data
analysis / manipulation tool available in any language.

*Highlights*:


   - Support for Conditional HTML Formatting, see here
   

   - Releasing the GIL on the csv reader & other ops, see here
   

   - Fixed regression in DataFrame.drop_duplicates from 0.16.2, causing
   incorrect results on integer values see Issue 11376


See the Whatsnew
 for
much more information and the full Documentation
 link.

*How to get it:*

Source tarballs, windows wheels, and macosx wheels are available on PyPI


Installation via conda is:

   - conda install pandas

windows wheels are courtesy of  Christoph Gohlke and are built on Numpy 1.9
macosx wheels are courtesy of Matthew Brett

*Issues:*

Please report any issues on our issue tracker
:

Jeff

*Thanks to all of the contributors*
































































* - Aleksandr Drozd - Alex Chase - Anthonios Partheniou - BrenBarn - Brian
J. McGuirk - Chris - Christian Berendt - Christian Perez - Cody Piersall -
Data & Code Expert Experimenting with Code on Data - DrIrv - Evan Wright -
Guillaume Gay - Hamed Saljooghinejad - Iblis Lin - Jake VanderPlas - Jan
Schulz - Jean-Mathieu Deschenes - Jeff Reback - Jimmy Callin - Joris Van
den Bossche - K.-Michael Aye - Ka Wo Chen - Loïc Séguin-C - Luo Yicheng -
Magnus Jöud - Manuel Leonhardt - Matthew Gilbert - Maximilian Roos -
Michael - Nicholas Stahl - Nicolas Bonnotte - Pastafarianist - Petra Chong
- Phil Schaf - Philipp A - Rob deCarvalho - Roman Khomenko - Rémy Léone -
Sebastian Bank - Thierry Moisan - Tom Augspurger - Tux1 - Varun - Wieland
Hoffmann - Winterflower - Yoav Ram - Younggun Kim - Zeke - ajcr - azuranski
- behzad nouri - cel4 - emilydolson - hironow - lexual - ll - rockg
- silentquasar - sinhrks - taeold *
-- 
https://mail.python.org/mailman/listinfo/python-announce-list

Support the Python Software Foundation:
http://www.python.org/psf/donations/


[RELEASED] Python 3.5.1rc1 is now available

2015-11-23 Thread Larry Hastings


On behalf of the Python development community and the Python 3.5 release 
team, I'm pleased to announce the availability of Python 3.5.1rc1.  
Python 3.5.1 will be the first update for Python 3.5.  Python 3.5 is the 
newest version of the Python language, and it contains many exciting new 
features and optimizations.



You can see what's changed in Python 3.5.1rc1 (as compared to 3.5.0) here:

   https://docs.python.org/3.5/whatsnew/changelog.html


And you can download Python 3.5.1 here:

   https://www.python.org/downloads/release/python-351rc1/

Windows and Mac users: please read the important platform-specific 
"Notes on this release" section near the end of that page.




We hope you enjoy Python 3.5.1!


//arry/
--
https://mail.python.org/mailman/listinfo/python-announce-list

   Support the Python Software Foundation:
   http://www.python.org/psf/donations/


[issue25706] problems in library/base64.rst

2015-11-23 Thread hiroaki itoh

hiroaki itoh added the comment:

maybe this is Sphinx bug.
rst has no problem.

--

___
Python tracker 

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



[RELASE] Python 2.7.11 release candidate 1

2015-11-23 Thread Benjamin Peterson
Greetings,
It is my duty and honor to announce the immediate availability of Python
2.7.11 release candidate 1. Python 2.7.11 will be another bug fix
release for the 2.7.x series.

Downloads are at:

https://www.python.org/downloads/release/python-2711rc1/

Please test the candidate and report bugs to

   https://bugs.python.org

If no serious problems are found, 2.7.11 final will be released in two
weeks.

Regards,
Benjamin Peterson
(on behalf of Python 2.7.11's contributors)
-- 
https://mail.python.org/mailman/listinfo/python-announce-list

Support the Python Software Foundation:
http://www.python.org/psf/donations/


[issue25688] File leak in ElementTree.iterparse()

2015-11-23 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 6e23777948f3 by Serhiy Storchaka in branch '3.4':
Issue #25688: Fixed file leak in ElementTree.iterparse() raising an error.
https://hg.python.org/cpython/rev/6e23777948f3

New changeset 267d04459ba3 by Serhiy Storchaka in branch '3.5':
Issue #25688: Fixed file leak in ElementTree.iterparse() raising an error.
https://hg.python.org/cpython/rev/267d04459ba3

New changeset d841205776fe by Serhiy Storchaka in branch 'default':
Issue #25688: Fixed file leak in ElementTree.iterparse() raising an error.
https://hg.python.org/cpython/rev/d841205776fe

New changeset 09a8ac75b351 by Serhiy Storchaka in branch '2.7':
Issue #25688: Fixed file leak in ElementTree.iterparse() raising an error.
https://hg.python.org/cpython/rev/09a8ac75b351

--
nosy: +python-dev

___
Python tracker 

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



[issue25706] problems in library/base64.rst

2015-11-23 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
assignee: docs@python -> serhiy.storchaka
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue25688] File leak in ElementTree.iterparse()

2015-11-23 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Thank you for your review Martin. Opened issue25707 for adding the close method.

--
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



[issue25707] Add the close method for ElementTree.iterparse() object

2015-11-23 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

If ElementTree.iterparse() is called with file names, it opens a file. When 
resulting iterator is not exhausted, the file lefts not closed.

>>> import xml.etree.ElementTree as ET
>>> import gc
>>> ET.iterparse('/dev/null')

>>> gc.collect()
__main__:1: ResourceWarning: unclosed file <_io.BufferedReader name='/dev/null'>
34

Martin Panter proposed in issue25688 to add an explicit way to clean it up, 
like a generator.close() method.

--
assignee: serhiy.storchaka
components: Library (Lib)
messages: 255159
nosy: serhiy.storchaka
priority: normal
severity: normal
stage: needs patch
status: open
title: Add the close method for ElementTree.iterparse() object
type: resource usage
versions: Python 3.6

___
Python tracker 

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



[issue4744] asynchat documentation needs to be more precise

2015-11-23 Thread Stéphane Wirtel

Stéphane Wirtel added the comment:

Hi Martin,

About the patch of Nikita, I am going to rewrite it asap.

Will you have time to check it ?

Thanks
-- 
Stéphane Wirtel - http://wirtel.be - @matrixise

--

___
Python tracker 

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



[issue25706] problems in library/base64.rst

2015-11-23 Thread hiroaki itoh

hiroaki itoh added the comment:

Should be escape by '\\t\\b...' in rst?

--

___
Python tracker 

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



[issue25706] problems in library/base64.rst

2015-11-23 Thread hiroaki itoh

hiroaki itoh added the comment:

escape*d*

--

___
Python tracker 

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



[issue25707] Add the close method for ElementTree.iterparse() object

2015-11-23 Thread Emanuel Barry

Emanuel Barry added the comment:

I am unable to reproduce the issue on Windows 7 with 3.5.0; I have tried 
opening a small (non-empty) text. Here's the result:


>>> import xml.etree.ElementTree as ET
>>> import gc
>>> ET.iterparse("E:/New.txt")

>>> gc.collect()
59

--
nosy: +ebarry

___
Python tracker 

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



[issue25704] Update the devguide to 3.5

2015-11-23 Thread Zachary Ware

Changes by Zachary Ware :


--
title: Update the documentation to 3.5 -> Update the devguide to 3.5

___
Python tracker 

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



[issue25702] Link Time Optimizations support for GCC and CLANG

2015-11-23 Thread Alecsandru Patrascu

Changes by Alecsandru Patrascu :


Added file: http://bugs.python.org/file41138/lto-cpython3-v02.patch

___
Python tracker 

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



[issue25702] Link Time Optimizations support for GCC and CLANG

2015-11-23 Thread Alecsandru Patrascu

Alecsandru Patrascu added the comment:

Meanwhile I've added the patches (v02) for LTO enabled only if the "./configure 
--with-lto" command is issued.

--

___
Python tracker 

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



[issue25702] Link Time Optimizations support for GCC and CLANG

2015-11-23 Thread Alecsandru Patrascu

Changes by Alecsandru Patrascu :


Added file: http://bugs.python.org/file41137/lto-cpython2-v02.patch

___
Python tracker 

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



[issue25706] problems in library/base64.rst

2015-11-23 Thread Roundup Robot

Roundup Robot added the comment:

New changeset a33d76465a18 by Serhiy Storchaka in branch '3.4':
Issue #25706: Fixed markup in the documentation.
https://hg.python.org/cpython/rev/a33d76465a18

New changeset f4918e98d085 by Serhiy Storchaka in branch '3.5':
Issue #25706: Fixed markup in the documentation.
https://hg.python.org/cpython/rev/f4918e98d085

New changeset ebec1a98ab81 by Serhiy Storchaka in branch 'default':
Issue #25706: Fixed markup in the documentation.
https://hg.python.org/cpython/rev/ebec1a98ab81

--
nosy: +python-dev

___
Python tracker 

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



[issue25702] Link Time Optimizations support for GCC and CLANG

2015-11-23 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Le 23/11/2015 13:18, Alecsandru Patrascu a écrit :
> 
> Do you see it as an configure option (using, for example, an
> explicit --with-lto flag) rather than using it automatically?

That would be nice. This way people can easily test different
combinations of flags.

--

___
Python tracker 

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



[issue25702] Link Time Optimizations support for GCC and CLANG

2015-11-23 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Le 23/11/2015 15:44, Alecsandru Patrascu a écrit :
> 
> Meanwhile I've added the patches (v02) for LTO enabled only if the 
> "./configure --with-lto" command is issued.

Cool, thanks!

--

___
Python tracker 

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



Re: Bi-directional sub-process communication

2015-11-23 Thread Israel Brewster
On Nov 23, 2015, at 12:45 PM, Cameron Simpson  wrote:
> 
> On 23Nov2015 12:22, Israel Brewster  wrote:
>> On Nov 23, 2015, at 11:51 AM, Ian Kelly  wrote:
>>> Concurrency, ugh.
> 
> I'm a big concurrency fan myself.
> 
>>> It's probably better just to have a Condition/Event per thread and
>>> have the response thread identify the correct one to notify, rather
>>> than just notify a single shared Condition and hope the threads wake
>>> up in the right order.
>> 
>> Tell me about it :-) I've actually never worked with conditions or 
>> notifications (actually even this bi-drectional type of communication is new 
>> to me), so I'll have to look into that and figure it out. Thanks for the 
>> information!
> 
> I include a tag with every request, and have the responses include the tag; 
> the request submission function records the response hander in a mapping by 
> tag and the response handing thread looks up the mapping and passes the 
> response to the right handler.
> 
> Works just fine and avoids all the worrying about ordering etc.
> 
> Israel, do you have control over the protocol between you and your 
> subprocess?  If so, adding tags is easy and effective.

I do, and the basic concept makes sense. The one difficulty I am seeing is 
getting back to the thread that requested the data.  Let me know if this makes 
sense or I am thinking about it wrong:

- When a thread requests some data, it sends the request as a dictionary 
containing a tag (unique to the thread) as well as the request
- When the child processes the request, it encodes the response as a dictionary 
containing the tag and the response data
- A single, separate thread on the "master" side parses out responses as they 
come in and puts them into a dictionary keyed by tag
- The requesting threads, after putting the request into the Queue, would then 
block waiting for data to appear under their key in the dictionary

Of course, that last step could be interesting - implementing the block in such 
a way as to not tie up the processor, while still getting the data "as soon" as 
it is available. Unless there is some sort of built-in notification system I 
could use for that? I.e. the thread would "subscribe" to a notification based 
on its tag, and then wait for notification. When the master processing thread 
receives data with said tag, it adds it to the dictionary and "publishes" a 
notification to that tag. Or perhaps the notification itself could contain the 
payload? 

Thanks for the information!

> 
> Cheers,
> Cameron Simpson 

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Bi-directional sub-process communication

2015-11-23 Thread Chris Kaynor
On Mon, Nov 23, 2015 at 2:18 PM, Israel Brewster 
wrote:

> Of course, that last step could be interesting - implementing the block in
> such a way as to not tie up the processor, while still getting the data "as
> soon" as it is available. Unless there is some sort of built-in
> notification system I could use for that? I.e. the thread would "subscribe"
> to a notification based on its tag, and then wait for notification. When
> the master processing thread receives data with said tag, it adds it to the
> dictionary and "publishes" a notification to that tag. Or perhaps the
> notification itself could contain the payload?


There are a few ways I could see handling this, without having the threads
spinning and consuming CPU:

   1. Don't worry about having the follow-up code run in the same thread,
   and use a simple callback. This callback could be dispatched to a thread
   via a work queue, however you may not get the same thread as the one that
   made the request. This is probably the most efficient method to use, as the
   threads can continue doing other work while waiting for a reply, rather
   than blocking. It does make it harder to maintain state between the pre-
   and post-request functions, however.
   2. Have a single, global, event variable that wakes all threads waiting
   on a reply, each of which then checks to see if the reply is for it, or
   goes back to sleep. This is good if most of the time, only a few threads
   will be waiting for a reply, and checking if the correct reply came in is
   cheap. This is probably good enough, unless you have a LOT of threads
   (hundreds).
   3. Have an event per thread. This will use less CPU than the second
   option, however does require more memory and OS resources, and so will not
   be viable for huge numbers of threads, though if you hit the limit, you are
   probably using threads wrong.
   4. Have an event per request. This is only better than #3 if a single
   thread may make multiple requests at once, and can do useful work when any
   of them get a reply back (if they need all, it will make no difference).

Generally, I would use option #1 or #2. Option 2 has the advantage of
making it easy to write the functions that use the functionality, while
option 1 will generally use fewer resources, and allows threads to continue
to be used while waiting for replies. How much of a benefit that is depends
on exactly what you are doing.

Option #4 would probably be better implemented using option #1 in all cases
to avoid problems with running out of OS memory - threading features
generally require more limited OS resources than memory. Option #3 will
also often run into the same issues as option #4 in the cases it will
provide any benefit over option #2.

Chris
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue25716] typeobject.c call_method & call_maybe can leak references on 'func'

2015-11-23 Thread Myron Walker

New submission from Myron Walker:

The 'call_method' and 'call_maybe' function in typeobject.c are leaking
a reference on 'func' in cases where 'args == NULL'.  In this case both 
of these functions exit like so:

if (args == NULL)
return NULL;

When they need to do:

if (args == NULL)
{
Py_DECREF(func);
return NULL;
}

--
components: Interpreter Core
messages: 255235
nosy: Myron Walker
priority: normal
severity: normal
status: open
title: typeobject.c call_method & call_maybe can leak references on 'func'
type: resource usage
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



[issue25709] Problem with string concatenation and utf-8 cache.

2015-11-23 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

In updated patch fixed a bug found by Victor and addressed other his comments. 
Many thanks Victor!

--
Added file: http://bugs.python.org/file41142/issue25709_3.patch

___
Python tracker 

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



[issue25716] typeobject.c call_method & call_maybe can leak references on 'func'

2015-11-23 Thread Myron Walker

Changes by Myron Walker :


--
versions: +Python 3.2, Python 3.3, Python 3.4, Python 3.5, Python 3.6

___
Python tracker 

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



Re: Bi-directional sub-process communication

2015-11-23 Thread Israel Brewster
On Nov 23, 2015, at 1:43 PM, Chris Kaynor  wrote:
> 
> On Mon, Nov 23, 2015 at 2:18 PM, Israel Brewster 
> wrote:
> 
>> Of course, that last step could be interesting - implementing the block in
>> such a way as to not tie up the processor, while still getting the data "as
>> soon" as it is available. Unless there is some sort of built-in
>> notification system I could use for that? I.e. the thread would "subscribe"
>> to a notification based on its tag, and then wait for notification. When
>> the master processing thread receives data with said tag, it adds it to the
>> dictionary and "publishes" a notification to that tag. Or perhaps the
>> notification itself could contain the payload?
> 
> 
> There are a few ways I could see handling this, without having the threads
> spinning and consuming CPU:
> 
>   1. Don't worry about having the follow-up code run in the same thread,
>   and use a simple callback. This callback could be dispatched to a thread
>   via a work queue, however you may not get the same thread as the one that
>   made the request. This is probably the most efficient method to use, as the
>   threads can continue doing other work while waiting for a reply, rather
>   than blocking. It does make it harder to maintain state between the pre-
>   and post-request functions, however.
>   2. Have a single, global, event variable that wakes all threads waiting
>   on a reply, each of which then checks to see if the reply is for it, or
>   goes back to sleep. This is good if most of the time, only a few threads
>   will be waiting for a reply, and checking if the correct reply came in is
>   cheap. This is probably good enough, unless you have a LOT of threads
>   (hundreds).
>   3. Have an event per thread. This will use less CPU than the second
>   option, however does require more memory and OS resources, and so will not
>   be viable for huge numbers of threads, though if you hit the limit, you are
>   probably using threads wrong.
>   4. Have an event per request. This is only better than #3 if a single
>   thread may make multiple requests at once, and can do useful work when any
>   of them get a reply back (if they need all, it will make no difference).
> 
> Generally, I would use option #1 or #2. Option 2 has the advantage of
> making it easy to write the functions that use the functionality, while
> option 1 will generally use fewer resources, and allows threads to continue
> to be used while waiting for replies. How much of a benefit that is depends
> on exactly what you are doing.

While I would agree with #1 in general, the threads, in this case, are CherryPy 
threads, so I need to get the data and return it to the client in the same 
function call, which of course means the thread needs to block until the data 
is ready - it can't return and let the result be processed "later".

Essentially there are times that the web client needs some information that 
only the Child process has. So the web client requests the data from the master 
process, and the master process then turns around and requests the data from 
the child, but it needs to get the data back before it can return it to the web 
client. So it has to block waiting for the data.

Thus we come to option #2 (or 3), which sounds good but I have no clue how to 
implement :-) Maybe something like http://pubsub.sourceforge.net ? I'll dig 
into that.

> 
> Option #4 would probably be better implemented using option #1 in all cases
> to avoid problems with running out of OS memory - threading features
> generally require more limited OS resources than memory. Option #3 will
> also often run into the same issues as option #4 in the cases it will
> provide any benefit over option #2.
> 
> Chris
> -- 
> https://mail.python.org/mailman/listinfo/python-list

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Bi-directional sub-process communication

2015-11-23 Thread Cameron Simpson

On 23Nov2015 12:22, Israel Brewster  wrote:

On Nov 23, 2015, at 11:51 AM, Ian Kelly  wrote:

Concurrency, ugh.


I'm a big concurrency fan myself.


It's probably better just to have a Condition/Event per thread and
have the response thread identify the correct one to notify, rather
than just notify a single shared Condition and hope the threads wake
up in the right order.


Tell me about it :-) I've actually never worked with conditions or 
notifications (actually even this bi-drectional type of communication is new 
to me), so I'll have to look into that and figure it out. Thanks for the 
information!


I include a tag with every request, and have the responses include the tag; the 
request submission function records the response hander in a mapping by tag and 
the response handing thread looks up the mapping and passes the response to the 
right handler.


Works just fine and avoids all the worrying about ordering etc.

Israel, do you have control over the protocol between you and your subprocess?  
If so, adding tags is easy and effective.


Cheers,
Cameron Simpson 
--
https://mail.python.org/mailman/listinfo/python-list


[issue25701] Document that tp_setattro and tp_setattr are used for deleting attributes

2015-11-23 Thread Martin Panter

Martin Panter added the comment:

Here is a patch. The same problem happens with getset descriptors:

>>> del sys.stdout._CHUNK_SIZE
SystemError: null argument to internal routine

So I also changed the documentation for “setter” descriptor functions and the 
tp_descr_set() method.

I only looked at the Python 3 implementation, and I understand Python 2 objects 
work differently in some cases, so I’m not sure if my changes are apropriate 
for Python 2.

--
keywords: +patch
nosy: +martin.panter
stage: needs patch -> patch review
Added file: http://bugs.python.org/file41143/setattr.patch

___
Python tracker 

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



[issue25717] tempfile.TemporaryFile fails when dir option set to directory residing on host OS mount

2015-11-23 Thread Hans Lawrenz

New submission from Hans Lawrenz:

Inside a virtualbox vm, calling tempfile.TemporaryFile(dir=foo) where foo is a 
directory which resides on a volume mounted from the host OS, a 
FileNotFoundError exception is thrown.

In the following code sample, the second block will print "Path 2: ERROR" on 
Python 3.5 but not on 3.4 or 2.7 (assuming the vagrant environment provided 
below):

import tempfile


try:
with tempfile.TemporaryFile() as tf:
tf.write("testing testing testing\n".encode('utf-8'))
print("Path 1: worked")
except FileNotFoundError as e:
print("Path 1: ERROR")

try:
with tempfile.TemporaryFile(dir="/vagrant") as tf:
tf.write("testing testing testing\n".encode('utf-8'))
print("Path 2: worked")
except FileNotFoundError as e:
print("Path 2: ERROR")


A runnable test case can be found here:
https://github.com/hlawrenz/py35tempfiletest

--
components: Library (Lib)
messages: 255246
nosy: Hans Lawrenz
priority: normal
severity: normal
status: open
title: tempfile.TemporaryFile fails when dir option set to directory residing 
on host OS mount
type: behavior
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



Re: tuples in conditional assignment

2015-11-23 Thread Ben Finney
George Trojan  writes:

> The following code has bitten me recently:
>
> >>> t=(0,1)
> >>> x,y=t if t else 8, 9
> >>> print(x, y)
> (0, 1) 9

You can simplify this by taking assignment out of the picture::

>>> t = (0, 1)
>>> t if t else 8, 9
((0, 1), 9)

So that's an “expression list” containing a comma. The reference for
expressions tells us::

An expression list containing at least one comma yields a tuple. The
length of the tuple is the number of expressions in the list.



> I was assuming that a comma has the highest order of evaluation

You were? The operator precedence rules don't even mention comma as an
operator, so why would you assume that?




> that is the expression 8, 9 should make a tuple. Why this is not the
> case?

I'm not sure why it's the case that you assumed that :-)

My practical advice: I don't bother trying to remember the complete
operator precedence rules. My simplified precedence rules are:

* ‘+’, ‘-’ have the same precedence.
* ‘*’, ‘/’, ‘//’ have the same precedence.
* For anything else: Use parentheses to explicitly declare the
  precedence I want.

Related: When an expression has enough clauses that it's not *completely
obvious* what's going on, break it up by assigning some sub-parts to
temporary well-chosen descriptive names (not ‘t’).

-- 
 \ “It is far better to grasp the universe as it really is than to |
  `\persist in delusion, however satisfying and reassuring.” —Carl |
_o__)Sagan |
Ben Finney

-- 
https://mail.python.org/mailman/listinfo/python-list


[issue25717] tempfile.TemporaryFile fails when dir option set to directory residing on host OS mount

2015-11-23 Thread Martin Panter

Martin Panter added the comment:

I am unable to produce this on native Linux so far with various kinds of mount 
points I normally have. What is your guest OS?

If you can provide any more details of the failure, such as a traceback, that 
would be helpful. What is the underlying OS call that is causing the exception?

--
keywords: +3.5regression
nosy: +martin.panter

___
Python tracker 

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



  1   2   >