[issue25660] tabs don't work correctly in python repl

2016-10-26 Thread Clément

Clément added the comment:

Could this commit be the reason why the attached code behaves differently in 
2.7 and 3.5.2? This is the code used by Emacs' default Python mode to do 
completion; with it (python -i completion.py), pressing "tab" on a plain prompt 
offers candidates in Python 2.7, but it doesn't in Python 3.5.2 (instead, it 
inserts a tab).

--
nosy: +cpitclaudel
Added file: http://bugs.python.org/file45235/completion.py

___
Python tracker 

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



[issue28539] httplib/http.client HTTPConnection._set_hostport() regression

2016-10-26 Thread Charles Stephens

Charles Stephens added the comment:

Yes, I'm working on patching urllib3 to preprocess the host argument to 
HTTPConnection.  However, it makes sense to strip square brackets regardless.

--

___
Python tracker 

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



[issue28539] httplib/http.client HTTPConnection._set_hostport() regression

2016-10-26 Thread Charles Stephens

Charles Stephens added the comment:

Not when passing it to getaddrinfo().

--

___
Python tracker 

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



[issue28541] Improve test coverage for json library - loading bytes

2016-10-26 Thread Zachary Ware

Changes by Zachary Ware :


--
nosy: +ezio.melotti, rhettinger, zach.ware
stage:  -> patch review
type:  -> enhancement
versions: +Python 3.7

___
Python tracker 

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



[issue28539] httplib/http.client HTTPConnection._set_hostport() regression

2016-10-26 Thread Zachary Ware

Zachary Ware added the comment:

That looks like a bug in urllib3 to me.  The host is *not* 
'[2620:125:9014:3240:14:240:128:0]', the host is 
'2620:125:9014:3240:14:240:128:0'; the brackets are merely for disambiguating 
the port.

Compare to urllib.parse.urlsplit:

>>> from urllib.parse import urlsplit
>>> s = urlsplit('http://[2620:125:9014:3240:14:240:128:0]:8080/api/python')
>>> s.hostname
'2620:125:9014:3240:14:240:128:0'
>>> s.port
8080
>>> s.netloc
'[2620:125:9014:3240:14:240:128:0]:8080'

I'd recommend pursuing this with urllib3, but do take a look at existing IPv6 
parsing issues there as a cursory glance at their bug tracker shows several of 
them.

That said, I don't know of any particular reason not to strip brackets in 
HTTPConnection anyway.  Brackets cannot be part of a valid hostname, can they?

--
nosy: +zach.ware

___
Python tracker 

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



[issue28541] Improve test coverage for json library - loading bytes

2016-10-26 Thread Eric Appelt

New submission from Eric Appelt:

Increase test coverage of the json library, specifically the detect_encoding() 
function in the __init__ module, which is used to handle the autodetection of 
the encoding of a bytes object passed to json.loads().

This function was added in issue 17909 which extended the json.loads() function 
to accept bytes.

Note that this is a small patch as I am following section 5 of the developer 
guide and I am trying to acquaint myself with the process as a first time 
contributor. I found this missing coverage just by semi-randomly looking at 
individual modules of interest. Please let me know if I have made any general 
mistakes in constructing this ticket. Thanks!

--
components: Tests
files: mywork.patch
keywords: patch
messages: 279521
nosy: Eric Appelt
priority: normal
severity: normal
status: open
title: Improve test coverage for json library - loading bytes
versions: Python 3.6
Added file: http://bugs.python.org/file45234/mywork.patch

___
Python tracker 

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



[issue28539] httplib/http.client HTTPConnection._set_hostport() regression

2016-10-26 Thread Charles Stephens

Charles Stephens added the comment:

Our internal use case is happening through requests via urllib3 for parsing.

Essentially requests is taking the URL, passing it to urllib3 for parsing.  
urllib3 is returning a namedtuple of type Url which includes a host and port 
property which is being fed to httplib.  Essentially:

>>> import urllib3
>>> import httplib
>>> orig_url = 'http://[2620:125:9014:3240:14:240:128:0]:8080/api/python'
>>> u1 = urllib3.util.parse_url(orig_url)
>>> u1
Url(scheme='http', auth=None, host='[2620:125:9014:3240:14:240:128:0]', 
port=8080, path='/api/python', query=None, fragment=None)
>>> c1 = httplib.HTTPConnection(u1.host, port=u1.port)
>>> c1.host, c1.port
('[2620:125:9014:3240:14:240:128:0]', 8080)
>>> c1.request('GET', '/api/json')
Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/lib/python2.7/httplib.py", line 979, in request
self._send_request(method, url, body, headers)
  File "/usr/lib/python2.7/httplib.py", line 1013, in _send_request
self.endheaders(body)
  File "/usr/lib/python2.7/httplib.py", line 975, in endheaders
self._send_output(message_body)
  File "/usr/lib/python2.7/httplib.py", line 835, in _send_output
self.send(msg)
  File "/usr/lib/python2.7/httplib.py", line 797, in send
self.connect()
  File "/usr/lib/python2.7/httplib.py", line 778, in connect
self.timeout, self.source_address)
  File "/usr/lib/python2.7/socket.py", line 553, in create_connection
for res in getaddrinfo(host, port, 0, SOCK_STREAM):
socket.gaierror: [Errno -2] Name or service not known

--

___
Python tracker 

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



[issue28539] httplib/http.client HTTPConnection._set_hostport() regression

2016-10-26 Thread Martin Panter

Martin Panter added the comment:

I tried the original revision 433606e9546c code in Python 2.7 (which still 
allows mixed tabs and spaces), and it behaves the same as the current version. 
Thus I suspect revision 9e2b94a3b5dc did not change any behaviour.

What is your use case? Why can’t you just pass the address without square 
brackets:

>>> con = HTTPConnection("fe80::26a9:37ff:fe00:f764", 15482)
>>> (con.host, con.port)
('fe80::26a9:37ff:fe00:f764', 15482)

How do you come by an IPv6 address in square brackets, but with the port number 
separate? You can use urlsplit() to extract the “hostname” and “port” 
attributes from a URL, but in that case “hostname” does not include the square 
brackets:

>>> urlsplit("//[fe80::26a9:37ff:fe00:f764]:15482").hostname
'fe80::26a9:37ff:fe00:f764'

--

___
Python tracker 

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



[issue28539] httplib/http.client HTTPConnection._set_hostport() regression

2016-10-26 Thread Charles Stephens

Charles Stephens added the comment:

Example with patch applied:

Python 2.7.6 (default, Oct 26 2016, 20:33:50) 
[GCC 4.8.4] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import httplib
>>> con1 = httplib.HTTPConnection('[fe80::26a9:37ff:fe00:f764]', 15482)
>>> con1.host, con1.port
('fe80::26a9:37ff:fe00:f764', 15482)

--

___
Python tracker 

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



[issue28539] httplib/http.client HTTPConnection._set_hostport() regression

2016-10-26 Thread Charles Stephens

Charles Stephens added the comment:

I misapplied the term 'regression'.  My intent was to describe how original 
author's change revision 433606e9546c was refactored to make it perform 
incorrectly.

Without the scope specifier, the outcome is the same when HTTPConnection is 
instantiated.  When both the host and port arguments are specified, the square 
brackets are not stripped and are stored in the host attribute.  When the port 
number is part of the host argument and the port argument is None, the host 
attribute does not include the square brackets.  Examples:

Python 2.7.10 (default, Jul 30 2016, 18:31:42) 
[GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.34)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import httplib
>>> con1 = httplib.HTTPConnection('[fe80::26a9:37ff:fe00:f764]', 15482)
>>> con1.host, con1.port
('[fe80::26a9:37ff:fe00:f764]', 15482)
>>> con2 = httplib.HTTPConnection('[fe80::26a9:37ff:fe00:f764]:15482')
>>> con2.host, con2.port
('fe80::26a9:37ff:fe00:f764', 15482)

Compare with IPv4 behavior:

>>> con3 = httplib.HTTPConnection('127.0.0.1', 15482)
>>> con3.host, con3.port
('127.0.0.1', 15482)
>>> con4 = httplib.HTTPConnection('127.0.0.1:15482')
>>> con4.host, con4.port
('127.0.0.1', 15482)

Calls to con1.request() will fail in socket.py because getaddrinfo will choke 
on the square brackets.  Which makes sense since HTTPConnection.host is passed 
on down the stack as-is until it reaches create_connection() in socket.py.

Moving the indent of that if block up one level makes con1 identical to con2.

--

___
Python tracker 

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



[issue2943] Distutils should generate a better error message when the SDK is not installed

2016-10-26 Thread STINNER Victor

STINNER Victor added the comment:

Maybe we can add an entry to the Python FAQ, use this link and then add a
link to the Microsoft article.

--

___
Python tracker 

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



[issue28522] can't make IDLEX work with python._pth and python-3.6.0b2

2016-10-26 Thread Terry J. Reedy

Terry J. Reedy added the comment:

I don't know anything about 'python._pth' and whether there is any bug with 
respect to that.

As far as IDLE goes, there is no bug and this issue should be closed.  

In #24225, before the release of 3.6.0a2, most file names within idlelib were 
changed to shorter or lowercased names in conformance with PEP 8 and as 
anticipated by PEP 434.  In particular, 'configHandler.py' is now 'config.py'.  
API changes within and between files are and will be much more disruptive to 
external users.  As Nick Coughlin said in msg266409, 3rd party idlelib users 
are free to bundle or depend on a frozen copy of a past version.

WinPython should test the third party modules it includes with the python it is 
releasing.  Importing a module is as minimal as it gets.  Consider reporting 
the incompatibility to them.

--

___
Python tracker 

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



[issue2943] Distutils should generate a better error message when the SDK is not installed

2016-10-26 Thread Ivan Pozdeev

Ivan Pozdeev added the comment:

@haypo, as I said, it's undesirable to link to a 3rd party site in a built-in 
error message because its availability and content are outside the dev team's 
control.

--

___
Python tracker 

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



[issue28540] math.degrees(sys.float_info.max) should throw an OverflowError exception

2016-10-26 Thread Francisco Couzo

New submission from Francisco Couzo:

Most functions in the math library raise an OverflowError when the arguments 
are finite but the result is not.

>>> math.exp(sys.float_info.max)
Traceback (most recent call last):
  File "", line 1, in 
OverflowError: math range error

>>> math.degrees(sys.float_info.max)
inf

--
messages: 279513
nosy: franciscouzo
priority: normal
severity: normal
status: open
title: math.degrees(sys.float_info.max) should throw an OverflowError exception

___
Python tracker 

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



[issue28539] httplib/http.client HTTPConnection._set_hostport() regression

2016-10-26 Thread Martin Panter

Martin Panter added the comment:

You say this is a regression. Can you point to a version that worked as you 
want? The IPv6 URL handling you pointed out seems to have been added to 2.4b1, 
and then backported to 2.3.5. I expect that earlier versions didn’t support 
IPv6 URLs at all.

Also, it does not seem to me that parsing the square bracket form was intended 
if the port is specified separately. Look at the test cases added in revision 
433606e9546c. Perhaps you aren’t encoding the URL correctly, or Requests isn’t 
parsing the hostname correctly.

Also, according to RFC 6874, it would be more proper to encode the percent sign 
as %25, so the URL would have [fe80::26a9:37ff:fe00:f764%25eth0]. But I don’t 
think Python supports this; see Issue 23448.

--
nosy: +martin.panter
stage:  -> patch review
versions:  -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



[issue28539] httplib/http.client HTTPConnection._set_hostport() regression

2016-10-26 Thread Charles Stephens

Changes by Charles Stephens :


--
title: httplib/http.client HTTPConnection._get_hostport() regression -> 
httplib/http.client HTTPConnection._set_hostport() regression

___
Python tracker 

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



[issue28539] httplib/http.client HTTPConnection._set_hostport() regression

2016-10-26 Thread Charles Stephens

Charles Stephens added the comment:

Er, that is HTTPConnection._set_hostport() not _get_hostport()

--

___
Python tracker 

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



[issue28522] can't make IDLEX work with python._pth and python-3.6.0b2

2016-10-26 Thread Ned Deily

Changes by Ned Deily :


--
nosy: +roger.serwy, terry.reedy

___
Python tracker 

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



[issue28498] tk busy command

2016-10-26 Thread klappnase

klappnase added the comment:

This is something entirely different, since the commands you list here in tk do 
not accept keyword arguments at all.

--

___
Python tracker 

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



[issue28539] httplib/http.client HTTPConnection._get_hostport() regression

2016-10-26 Thread Charles Stephens

New submission from Charles Stephens:

Back through the mists of time, there was a change to strip square brackets 
IPv6 address host literals in HTTPConnection._get_hostport():

https://hg.python.org/cpython/diff/433606e9546c/Lib/httplib.py

However, the code mixed tabs and spaces and was "corected" by:

https://hg.python.org/cpython/diff/9e2b94a3b5dc/Lib/httplib.py

However, the intent was changed in the second diff and brackets won't be 
stripped.  This causes problems when IPv6 address URL's are used with the 
requests package:

In [1]: import httplib

In [2]: con = httplib.HTTPConnection('[fe80::26a9:37ff:fe00:f764%eth0]', 15482)

In [3]: con.request("GET", "/api/api-version")
---
gaierror  Traceback (most recent call last)
 in ()
> 1 con.request("GET", "/api/api-version")

/usr/lib/python2.7/httplib.pyc in request(self, method, url, body, headers)
977 def request(self, method, url, body=None, headers={}):
978 """Send a complete request to the server."""
--> 979 self._send_request(method, url, body, headers)
980 
981 def _set_content_length(self, body):

/usr/lib/python2.7/httplib.pyc in _send_request(self, method, url, body, 
headers)
   1011 for hdr, value in headers.iteritems():
   1012 self.putheader(hdr, value)
-> 1013 self.endheaders(body)
   1014 
   1015 def getresponse(self, buffering=False):

/usr/lib/python2.7/httplib.pyc in endheaders(self, message_body)
973 else:
974 raise CannotSendHeader()
--> 975 self._send_output(message_body)
976 
977 def request(self, method, url, body=None, headers={}):

/usr/lib/python2.7/httplib.pyc in _send_output(self, message_body)
833 msg += message_body
834 message_body = None
--> 835 self.send(msg)
836 if message_body is not None:
837 #message_body was not a string (i.e. it is a file) and

/usr/lib/python2.7/httplib.pyc in send(self, data)
795 if self.sock is None:
796 if self.auto_open:
--> 797 self.connect()
798 else:
799 raise NotConnected()

/usr/lib/python2.7/httplib.pyc in connect(self)
776 """Connect to the host and port specified in __init__."""
777 self.sock = socket.create_connection((self.host,self.port),
--> 778  self.timeout, 
self.source_address)
779 
780 if self._tunnel_host:

/usr/lib/python2.7/socket.pyc in create_connection(address, timeout, 
source_address)
551 host, port = address
552 err = None
--> 553 for res in getaddrinfo(host, port, 0, SOCK_STREAM):
554 af, socktype, proto, canonname, sa = res
555 sock = None

gaierror: [Errno -2] Name or service not known

--
components: Library (Lib)
files: get_hostport.diff
keywords: patch
messages: 279509
nosy: cfs-pure
priority: normal
severity: normal
status: open
title: httplib/http.client HTTPConnection._get_hostport() regression
versions: Python 2.7, Python 3.3, Python 3.4, Python 3.5, Python 3.6, Python 3.7
Added file: http://bugs.python.org/file45233/get_hostport.diff

___
Python tracker 

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



[issue28046] Remove the concept of platform-specific directories

2016-10-26 Thread Xavier de Gaye

Xavier de Gaye added the comment:

'make install' fails to remove the sysconfigdata module from lib-dynload and 
prints now instead:

rm: cannot remove 
'/path/to/install/lib/python3.7/lib-dynload/_sysconfigdata_m.py': No such file 
or directory

The patch fixes this. It also removes a useless and now incorrect line that was 
meant to echo the previously executed command.

--
versions: +Python 3.7
Added file: http://bugs.python.org/file45232/sysconfigdata_ABIFLAGS.patch

___
Python tracker 

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



[issue28498] tk busy command

2016-10-26 Thread Miguel

Miguel added the comment:

Using the same reasoning applied to tk_busy_hold(), we have to change also 
these methods:
selection_set(self, first, last=None) -> selection_set(self, **kw)
coords(self, value=None) -> coords(self, **kw)
identify(self, x, y) -> identity(self, **kw)
delete(self, index1, index2=None) -> delete(self, **kw)
mark_set(self, markName, index) -> ...
mark_unset(self, *markNames) -> ...


and many other to adapt to future changes.

--

___
Python tracker 

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



[issue28498] tk busy command

2016-10-26 Thread klappnase

klappnase added the comment:

Oops, I guess I violated PEP257 again, sorry, corrected version #4 attached.

--
Added file: http://bugs.python.org/file45231/tk_busy_4.diff

___
Python tracker 

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



[issue28498] tk busy command

2016-10-26 Thread klappnase

klappnase added the comment:

Ok, I hope I applied all the required changes now.
The tests seemed to me to belong to test_misc, so I just added another function 
to the MiscTest class, I hope that is ok. The test runs well here, so I hope I 
did everything correctly.
Thanks for your patience!

--
Added file: http://bugs.python.org/file45230/tk_busy_3.diff

___
Python tracker 

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



[issue28522] can't make IDLEX work with python._pth and python-3.6.0b2

2016-10-26 Thread Big Stone

Big Stone added the comment:

Thanks Eryk,

So the root cause is that IDLEX is no more compatible with IDLE in python3.6.

==> I can survive this loss... Now, I don't if the "python._pth" crash is a 
problem, as I can stay with "#Lib\site-packages" for now.

--

___
Python tracker 

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



[issue28522] can't make IDLEX work with python._pth and python-3.6.0b2

2016-10-26 Thread Big Stone

Big Stone added the comment:

Event Viewer says, when I put "Lub\site-packages" in python._pth:

Nom de l’application défaillante python.exe, version : 3.6.112.1013, horodatage 
: 0x57fc0593
Nom du module défaillant : ucrtbase.dll, version : 10.0.14393.0, horodatage : 
0x578997b5
Code d’exception : 0xc409
Décalage d’erreur : 0x0006d5b8
ID du processus défaillant : 0x190c
Heure de début de l’application défaillante : 0x01d22fafd622ed09
Chemin d’accès de l’application défaillante : 
C:\WinPython\basedir36\build\winpython-64bit-3.6.x.0\python-3.6.0b2.amd64\python.exe
Chemin d’accès du module défaillant: C:\WINDOWS\System32\ucrtbase.dll
ID de rapport : ec44b511-6196-48a0-95ec-dc997b4d0302
Nom complet du package défaillant : 
ID de l’application relative au package défaillant :

--

___
Python tracker 

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



[issue2943] Distutils should generate a better error message when the SDK is not installed

2016-10-26 Thread STINNER Victor

STINNER Victor added the comment:

Idea: add a link to this article:
https://aka.ms/vcpython
or full link: 
https://blogs.msdn.microsoft.com/pythonengineering/2016/04/11/unable-to-find-vcvarsall-bat/

Related tweet from Steve Dower:
https://twitter.com/zooba/status/791032320006328320

--

___
Python tracker 

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



[issue2943] Distutils should generate a better error message when the SDK is not installed

2016-10-26 Thread Vivek Karumudi

Vivek Karumudi added the comment:

I cannot understand the cryptic message could you please change it to something 
meaningful for "Unable to find vcvarsall.bat"

--
nosy: +vivekkarumudi

___
Python tracker 

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



[issue28524] Set default argument of logging.disable() to logging.CRITICAL

2016-10-26 Thread Raymond Hettinger

Changes by Raymond Hettinger :


--
assignee:  -> vinay.sajip
priority: normal -> low
versions: +Python 3.7

___
Python tracker 

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



[issue28212] Closing server in asyncio is not efficient

2016-10-26 Thread Константин Волков

Константин Волков added the comment:

Seems that my example wasn`t good. Real reason in it was that closing server is 
not closing already established connections, and seems that it is not expected 
to do.
Andrew, can you provide your example? I catched some problems but now I think 
it was because of asyncio internal logic misunderstanding. May be if you 
provide your example there will be some ideas.

--

___
Python tracker 

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



[issue5996] abstract class instantiable when subclassing dict

2016-10-26 Thread R. David Murray

R. David Murray added the comment:

My apologies, I added Nathaniel to nosy here when I closed the duplicate, but 
forgot to add a link to the closed issue: issue 28537.

--
nosy: +r.david.murray

___
Python tracker 

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



[issue28530] Howto detect if an object is of type os.DirEntry

2016-10-26 Thread stephan

stephan added the comment:

Some questions:
 - if posix.DirEntry is exposed I think nt.DirEntry
   and os.DirEntry (this one is mentioned in the documentation)
   should be exposed
 - will this bw backported to 3.5 lets say 3.5.3?

--

___
Python tracker 

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



[issue28509] dict.update allocates too much

2016-10-26 Thread INADA Naoki

INADA Naoki added the comment:

OK, I won't change it to allow additional resize while merging, after 
pre-resize.
But current code has two problem:

* Pre-resize happen even when resizing is not necessary. (ex. two dict has same 
keys).
* Pre-resize allocates too much memory which doesn't make sense.

Next patch (28509-smaller-update2.patch) seems better because:

* When pre-resize doesn't happen, at most one resize while merging.
* When pre-resize happens, no resize happens while merging.
* Doesn't make surprisingly sparse dict when two dicts have same keys.

PoC code:

import sys
b = {}
for i in range(16):
b[i] = i
a = b.copy()
a.update(b)  # No need to resize
print(i, sys.getsizeof(a), sys.getsizeof(b))

Current:

0 256 256
1 256 256
2 256 256
3 664 256
4 664 256
5 384 384  # !!!
6 664 384
7 664 384
8 664 384
9 664 384
10 664 664
11 664 664
12 1200 664
13 1200 664
14 1200 664
15 1200 664


With second patch:

0 256 256
1 256 256
2 256 256
3 256 256
4 256 256
5 384 384
6 384 384
7 384 384
8 384 384
9 384 384
10 664 664
11 664 664
12 664 664
13 664 664
14 664 664
15 664 664

--
Added file: http://bugs.python.org/file45229/28509-smaller-update2.patch

___
Python tracker 

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



[issue26865] Meta-issue: support of the android platform

2016-10-26 Thread Xavier de Gaye

Xavier de Gaye added the comment:

issue #28538: _socket module cross-compilation error on android-24

--
dependencies: +_socket module cross-compilation error on android-24

___
Python tracker 

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



[issue28538] _socket module cross-compilation error on android-24

2016-10-26 Thread Xavier de Gaye

New submission from Xavier de Gaye:

On the latest Android API level (android-24), the if_nameindex function is now 
found by configure in Android libc.  But the if_nameindex function and 
structure are still not defined in the Android net/if.h header.

The compilation fails with:

clang --sysroot=/opt/android-ndk/platforms/android-24/arch-x86 -target 
i686-none-linux-androideabi -gcc-toolchain 
/opt/android-ndk/toolchains/x86-4.9/prebuilt/linux-x86_64 -Wno-unused-result 
-Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall 
-Wstrict-prototypes -Wno-unused-value -Wno-empty-body -Qunused-arguments 
-Wno-parentheses-equality -std=c99 -Wextra -Wno-unused-result 
-Wno-unused-parameter -Wno-missing-field-initializers -I. -IObjects -IInclude 
-IPython 
-I/home/xavier/src/android/pyona/build/python3.7-install-android-24-x86/org.bitbucket.pyona/include
 -I/opt/android-ndk/platforms/android-24/arch-x86/usr/include 
-I/path/to/android/cpython/Include 
-I/home/xavier/src/android/pyona/build/python3.7-android-24-x86 -c 
/path/to/android/cpython/Modules/socketmodule.c -o 
build/temp.linux-i686-3.7/path/to/android/cpython/Modules/socketmodule.o
/path/to/android/cpython/Modules/socketmodule.c:1034:29: warning: comparison of 
integers of different signs: 'socklen_t' (aka 'int') and 'size_t' (aka 
'unsigned int') [-Wsign-compare]
if (res->ai_addrlen < addr_ret_size)
~~~ ^ ~
/path/to/android/cpython/Modules/socketmodule.c:1125:25: warning: comparison of 
integers of different signs: 'socklen_t' (aka 'int') and 'size_t' (aka 
'unsigned int') [-Wsign-compare]
if (res->ai_addrlen < addr_ret_size)
~~~ ^ ~
/path/to/android/cpython/Modules/socketmodule.c:4925:15: warning: implicit 
declaration of function 'sethostname' is invalid in C99 
[-Wimplicit-function-declaration]
res = sethostname(buf.buf, buf.len);
  ^
/path/to/android/cpython/Modules/socketmodule.c:6242:10: warning: implicit 
declaration of function 'if_nameindex' is invalid in C99 
[-Wimplicit-function-declaration]
ni = if_nameindex();
 ^
/path/to/android/cpython/Modules/socketmodule.c:6242:8: warning: incompatible 
integer to pointer conversion assigning to 'struct if_nameindex *' from 'int' 
[-Wint-conversion]
ni = if_nameindex();
   ^ ~~
/path/to/android/cpython/Modules/socketmodule.c:6250:9: warning: implicit 
declaration of function 'if_freenameindex' is invalid in C99 
[-Wimplicit-function-declaration]
if_freenameindex(ni);
^
/path/to/android/cpython/Modules/socketmodule.c:6254:19: error: subscript of 
pointer to incomplete type 'struct if_nameindex'
for (i = 0; ni[i].if_index != 0 && i < INT_MAX; i++) {
~~^
/path/to/android/cpython/Modules/socketmodule.c:6240:12: note: forward 
declaration of 'struct if_nameindex'
struct if_nameindex *ni;
   ^
/path/to/android/cpython/Modules/socketmodule.c:6256:19: error: subscript of 
pointer to incomplete type 'struct if_nameindex'
ni[i].if_index, PyUnicode_DecodeFSDefault, ni[i].if_name);
~~^
/path/to/android/cpython/Modules/socketmodule.c:6240:12: note: forward 
declaration of 'struct if_nameindex'
struct if_nameindex *ni;
   ^
/path/to/android/cpython/Modules/socketmodule.c:6256:62: error: subscript of 
pointer to incomplete type 'struct if_nameindex'
ni[i].if_index, PyUnicode_DecodeFSDefault, ni[i].if_name);
   ~~^
/path/to/android/cpython/Modules/socketmodule.c:6240:12: note: forward 
declaration of 'struct if_nameindex'
struct if_nameindex *ni;
   ^
6 warnings and 3 errors generated.

--
messages: 279495
nosy: xdegaye
priority: normal
severity: normal
stage: needs patch
status: open
title: _socket module cross-compilation error on android-24
type: compile error
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



[issue2506] Add mechanism to disable optimizations

2016-10-26 Thread STINNER Victor

STINNER Victor added the comment:

I would suggest -X noopt and use "noopt" in .pyc filenames. That's what I 
proposed in my PEP 511.

--

___
Python tracker 

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



[issue2506] Add mechanism to disable optimizations

2016-10-26 Thread STINNER Victor

STINNER Victor added the comment:

Since the discussion restarted, I reopen the issue and assigned it to Python 
3.6. Maybe it's too late for such tiny change?

--
resolution: rejected -> 
status: closed -> open
versions: +Python 3.6 -Python 3.5

___
Python tracker 

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



[issue23262] webbrowser module broken with Firefox 36+

2016-10-26 Thread Oleg Broytman

Oleg Broytman added the comment:

Done.

--
versions:  -Python 2.7
Added file: http://bugs.python.org/file45228/webbrowser.py-3.5.patch

___
Python tracker 

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



[issue23262] webbrowser module broken with Firefox 36+

2016-10-26 Thread Oleg Broytman

Changes by Oleg Broytman :


Removed file: http://bugs.python.org/file45025/webbrowser.py-3.4-newfox.patch

___
Python tracker 

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



[issue23262] webbrowser module broken with Firefox 36+

2016-10-26 Thread Oleg Broytman

Changes by Oleg Broytman :


Removed file: http://bugs.python.org/file45216/webbrowser.py-3.5-newfox.patch

___
Python tracker 

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



[issue23262] webbrowser module broken with Firefox 36+

2016-10-26 Thread Oleg Broytman

Changes by Oleg Broytman :


Removed file: http://bugs.python.org/file45027/webbrowser.py-2.7-newfox.patch

___
Python tracker 

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



[issue23262] webbrowser module broken with Firefox 36+

2016-10-26 Thread Oleg Broytman

Changes by Oleg Broytman :


Removed file: 
http://bugs.python.org/file45218/test_webbrowser.py-3.5-newfox.patch

___
Python tracker 

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



[issue28353] os.fwalk() unhandled exception when error occurs accessing symbolic link target

2016-10-26 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


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



[issue23262] webbrowser module broken with Firefox 36+

2016-10-26 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Could you please provide a patch including all changes in unified format?

--

___
Python tracker 

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



[issue27838] test_os.test_chown() failure on koobs-freebsd-current

2016-10-26 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Proposed patch adds more verbose output in tests. Hope this will help to 
diagnose a problem.

It also fixes test_chown_without_permission which can fail if run as a user 
next after root (uid=1 or like).

--
keywords: +patch
nosy: +serhiy.storchaka
Added file: http://bugs.python.org/file45227/test_os_chown.patch

___
Python tracker 

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