[issue29165] Use forward compatible macro in example code for creating new type

2017-02-20 Thread INADA Naoki

Changes by INADA Naoki :


--
pull_requests: +179

___
Python tracker 

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



[issue28814] Deprecation notice on inspect.getargvalues() is incorrect

2017-02-20 Thread Berker Peksag

Changes by Berker Peksag :


--
nosy: +berker.peksag
stage: needs patch -> patch review

___
Python tracker 

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



[issue29609] Receiving messages from subprocess does not work on Mac OS X

2017-02-20 Thread Berker Peksag

Berker Peksag added the comment:

Please use Stack Overflow or python-list for usage questions (and please do not 
reopen this issue again)

--
nosy: +berker.peksag
resolution: works for me -> 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



[issue29575] your closing of issue29575

2017-02-20 Thread Joachim

Joachim added the comment:

Dear Davin,

since I am new to the Python bug tracker, I have to asked
a stupid question: are you the benevolent dictator of the
Python Standard Library?

Otherwise, how can it be that one and the same person in
one and the same intervention adds new arguments to the
debate, conclude that theses arguments are winning,
declares that the current state »works for me«, and closes
the issue, thereby cutting short any further debate?

I have several other issues with the current Python
documentation, but if defenders of the status quo are
acting that boldly, I would only waste my time to raise
them.

With best regards, Joachim

--
title: doc 17.2.1: basic Pool example is too basic -> your closing of issue29575

___
Python tracker 

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



[issue10938] Provide links to system specific strftime/ptime docs

2017-02-20 Thread Berker Peksag

Berker Peksag added the comment:

I agree with Jim's review comment at 
https://github.com/python/cpython/pull/155#pullrequestreview-22646534

Those links will quickly get outdated and I'm sure that we will get reports 
like "this link doesn't work for my $PLATFORM $PLATFORM_VERSION".

I suggest to close this as 'rejected'.

--
nosy: +berker.peksag
stage: needs patch -> patch review
versions: +Python 3.6, Python 3.7 -Python 3.4

___
Python tracker 

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



[issue29453] Remove reference to undefined dictionary ordering in Tutorial

2017-02-20 Thread Mariatta Wijaya

Changes by Mariatta Wijaya :


--
pull_requests: +177

___
Python tracker 

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



[issue29532] functools.partial is not compatible between 2.7 and 3.5

2017-02-20 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
pull_requests: +178

___
Python tracker 

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



[issue29453] Remove reference to undefined dictionary ordering in Tutorial

2017-02-20 Thread Mariatta Wijaya

Mariatta Wijaya added the comment:


New changeset 32e8f9bdfd4324f1aa4fbbdf1ed8536f2b00cabb by Mariatta in branch 
'master':
bpo-29453: Remove reference to undefined dictionary ordering in Tutorial 
(GH-140)
https://github.com/python/cpython/commit/32e8f9bdfd4324f1aa4fbbdf1ed8536f2b00cabb


--

___
Python tracker 

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



[issue11572] bring Lib/copy.py to 100% coverage

2017-02-20 Thread Berker Peksag

Changes by Berker Peksag :


--
stage: needs patch -> patch review

___
Python tracker 

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



[issue11572] bring Lib/copy.py to 100% coverage

2017-02-20 Thread Berker Peksag

Changes by Berker Peksag :


--
pull_requests: +176

___
Python tracker 

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



[issue29347] Python could crash while creating weakref for a given object

2017-02-20 Thread Xiang Zhang

Xiang Zhang added the comment:

Thanks for your confirmation Saida! :-)

--

___
Python tracker 

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



[issue29347] Python could crash while creating weakref for a given object

2017-02-20 Thread Saida Dhanavath

Saida Dhanavath added the comment:

Hi Xiang,


Sorry for the delay. I have not checked my inbox since last week. The proposed 
fix works for me.

--

___
Python tracker 

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



[issue29603] More informative Queue class: new method that returns number of unfinished tasks

2017-02-20 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I concur with Raymond.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue27660] Replace size_t with Py_ssize_t as the type of local variable in list_resize

2017-02-20 Thread Raymond Hettinger

Raymond Hettinger added the comment:

Okay, go ahead.  I was hoping to give Mariatta some practice applying C patches 
(she's new).

--

___
Python tracker 

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



[issue29554] profile/pstat doc clariification

2017-02-20 Thread Berker Peksag

Berker Peksag added the comment:


New changeset 8fb1f6e039cbdeb333d83b7a62f0f37af4ce6e02 by Berker Peksag in 
branch 'master':
bpo-29554: Improve docs for pstat module and profile. (#88)
https://github.com/python/cpython/commit/8fb1f6e039cbdeb333d83b7a62f0f37af4ce6e02


--

___
Python tracker 

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



[issue29554] profile/pstat doc clariification

2017-02-20 Thread Berker Peksag

Changes by Berker Peksag :


--
nosy: +berker.peksag
stage:  -> patch review
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



[issue27660] Replace size_t with Py_ssize_t as the type of local variable in list_resize

2017-02-20 Thread Xiang Zhang

Xiang Zhang added the comment:

Sorry, I have the commit bit and know what to do with a commit. So I assign it 
to myself and wait someone approve the PR on GitHub.

--
assignee: Mariatta -> xiang.zhang
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



[issue29610] ssl do_handshake fails on https-proxy (aka. https over https-proxy)

2017-02-20 Thread Martin Panter

Martin Panter added the comment:

It looks like you are trying to tunnel one SSL or TLS connection through 
another SSL/TLS connection (instead of through a plain OS socket). There is 
already a bug recently opened about this: Issue 29394.

Basically, the SSL module doesn’t support this, and the documentation should be 
clarified to say something like wrap_socket() only accepts basic 
socket.socket() objects, not subclasses. However, in Python 3.5+ I think you 
could use the BIO layer to hook in your intermediate SSL socket (or any other 
transport).

--
nosy: +martin.panter
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> Cannot tunnel TLS connection through TLS connection

___
Python tracker 

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



[issue29394] Cannot tunnel TLS connection through TLS connection

2017-02-20 Thread Martin Panter

Changes by Martin Panter :


--
stage:  -> needs patch
versions: +Python 2.7, Python 3.5, Python 3.7

___
Python tracker 

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



[issue29610] ssl do_handshake fails on https-proxy (aka. https over https-proxy)

2017-02-20 Thread Phus Lu

Changes by Phus Lu :


--
assignee:  -> christian.heimes
components: +SSL
nosy: +christian.heimes
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



[issue27660] Replace size_t with Py_ssize_t as the type of local variable in list_resize

2017-02-20 Thread Raymond Hettinger

Raymond Hettinger added the comment:

Mariatta, would you like to run this against the test suite and then apply it.  
I don't think a MISC/NEWS entry is needed (it is just a code simplification) 
and Xiang is already in MISC/ACKS.

--
assignee: rhettinger -> Mariatta
nosy: +Mariatta

___
Python tracker 

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



[issue29609] Receiving messages from subprocess does not work on Mac OS X

2017-02-20 Thread pyguy

pyguy added the comment:

The program does not work the way I wanted it to. I want the output of the top 
command to be seen only by the python program. The program I made causes the 
top command to print its output to the terminal. Using subprocess.Popen() with 
stdout=subprocess.PIPE does prevent the top command's output from being printed 
to the terminal. Now I need a way to actually work with that output. Would you 
know a way to do this?

I can't use the communicate() function because it blocks until the top command 
quits.

--
resolution: not a bug -> works for me
status: closed -> open

___
Python tracker 

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



[issue10701] Error pickling objects with mutating __getstate__

2017-02-20 Thread Raymond Hettinger

Raymond Hettinger added the comment:

I agree with Antoine that, "As the name suggests, __getstate__ should probably 
not mutate anything."

Unless a problematic non-mutating example can be found, I suggest this be 
closed.  For the most part, our rule has been that pure python code doesn't 
have to (and possibly cannot) defend itself against mid-stream mutation, while 
C code only has to defend itself to the point of avoiding a segfault.  

IMO, "RuntimeError: dictionary changed size during iteration" is an informative 
error message in this case.

--
nosy: +rhettinger
status: pending -> open

___
Python tracker 

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



[issue29609] Receiving messages from subprocess does not work on Mac OS X

2017-02-20 Thread Ned Deily

Changes by Ned Deily :


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

___
Python tracker 

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



[issue29603] More informative Queue class: new method that returns number of unfinished tasks

2017-02-20 Thread Raymond Hettinger

Raymond Hettinger added the comment:

> I'm sure that exposing the number of unfinished tasks
> (unfinished_tasks class variable) can be very useful in many situations

Sorry, but I don't share your certainty of the usefulness of this method.  
Since the task_done/join API was added many years ago, I've not seen any use 
cases arise where we needed to quantify the number of unfinished tasks.  Have 
you seen an actual need in real code or is this PR more of an intuitive guess 
that the extra method might be useful?

In the examples of task_done/join that I've seen, the number of unfinished 
tasks is typically in the range: qsize() plus between zero and the number of 
parallel consumers.  Where the actual value it falls this range doesn't seem 
very useful.  One the queue is empty, join() just waits to the parallel 
consumers to complete their one final task that is already under way.

Also, I'm reluctant to expand the API for several reasons.  Keeping it small 
makes it more intelligible (giving users additional options for things theh 
rarely need makes it more difficult to make correct decisions in the common 
cases). Also, it would be nice to avoid a ripple effect into the other APIs 
such as multiprocessing which are supersets of this API. And lastly, I'm 
disinclined to have another informational method like empty, full, and qsize 
which have to be documented as potentially introducing unexpected race 
conditions in user code (all three methods return information that may be 
completely out-of-date or wrong by the time the caller sees the result).

--
assignee:  -> rhettinger

___
Python tracker 

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



[issue27660] Replace size_t with Py_ssize_t as the type of local variable in list_resize

2017-02-20 Thread Xiang Zhang

Xiang Zhang added the comment:

Thanks for your time Raymond. :-) I applied your suggestions in the PR.

--

___
Python tracker 

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



[issue29610] ssl do_handshake fails on https-proxy (aka. https over https-proxy)

2017-02-20 Thread Phus Lu

New submission from Phus Lu:

Background:

I'm working on adding https-proxy[1] support to python-requests 
https://github.com/phuslu/requests_httpsproxy

Issue:
ssl module(python 2.7) counld establish ssl handshakes over a https-proxy

Reproduce Steps:
I setup a https-proxy in bwg.phus.lu:443

>>> import socket,ssl
>>> sock = ssl.wrap_socket(socket.create_connection(('bwg.phus.lu', 443)))
>>> sock.sendall('CONNECT httpbin.org:443 HTTP/1.0\r\n\r\n')
36
>>> sock.recv()
'HTTP/1.1 200 OK\r\n\r\n'
>>> ssl.wrap_socket(sock)
Traceback (most recent call last):
  File "", line 1, in 
ssl.wrap_socket(sock)
  File "/usr/lib/python2.7/ssl.py", line 943, in wrap_socket
ciphers=ciphers)
  File "/usr/lib/python2.7/ssl.py", line 611, in __init__
self.do_handshake()
  File "/usr/lib/python2.7/ssl.py", line 840, in do_handshake
self._sslobj.do_handshake()
SSLError: [SSL: UNKNOWN_ALERT_TYPE] unknown alert type (_ssl.c:661)


[1] https://www.chromium.org/developers/design-documents/secure-web-proxy

--
messages: 288259
nosy: Phus Lu
priority: normal
severity: normal
status: open
title: ssl do_handshake fails on https-proxy (aka. https over https-proxy)
type: behavior
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



[issue29355] sqlite3: remove sqlite3_stmt_readonly()

2017-02-20 Thread Ma Lin

Ma Lin added the comment:

> Is there currently a solution to build Python 3.6 with sqlite3 support?

I installed SQLite 3.16.2 on a Debian-based system with this way:
http://stackoverflow.com/questions/26261080
No idea whether it will work on RHEL 6.

--

___
Python tracker 

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



[issue29609] Receiving messages from subprocess does not work on Mac OS X

2017-02-20 Thread pyguy

pyguy added the comment:

Using communicate fixed the problem. Here is the program that works for me on 
Mac OS 10.4.11 with Python 2.7.12:

import subprocess
import time

print("Launch started")
program_name = "top"
list = [program_name]
process = subprocess.Popen(list)
while process.poll() == None:
print("subprocess still running")
print("Value = " + process.communicate())
time.sleep(0.1)

print("Exit")



Thank you Ned.

--
resolution: works for me -> fixed

___
Python tracker 

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



[issue27660] Replace size_t with Py_ssize_t as the type of local variable in list_resize

2017-02-20 Thread Raymond Hettinger

Raymond Hettinger added the comment:

It was a little mind-numbing to check this code, but it looks correct.

Please fix two nits for better readability.   For review purposes, it was nice 
to have changes stand-out, but for the final code I would like to combine the 
two comments and the two new_allocated assignments into a single comment and 
single assignment:

  /* The growth pattern is:  0, 4, 8, 16, 25, 35, 46, 58, 72, 88, ...
 Note: new_allocated won't overflow because the largest possible value
   is PY_SSIZE_T_MAX * (9 / 8) + 6 which always fits in a size_t.
  */
 new_allocated = (size_t)newsize + (newsize >> 3) + (newsize < 9 ? 3 : 6);

Secondly, please rename the "size" variable to something like 
"num_allocated_bytes".  It is confusing to have "newsize" mean the number of 
elements actually used while having "size" mean the number of bytes actually 
allocated (including the overallocation).

--

___
Python tracker 

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



[issue29581] __init_subclass__ causes TypeError when used with standard library metaclasses (such as ABCMeta)

2017-02-20 Thread Kevin Shweh

Kevin Shweh added the comment:

Doesn't that ignore_extra_args thing prevent InitX.__init_subclass__ from 
receiving the x argument it wanted? It doesn't seem like a solution.

--
nosy: +Kevin Shweh

___
Python tracker 

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



[issue29609] Receiving messages from subprocess does not work on Mac OS X

2017-02-20 Thread Ned Deily

Ned Deily added the comment:

There certainly could be differences in behavior considering how old 10.6.8 and 
10.4.11 are.  I'm not a subprocess expert but it seems to me that, if your 
program hangs doing a readline from process.stdout, chances are you are running 
into a pipe buffer deadlock as warned about in the subprocess module 
documentation:

"Warning - Use communicate() rather than .stdin.write, .stdout.read or 
.stderr.read to avoid deadlocks due to any of the other OS pipe buffers filling 
up and blocking the child process."

https://docs.python.org/dev/library/subprocess.html#popen-objects

--

___
Python tracker 

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



[issue28879] smtplib send_message should add Date header if it is missing, per RFC5322

2017-02-20 Thread R. David Murray

Changes by R. David Murray :


--
stage:  -> patch review

___
Python tracker 

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



[issue29575] doc 17.2.1: basic Pool example is too basic

2017-02-20 Thread Davin Potts

Davin Potts added the comment:

When passing judgement on what is "too basic", the initial example should be so 
basic as to be immediately digestible by as many people as possible.

Some background:
All too many examples mislead newcomers into believing that the number of 
processes should (a) match the number of processor cores, or (b) match the 
number of inputs to be processed.  This example currently attempts to dispel 
both notions.  In practice, and this depends upon what specific code is to be 
performed in parallel, it is not uncommon to find that slightly over-scheduling 
the number of processes versus the number of available cores can achieve 
superior throughput and performance.  In other cases, slightly under-scheduling 
may provide a win.  To help subtly encourage the newcomer, this example uses 5 
processes as opposed to something which might be mistaken for a common number 
of cores available on current multi-core processors.  Likewise, the number of 
distinct inputs to be processed deliberately does not match the number of 
processes nor a multiple of the number of processes.  This hopefully encourages 
the newcomer to not feel obligated to only accept inputs of a particular
  size or multiple.  Granted, optimizing for performance motivates tuning such 
things but this is the first example / first glance at what functionality is 
available.

Considering the suggested change:
* range(20) will likely produce more output than can be comfortably 
accommodated and easily read in the available browser window where most will 
see this
* the addition of execution time measurement is an interesting choice here 
given how computationally trivial the f(x) function is, which is perhaps what 
motivated the introduction of a time.sleep(1) inside that function; a 
ThreadPool would be more appropriate for a sleepy function such as this

Ultimately these changes complicate the example while potentially undermining 
its value.  An interesting improvement to this example might be to introduce a 
computationally taxing function which more clearly demonstrates the benefit of 
using a process Pool but still achieving the ideal of being immediately 
digestible and understood by the largest reading audience.  Some of the 
topics/variations in the proposed change might be better introduced and 
addressed later in the documentation rather than unnecessarily complicating the 
first example.

--
resolution:  -> works for me
stage:  -> resolved
status: open -> closed
type:  -> enhancement

___
Python tracker 

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



[issue29609] Receiving messages from subprocess does not work on Mac OS X

2017-02-20 Thread pyguy

pyguy added the comment:

The program failed for me on Mac OS 10.4.11 using Python 2.7.12 and Mac OS 
10.6.8 using Python 2.7.13.

--
status: pending -> open

___
Python tracker 

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



[issue29609] Receiving messages from subprocess does not work on Mac OS X

2017-02-20 Thread Ned Deily

Ned Deily added the comment:

Sorry, your program works for me on macOS 10.12.3 with the current python.org 
2.7.13, the Apple-supplied system Python 2.7.10, and, with adding a decode to 
the readline, with 3.6.0.

--
resolution:  -> works for me
status: open -> pending

___
Python tracker 

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



[issue29609] Receiving messages from subprocess does not work on Mac OS X

2017-02-20 Thread pyguy

New submission from pyguy:

When I use the subprocess module to run a another process, I expect to be able 
to read the STDOUT and STDERR of the other process. This is not possible on Mac 
OS X. The attached test program has been tested on Linux and Windows and does 
work as expected. It pauses at the process.stdout.readline() line of code every 
time on Mac OS X.

--
components: macOS
files: testwrapper.py
messages: 288250
nosy: ned.deily, pyguy, ronaldoussoren
priority: normal
severity: normal
status: open
title: Receiving messages from subprocess does not work on Mac OS X
type: behavior
versions: Python 2.7, Python 3.5
Added file: http://bugs.python.org/file46656/testwrapper.py

___
Python tracker 

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



[issue29592] abs_paths() in site.py is slow

2017-02-20 Thread Gregory P. Smith

Changes by Gregory P. Smith :


--
nosy: +gregory.p.smith

___
Python tracker 

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



[issue29585] site.py imports relatively large `sysconfig` module.

2017-02-20 Thread Gregory P. Smith

Changes by Gregory P. Smith :


--
nosy: +gregory.p.smith

___
Python tracker 

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



[issue29608] pip_gui

2017-02-20 Thread Ezio Melotti

Changes by Ezio Melotti :


--
pull_requests:  -170

___
Python tracker 

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



[issue29608] pip_gui

2017-02-20 Thread Berker Peksag

Changes by Berker Peksag :


--
type: performance -> 

___
Python tracker 

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



[issue29608] pip_gui

2017-02-20 Thread Berker Peksag

Changes by Berker Peksag :


--
components:  -Tkinter

___
Python tracker 

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



[issue29608] pip_gui

2017-02-20 Thread Berker Peksag

Berker Peksag added the comment:

pip_gui is not part of the Python standard library. Please use 
https://github.com/upendra-k14/pip_gui/issues to report your problem.

--
nosy: +berker.peksag
resolution:  -> third party
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue29355] sqlite3: remove sqlite3_stmt_readonly()

2017-02-20 Thread Carol Willing

Carol Willing added the comment:

Another report of sqlite3 not compiling correctly on RHEL6 
(https://github.com/jupyterhub/jupyterhub/issues/991). Is there currently a 
solution to build Python 3.6 with sqlite3 support?

--
nosy: +willingc

___
Python tracker 

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



[issue29602] complex() on object with __complex__ function loses sign of zero imaginary part

2017-02-20 Thread Mark Dickinson

Mark Dickinson added the comment:

I'm a bit puzzled about where the commit 
4ddd89780fdb823f427c743ea7326a3c958a2f4b came from, but as far as I can tell 
the changes to 2.7, 3.5, 3.6 and master are all okay.

All fixed. Thanks for the report!

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



[issue29602] complex() on object with __complex__ function loses sign of zero imaginary part

2017-02-20 Thread Mark Dickinson

Mark Dickinson added the comment:


New changeset d9b3cdd137239a5913de2252c3ce269e35ac63d2 by GitHub in branch 
'3.6':
bpo-29602: fix signed zero handling in complex constructor. (#203) (#206)
https://github.com/python/cpython/commit/d9b3cdd137239a5913de2252c3ce269e35ac63d2


--

___
Python tracker 

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



[issue29602] complex() on object with __complex__ function loses sign of zero imaginary part

2017-02-20 Thread Mark Dickinson

Mark Dickinson added the comment:


New changeset 0936a00fe035e3e52c30bcbc59668dc0f519ced6 by GitHub in branch 
'3.5':
bpo-29602: fix signed zero handling in complex constructor. (#203) (#205)
https://github.com/python/cpython/commit/0936a00fe035e3e52c30bcbc59668dc0f519ced6


--

___
Python tracker 

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



[issue22273] abort when passing certain structs by value using ctypes

2017-02-20 Thread Vinay Sajip

Vinay Sajip added the comment:

I'm learning a bit about Linux calling conventions :-)

But it also works when a 16-byte array is followed by 2 ints; if the two ints 
are removed, then it fails again.

ctypes sets elements up in the first case to be a FFI_TYPE_POINTER slot 
followed by two slots of FFI_TYPE_SINT32, and classify_argument seemingly does 
the right thing. But remove the two integers, and classify_argument seems to 
not do the right thing. Isn't this looking like a problem in classify_argument? 
In the first case:

p *stgdict->ffi_type_pointer.elements[0]
$3 = {size = 8, alignment = 8, type = 14, elements = 0x0}
p *stgdict->ffi_type_pointer.elements[1]
$4 = {size = 4, alignment = 4, type = 10, elements = 0x0}
p *stgdict->ffi_type_pointer.elements[2]
$5 = {size = 4, alignment = 4, type = 10, elements = 0x0}
p stgdict->ffi_type_pointer.elements[3]
$6 = (struct _ffi_type *) 0x0

and the second case:

p *stgdict->ffi_type_pointer.elements[0]
$2 = {size = 8, alignment = 8, type = 14, elements = 0x0}
p stgdict->ffi_type_pointer.elements[1]
$3 = (struct _ffi_type *) 0x0

It's like this on the way into ffi_call (can't step into it at the moment).

--

___
Python tracker 

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



[issue8525] Display exception's subclasses in help()

2017-02-20 Thread Sanyam Khurana

Sanyam Khurana added the comment:

Hi,

It seems that it hasn't been worked upon from quite a long time and the patch 
would also need changes. May I work on this?

--
nosy: +CuriousLearner

___
Python tracker 

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



[issue29602] complex() on object with __complex__ function loses sign of zero imaginary part

2017-02-20 Thread Mark Dickinson

Mark Dickinson added the comment:


New changeset c0b336e0ada74b1242b9ef10c19eb87b0a21d106 by GitHub in branch 
'2.7':
bpo-29602: fix signed zero handling in complex constructor (#204)
https://github.com/python/cpython/commit/c0b336e0ada74b1242b9ef10c19eb87b0a21d106


--

___
Python tracker 

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



[issue29602] complex() on object with __complex__ function loses sign of zero imaginary part

2017-02-20 Thread Mark Dickinson

Changes by Mark Dickinson :


--
pull_requests: +175

___
Python tracker 

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



[issue29602] complex() on object with __complex__ function loses sign of zero imaginary part

2017-02-20 Thread Mark Dickinson

Changes by Mark Dickinson :


--
pull_requests: +174

___
Python tracker 

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



[issue29602] complex() on object with __complex__ function loses sign of zero imaginary part

2017-02-20 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
pull_requests:  -171

___
Python tracker 

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



[issue22273] abort when passing certain structs by value using ctypes

2017-02-20 Thread Eryk Sun

Eryk Sun added the comment:

I see now why you couldn't find ffi64.c. I've been using a 3.6 worktree. The 
libffi sources have been removed from master.

For the union and bitfield problem, also see the crash reported in #26628.

--

___
Python tracker 

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



[issue29602] complex() on object with __complex__ function loses sign of zero imaginary part

2017-02-20 Thread Mark Dickinson

Changes by Mark Dickinson :


--
pull_requests: +173

___
Python tracker 

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



[issue29549] Improve docstring for str.index

2017-02-20 Thread Mark Dickinson

Changes by Mark Dickinson :


--
pull_requests: +172

___
Python tracker 

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



[issue29602] complex() on object with __complex__ function loses sign of zero imaginary part

2017-02-20 Thread Mark Dickinson

Mark Dickinson added the comment:


New changeset 4ddd89780fdb823f427c743ea7326a3c958a2f4b by Mark Dickinson in 
branch 'bpo-29549-backport':
bpo-29602: fix signed zero handling in complex constructor
https://github.com/python/cpython/commit/4ddd89780fdb823f427c743ea7326a3c958a2f4b


--

___
Python tracker 

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



[issue29602] complex() on object with __complex__ function loses sign of zero imaginary part

2017-02-20 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
pull_requests: +171

___
Python tracker 

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



[issue22273] abort when passing certain structs by value using ctypes

2017-02-20 Thread Eryk Sun

Eryk Sun added the comment:

classify_argument is in Modules/_ctypes/libffi/src/x86/ffi64.c. This file is 
for the 64-bit Unix ABI. libffi doesn't use it for 64-bit Windows. 

Some (all?) Linux distros link ctypes to the system libffi. In my experience, 
building 3.6 on Linux defaults to the system libffi, and I don't personally 
know how to override this. Configuring "--without-system-ffi" seems to be 
ignored.

Regarding your Test struct example, it's ok in this particular case to classify 
an 8-byte integer array the same as an 8-byte pointer. It doesn't abort() 
because the 2nd word isn't left unclassified (i.e. X86_64_NO_CLASS). 

import ctypes

class Test(ctypes.Structure):
_fields_ = (('foo', ctypes.c_int),
('bar', ctypes.c_int),
('data', ctypes.c_uint8 * 8))

@ctypes.CFUNCTYPE(None, Test)
def func(t):
print('foo:', t.foo)
print('bar:', t.bar)
print('data:', t.data[:])

t = Test(5, 10, tuple(range(8)))

>>> hex(id(Test))
'0x9d8ad8'

The ctypes Structure has 3 elements. The first two are ffi_type_sint32 
(FFI_TYPE_SINT32 == 10), and the third is ffi_type_pointer (FFI_TYPE_POINTER == 
14):

(gdb) set $dict = (StgDictObject *)(((PyTypeObject *)0x9d8ad8)->tp_dict)
(gdb) p *$dict->ffi_type_pointer->elements[0]
$1 = {size = 4, alignment = 4, type = 10, elements = 0x0}
(gdb) p *$dict->ffi_type_pointer->elements[1]
$2 = {size = 4, alignment = 4, type = 10, elements = 0x0}
(gdb) p *$dict->ffi_type_pointer->elements[2]
$3 = {size = 8, alignment = 8, type = 14, elements = 0x0}
(gdb) p $dict->ffi_type_pointer->elements[3]
$4 = (struct _ffi_type *) 0x0

classify_argument() recursively classifies and merges these elements. The first 
two get merged as X86_64_INTEGER_CLASS, and the 'pointer' (actually an array) 
is X86_64_INTEGER_CLASS.

>>> func(t)

Breakpoint 1, ffi_call (cif=cif@entry=0x7fffd570, 
fn=fn@entry=0x77fee010,
rvalue=rvalue@entry=0x7fffd630, avalue=avalue@entry=0x7fffd610)
at ../src/x86/ffi64.c:424

[...snip...]

458   for (i = 0; i < avn; ++i)
(gdb) 
462   n = examine_argument (arg_types[i], classes, 0, , );
(gdb) 
463   if (n == 0
(gdb) p n
$6 = 2
(gdb) p ngpr
$7 = 2
(gdb) p classes[0]
$8 = X86_64_INTEGER_CLASS
(gdb) p classes[1]
$9 = X86_64_INTEGER_CLASS

The struct is passed in two general-purpose integer registers, rdi and rsi:

Breakpoint 2, ffi_call_unix64 () at ../src/x86/unix64.S:49
49  movq(%rsp), %r10/* Load return address.  */

[...snip...]
76  call*%r11

(gdb) p/x $rdi
$10 = 0xa0005
(gdb) p/x $rsi
$11 = 0x706050403020100
(gdb) c
Continuing.

foo: 5
bar: 10
data: [0, 1, 2, 3, 4, 5, 6, 7]

--

___
Python tracker 

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



[issue29608] pip_gui

2017-02-20 Thread Shyam Sunder

New submission from Shyam Sunder:

I am not able see the text of the radio button clearly in the welcome page of 
search and install packages

--
components: Tkinter
files: Screenshot (70).png
messages: 288238
nosy: Shyam Sunder, dstufft, lorenzogotuned, ncoghlan, ned.deily, 
r.david.murray, rhettinger, terry.reedy, upendra-k14
priority: normal
pull_requests: 170
severity: normal
status: open
title: pip_gui
type: performance
versions: Python 2.7
Added file: http://bugs.python.org/file46655/Screenshot (70).png

___
Python tracker 

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



[issue22273] abort when passing certain structs by value using ctypes

2017-02-20 Thread Vinay Sajip

Vinay Sajip added the comment:

Possibly also relevant: #16575 and

https://github.com/libffi/libffi/issues/33

--

___
Python tracker 

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



[issue29602] complex() on object with __complex__ function loses sign of zero imaginary part

2017-02-20 Thread Mark Dickinson

Mark Dickinson added the comment:


New changeset 112ec38c15b388fe025ccb85369a584d218b1160 by GitHub in branch 
'master':
bpo-29602: fix signed zero handling in complex constructor. (#203)
https://github.com/python/cpython/commit/112ec38c15b388fe025ccb85369a584d218b1160


--

___
Python tracker 

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



[issue29549] Improve docstring for str.index

2017-02-20 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

No need to add Argument Clinic code. Just make docstrings in the style of of 
Argument Clinic descriptions.

--

___
Python tracker 

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



[issue29549] Improve docstring for str.index

2017-02-20 Thread Lisa Roach

Lisa Roach added the comment:

I tried to have a go at making the str.index Argument Clinic compatible, Serhiy 
can you take a look at my commits and let me know if this is the correct way of 
doing it: 

https://github.com/python/cpython/compare/master...lisroach:master

If it looks good I will make a pull request. Thanks!

--

___
Python tracker 

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



[issue29602] complex() on object with __complex__ function loses sign of zero imaginary part

2017-02-20 Thread Mark Dickinson

Mark Dickinson added the comment:

Created https://github.com/python/cpython/pull/203, but I feel bad for having 
my name on the commits. :-(

--

___
Python tracker 

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



[issue29602] complex() on object with __complex__ function loses sign of zero imaginary part

2017-02-20 Thread Mark Dickinson

Changes by Mark Dickinson :


--
pull_requests: +169

___
Python tracker 

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



[issue29607] Broken stack_effect for CALL_FUNCTION_EX

2017-02-20 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

The fix LGTM. Please add the Misc/NEWS entry.

--
assignee:  -> serhiy.storchaka
nosy: +Demur Rumed, serhiy.storchaka
stage:  -> patch review

___
Python tracker 

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



[issue29602] complex() on object with __complex__ function loses sign of zero imaginary part

2017-02-20 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I pushed changes to my fork but when try to create a pull request it contains 
unrelated changes. Seems I do something wrong.

--

___
Python tracker 

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



[issue29607] Broken stack_effect for CALL_FUNCTION_EX

2017-02-20 Thread Matthieu Dartiailh

Changes by Matthieu Dartiailh :


--
pull_requests: +168

___
Python tracker 

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



[issue29607] Broken stack_effect for CALL_FUNCTION_EX

2017-02-20 Thread Matthieu Dartiailh

New submission from Matthieu Dartiailh:

The computation of the stack_effect of the CALL_FUNCTION_EX does not reflect 
the use of the argument to the opcode.

Currently stack_effect expect two flags (one on 0x01 and one on 0x02) 
corresponding to whether positional arguments and keyword arguments are being 
passed. However in the current implementation the argument of CALL_FUNCTION_EX 
is either 0 or 1 depending on the presence of keyword arguments. According to 
Serhiy Storchaka, the behavior of stack_effect is a left-over of the previous 
implementation and should be fixed.

--
components: Interpreter Core
messages: 288230
nosy: mdartiailh
priority: normal
severity: normal
status: open
title: Broken stack_effect for CALL_FUNCTION_EX
type: behavior
versions: Python 3.6, Python 3.7

___
Python tracker 

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



[issue29602] complex() on object with __complex__ function loses sign of zero imaginary part

2017-02-20 Thread Mark Dickinson

Mark Dickinson added the comment:

complex-constructor-from-complex2.patch looks good to me.

What happens now? I presume we can no longer push to hg.python.org? So one of 
us needs to make a PR on GitHub and another review it?

--

___
Python tracker 

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



[issue10735] platform.architecture() gives misleading results for OS X multi-architecture executables

2017-02-20 Thread Marc-Andre Lemburg

Marc-Andre Lemburg added the comment:

The term "linkage" is probably a misnomer... "execformat" would be more correct:

 * https://en.wikipedia.org/wiki/Comparison_of_executable_file_formats

Too late to change, I guess.

--

___
Python tracker 

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



[issue10735] platform.architecture() gives misleading results for OS X multi-architecture executables

2017-02-20 Thread Marc-Andre Lemburg

Marc-Andre Lemburg added the comment:

I think there's a misunderstanding in what platform.architecture() is meant 
for. The purpose is to find out more details about the executable you pass to 
it, e.g. whether it's a 32-bit or 64-bit binary, or whether it's an ELF or PE 
binary. And it's a best effort API, just as most other platform APIs - this is 
also the reason why most of them have parameters available to modify the 
default return values.

It doesn't work with multi-architecture executables. We'd need a new API for 
this.

Regarding returning multiple architectures in the linkage return value: I'm not 
sure whether that's a good idea. The architectures are not necessarily of 
different linkage types. In fact on Macs, the correct values is "Mach-O". The 
API should probably return this instead of the default empty string.

--

___
Python tracker 

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



[issue29605] platform.architecture() with Python2.7-32 misreports architecture on macOS.

2017-02-20 Thread Marc-Andre Lemburg

Marc-Andre Lemburg added the comment:

Ok, thanks for the clarification. So if I understand correctly, the main change 
in Python 3 is that points to the stub launcher, not the binary itself.

In any case, a new function would have to be added to the platform module to 
query multiple architectures available in a binary and probably another one to 
return the architecture that Python runs.

--

___
Python tracker 

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



[issue29605] platform.architecture() with Python2.7-32 misreports architecture on macOS.

2017-02-20 Thread Ned Deily

Ned Deily added the comment:

> AFAIK, the Python 3 binaries available from python.org are no longer built as 
> universal binaries, so the problem doesn't show with those.

All python.org Mac binaries are built as universal. For example:

$ file /usr/local/bin/python3.6
/usr/local/bin/python3.6: Mach-O universal binary with 2 architectures: [i386: 
Mach-O executable i386] [x86_64: Mach-O 64-bit executable x86_64]
/usr/local/bin/python3.6 (for architecture i386):   Mach-O executable i386
/usr/local/bin/python3.6 (for architecture x86_64): Mach-O 64-bit 
executable x86_64

--

___
Python tracker 

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



[issue29602] complex() on object with __complex__ function loses sign of zero imaginary part

2017-02-20 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


Added file: 
http://bugs.python.org/file46654/complex-constructor-from-complex2.patch

___
Python tracker 

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



[issue29602] complex() on object with __complex__ function loses sign of zero imaginary part

2017-02-20 Thread Armin Rigo

Armin Rigo added the comment:

4 lines before the new "ci.real = cr.imag;", we have "cr.imag = 0.0; /* Shut up 
compiler warning */".  The comment is now wrong: we really need to set cr.imag 
to 0.0.

--

___
Python tracker 

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



[issue29602] complex() on object with __complex__ function loses sign of zero imaginary part

2017-02-20 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Proposed patch fixes constructing complex from complex.

But in future versions perhaps it is worth to disallow passing complex argument 
to two-arguments complex constructor.

--
keywords: +patch
stage: needs patch -> patch review
Added file: 
http://bugs.python.org/file46653/complex-constructor-from-complex.patch

___
Python tracker 

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



[issue26752] Mock(2.0.0).assert_has_calls() raise AssertionError in two same calls

2017-02-20 Thread John W.

John W. added the comment:

This got a little discussion over at 
http://lists.idyll.org/pipermail/testing-in-python/2017-February/007012.html

The current evidence seem to indicate this is indeed a bug in the 
implementation of assert_has_calls.

--

___
Python tracker 

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



[issue22273] abort when passing certain structs by value using ctypes

2017-02-20 Thread Vinay Sajip

Vinay Sajip added the comment:

Thanks for spelling it out for me, that's helpful. But I'm still confused about 
a couple of things: I can't find classify_argument in the Python source tree 
other than in

Modules/_ctypes/libffi_osx/x86/x86-ffi64.c

Is that the file you referred to as ffi64.c? I assumed this is only used on OS 
X. Do we just use the system libffi on Linux?

I also note that if I use the following:

typedef struct {
int foo;
int bar;
unsigned char data[8];
} Test;

which is certainly the same size of struct, there's no abort and the sum is 
correctly calculated and returned as 28, which is printed by the Python script. 
If I swap things around so that the array comes first in the structure, that 
also works. If I increase the array size back to 16 (giving a total structure 
size of 24), that also works. If I then comment out the 'int foo' and 'int bar' 
fields in both C and Python, the abort reappears.

--

___
Python tracker 

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



[issue29605] platform.architecture() with Python2.7-32 misreports architecture on macOS.

2017-02-20 Thread Marc-Andre Lemburg

Marc-Andre Lemburg added the comment:

Thanks for the report, but there really isn't much we can do, since the API is 
not geared up for handling executables which contain binaries for multiple 
architectures.

AFAIK, the Python 3 binaries available from python.org are no longer built as 
universal binaries, so the problem doesn't show with those.

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

___
Python tracker 

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



[issue29606] urllib FTP protocol stream injection

2017-02-20 Thread ecbftw

New submission from ecbftw:

Please see: 
http://blog.blindspotsecurity.com/2017/02/advisory-javapython-ftp-injections.html

This was reported to security at python dot org, but as far as I can tell, they 
sat on it for a year.

I don't think there is a proper way to encode newlines in CWD commands, 
according the FTP RFC.  If that is the case, then I suggest throwing an 
exception on any URLs that contain one of '\r\n\0' or any other characters that 
the FTP protocol simply can't support.

--
messages: 288219
nosy: ecbftw
priority: normal
severity: normal
status: open
title: urllib FTP protocol stream injection
type: security
versions: Python 2.7, Python 3.3, Python 3.4, Python 3.5, Python 3.6, Python 3.7

___
Python tracker 

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



[issue10735] platform.architecture() gives misleading results for OS X multi-architecture executables

2017-02-20 Thread Ned Deily

Changes by Ned Deily :


--
assignee: ronaldoussoren -> lemburg
versions: +Python 3.6, Python 3.7 -Python 3.3, Python 3.4

___
Python tracker 

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



[issue29605] platform.architecture() with Python2.7-32 misreports architecture on macOS.

2017-02-20 Thread Ned Deily

Ned Deily added the comment:

platform.architecture() is documented as giving unreliable results with macOS 
universal files; see 
https://docs.python.org/2/library/platform.html#platform.architecture.  The 
difference in behavior between Python 2.7 and 3.x for the example you show is 
due to the difference in the value of sys.executable between them on macOS.  On 
2.7, sys.executable points to the actual Python interpreter binary, which is a 
universal binary.  On 3.x, the behavior was changed to not to resolve to the 
interpreter binary but rather the stub launcher binary and the "-32" launcher 
has only 32-bit executables:

$ /usr/local/bin/python2.7-32 -c 'import sys;print(sys.executable)'
/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python
$ /usr/local/bin/python3.6-32 -c 'import sys;print(sys.executable)'
/usr/local/bin/python3.6-32

Because platform.architecture() uses the "file" utility to examine the contents 
of the file pointed to by sys.executable, this change in 3.x has the side 
effect of producing the expected "32bit" value on 3.x when Python is invoked in 
this manner.

However, that doesn't cover all cases.  For example:

$ arch -i386 /usr/local/bin/python3.6 -c 'import 
sys,platform;print(platform.architecture(), sys.maxsize > 2**32)'
('64bit', '') False

So the 3.x platform.architecture can still produce incorrect results.  One can 
argue about what value(s) platform.architecture() should return for 
multi-architecture binaries; languishing Issue10735 covers that.  One could 
also argue that the value of sys.executable on 2.7 should be changed to behave 
like 3.x but it's very late in the life of 2.7 to be making a change like that 
and that change alone would not produce correct results for all cases, like 
"arch -i386" above.

--
assignee:  -> lemburg
nosy: +lemburg
title: Python2.7-32 misreports architecture on macOS. -> 
platform.architecture() with Python2.7-32 misreports architecture on macOS.

___
Python tracker 

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



[issue28963] Use-after-free in _asyncio_Future_remove_done_callback() of _asynciomodule.c

2017-02-20 Thread Yury Selivanov

Yury Selivanov added the comment:

I will in a couple of days.

--

___
Python tracker 

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



[issue22807] uuid.uuid1() should use uuid_generate_time_safe() if available

2017-02-20 Thread Barry A. Warsaw

Barry A. Warsaw added the comment:

On Feb 20, 2017, at 03:45 PM, STINNER Victor wrote:

>Can't we consider that UUID4 is always safe?

It's not a guarantee made by the underlying platform, so I chose to use the
default SafeUUID.unknown value there.

--

___
Python tracker 

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



[issue22807] uuid.uuid1() should use uuid_generate_time_safe() if available

2017-02-20 Thread STINNER Victor

STINNER Victor added the comment:

>>> import uuid
>>> u=uuid.uuid4()
>>> u.is_safe


Can't we consider that UUID4 is always safe?

--

___
Python tracker 

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



[issue22807] uuid.uuid1() should use uuid_generate_time_safe() if available

2017-02-20 Thread Barry A. Warsaw

Barry A. Warsaw added the comment:

Oh, and because the fix is an API change, I don't believe it should be applied 
to earlier versions.  So I think adding the API in 3.7 is all the fix needed 
here.

--

___
Python tracker 

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



[issue22807] uuid.uuid1() should use uuid_generate_time_safe() if available

2017-02-20 Thread Barry A. Warsaw

Changes by Barry A. Warsaw :


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

___
Python tracker 

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



[issue22807] uuid.uuid1() should use uuid_generate_time_safe() if available

2017-02-20 Thread Barry A. Warsaw

Changes by Barry A. Warsaw :


--
keywords:  -security_issue

___
Python tracker 

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



[issue22807] uuid.uuid1() should use uuid_generate_time_safe() if available

2017-02-20 Thread Barry A. Warsaw

Barry A. Warsaw added the comment:

On Feb 20, 2017, at 02:21 PM, STINNER Victor wrote:

>What am I supposed to do with an UUID with safe=False? Should I loop on the
>function until I get safe==True?

It would be an application dependent response.  It might be that you would
check some other attributes of your platform (e.g. are the OS packages that
should be installed to give you safe UUIDs?).  Or your application may not
care that much, or your application may refuse to continue to run on platforms
without safe UUIDs, or you might use some application-level synchronization
methods to guarantee safe UUIDs (e.g. store the unsafe or unknown ones in a
database and check that new ones are not already used).

The point of this change is that it provides information to the application
creating UUIDs that wasn't previously available.

>"safe for multiprocessing applications"
>
>Does it mean unique on the whole system?
>
>I looked at uuid_generate_time_safe(3) manual page which mention
>"synchronization mechanisms (see above)" but they are not documented.
>http://manpages.ubuntu.com/manpages/zesty/en/man3/uuid_generate.3.html

I believe some systems at least use interprocess communication with a daemon
to provide the synchronization.  Yes, it would be system-wide.

>> I'm classifying this as a security issue, (...)  
>
>This issue was only fixed in Python 3.7. Does it mean that it's no more
>considered as as security vulnerability?

I should remove that tag.  While this could have an impact on application
security, it's not a security issue *in Python* itself.

--

___
Python tracker 

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



[issue29602] complex() on object with __complex__ function loses sign of zero imaginary part

2017-02-20 Thread Mark Dickinson

Mark Dickinson added the comment:

Armin, Victor: please open other issues for these discussions; they're 
unrelated to the bug reported here. Also, see #27363, #17336, #22548, #25839.

--

___
Python tracker 

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



[issue29602] complex() on object with __complex__ function loses sign of zero imaginary part

2017-02-20 Thread STINNER Victor

STINNER Victor added the comment:

IMHO it would be less surprising if repr(complex) would return 'complex(..., 
...)': it would be possible to copy/paste and get the result value. I was 
bitten multiple time by the zero sign with complex numbers...

--
nosy: +haypo

___
Python tracker 

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



[issue29602] complex() on object with __complex__ function loses sign of zero imaginary part

2017-02-20 Thread Armin Rigo

Armin Rigo added the comment:

Maybe I should be more explicit: what seems strange to me is that some complex 
numbers have a repr that, when entered in the source, produces a different 
result.  For example, if you want the result ``(-0-0j)`` you have to enter 
something different.  However, I missed the fact that calling explicitly 
``complex(a, b)`` with a and b being floats always gives exactly a+bj with the 
correct signs.  So I retract my comments.

--

___
Python tracker 

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



[issue22807] uuid.uuid1() should use uuid_generate_time_safe() if available

2017-02-20 Thread STINNER Victor

STINNER Victor added the comment:

I don't understand well this change.

What am I supposed to do with an UUID with safe=False? Should I loop on the 
function until I get safe==True?


"safe for multiprocessing applications"

Does it mean unique on the whole system?

I looked at uuid_generate_time_safe(3) manual page which mention 
"synchronization mechanisms (see above)" but they are not documented.
http://manpages.ubuntu.com/manpages/zesty/en/man3/uuid_generate.3.html


> I'm classifying this as a security issue, (...)

This issue was only fixed in Python 3.7. Does it mean that it's no more 
considered as as security vulnerability?

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

___
Python tracker 

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



[issue29602] complex() on object with __complex__ function loses sign of zero imaginary part

2017-02-20 Thread Mark Dickinson

Mark Dickinson added the comment:

> It's unclear if the signs of the two potential zeroes in a complex number 
> have a meaning

Yes, very much so. The signs are important in determining which side of a 
branch cut to use in the various cmath functions.

--

___
Python tracker 

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



[issue29602] complex() on object with __complex__ function loses sign of zero imaginary part

2017-02-20 Thread Mark Dickinson

Mark Dickinson added the comment:

Armin: that's a separate issue, and is expected behaviour.

>>> -(0j)   # this is -(0+0j)
(-0-0j)

Yes: 0j is complex(0.0, 0.0); negating negates both the real and imaginary 
parts.

>>> (-0-0j) # but this equals to the difference between 0 and 0+0j
0j

This is an operation between an integer (note that the initial negation is a 
no-op) and a complex. Here the integer gets promoted to complex(0.0, 0.0), and 
we do complex(0.0, 0.0) - complex(0.0, 0.0), which gives complex(0.0, 0.0).

>>> (-0.0-0j)   # this is the difference between -0.0 and 0+0j
(-0+0j)

This is complex(-0.0, 0.0) - complex(0.0, 0.0). The real and imaginary parts 
are operated on separately, and in keeping with IEEE 754, the real part is 
evaluated as -0.0 - 0.0, which is -0.0.

>>> -0j
-0j # <- on CPython 2.7
(-0-0j) # <- on CPython 3.5

The Python 3 behaviour here is correct. The Python 2 behaviour is the result of 
an unfortunate AST optimization designed to ensure that - is an 
int rather than a long.

None of the above is a new issue.

--

___
Python tracker 

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



[issue26382] List object memory allocator

2017-02-20 Thread STINNER Victor

STINNER Victor added the comment:

FYI the Python 3.6 change in PyMem_Malloc() required to implement a new complex 
check on the GIL. Search for "PyMem_Malloc() now fails if the GIL is not held" 
in my following blog post:
https://haypo.github.io/contrib-cpython-2016q1.html

Requiring that the GIL is held is a backward incompatible change. I suggest to 
run your code with PYTHONMALLOC=debug on Python 3.6 ;-)

--

___
Python tracker 

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



[issue29602] complex() on object with __complex__ function loses sign of zero imaginary part

2017-02-20 Thread Armin Rigo

Armin Rigo added the comment:

CPython 2.7 and 3.5 have issues with the sign of zeroes even without any custom 
class:

>>> -(0j)   # this is -(0+0j)
(-0-0j)
>>> (-0-0j) # but this equals to the difference between 0 and 0+0j
0j
>>> (-0.0-0j)   # this is the difference between -0.0 and 0+0j
(-0+0j)
>>> -0j
-0j # <- on CPython 2.7
(-0-0j) # <- on CPython 3.5

It's unclear if the signs of the two potential zeroes in a complex number have 
a meaning, but the C standard considers these cases for all functions in the 
complex number's header.

--
nosy: +arigo

___
Python tracker 

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



[issue12450] Use the Grisu algorithms to convert floats to strings

2017-02-20 Thread STINNER Victor

Changes by STINNER Victor :


--
type: enhancement -> performance

___
Python tracker 

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



  1   2   >