[issue27604] More details about `-O` flag

2016-07-25 Thread Ram Rachum

Ram Rachum added the comment:

I'm sorry everyone, for being unpleasant on this thread. Rereading the thread 
from the beginning, I think I misunderstood Brett's message and immediately saw 
it as someone trying to block my efforts rather than just answering the 
question I asked.

Anyway, I attached my patch. A couple of questions:

1. As you can see in the patch, I also found a spot in `Doc/c-api/veryhigh.rst` 
where optimization mode was mentioned, so I figured let's add the "this may 
change in the future" comment there. But I don't know that area of the docs at 
all, so let me know if that makes sense there.

2. I believe these are the docs for Python 3.4, right? Can this change be 
merged into the documentation for all versions of Python?

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

___
Python tracker 

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



[issue27546] Integrate tkinter and asyncio (and async)

2016-07-25 Thread Terry J. Reedy

Terry J. Reedy added the comment:

[On #27579, Lodovic Gasc volunteered to open and help with an issue on the 
github asyncio-doc project.]

Ludovic, here is my current suggestion for the asyncio tutorial or how-to.

Adding a Tkinter GUI to an Asyncio Program
---

Assume that the tkinter Tk instance is called 'root' and the asyncio loop is 
called 'loop'. Add a callback loop like the following.

def tk_update():
root.update()
loop.call_soon(tk_update)  # or loop.call_later(delay, tk_update)

Call tk_update before each loop.run_forever() or loop.run_until_complete(...) 
call. Do not call root.mainloop() or root.quit().  Loop.stop() or completion of 
run_until_complete will stop the tk_update loop.  This method is used in the 
following example.
---

Follow this with loop_tk2.py as an example.  It is carefully written to be a 
template that people can build on.  Some notes:

0. I REALLY like being able to write tkinter animations with async for.

1. I initially called loop.close immediately after loop.stop in App.close.  
This is a natural think for a tkinter programmer to do.  But it does not work 
because loop.stop does not *immediately* take effect, and loop.close will 
typically get called before it does.  Now I understand that loop.close() must 
physically follow loop.run_xxx() to ensure that it temporally follows the 
actual stopping of the loop.

2. I did not initially make a list of tasks.  This worked once, but on the next 
run I got a "Task was destroyed but it is pending!:" message.  Cancelling all 
'forever' tasks makes for a clean shutdown.

If/when you open a thread, please post url here and I will subscribe.

[Guido, I will adapt this example for crawl.py.]

--
nosy: +Ludovic.Gasc
Added file: http://bugs.python.org/file43887/loop_tk2.py

___
Python tracker 

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



[issue27619] getopt should strip whitespace from long arguments

2016-07-25 Thread Steven D'Aprano

Steven D'Aprano added the comment:

On Tue, Jul 26, 2016 at 04:50:33AM +, Serhiy Storchaka wrote:

> My answer: if you don't want a space in your long_option, don't put a 
> space in there. There is no a bug in Python, 

That's why I listed it as an enhancement, not a bug.

> and the patch just complicates the code in attempt to fix one 
> particular user error.

Sure. But the extra complexity is tiny, and the benefit is real, and it 
makes Python getopt behave more like the shell getopt, which I think is 
appropriate.

--

___
Python tracker 

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



[issue27619] getopt should strip whitespace from long arguments

2016-07-25 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

It makes Python getopt behave less like the C getopt.

--

___
Python tracker 

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



[issue27619] getopt should strip whitespace from long arguments

2016-07-25 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

> On my Centos system, getopt ignores leading and trailing whitespace on long 
> options.

This is not related to how getopt_long in C works with leading and trailing 
whitespace on long options, but is related to how command-line utility getopt 
parses a list of long options.

My answer: if you don't want a space in your long_option, don't put a space in 
there. There is no a bug in Python, and the patch just complicates the code in 
attempt to fix one particular user error.

--
nosy: +serhiy.storchaka
resolution:  -> not a bug

___
Python tracker 

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



[issue27619] getopt should strip whitespace from long arguments

2016-07-25 Thread Steven D'Aprano

Steven D'Aprano added the comment:

Thanks for the quick review, I've fixed the issues you mentioned.

--
Added file: http://bugs.python.org/file43886/getopt.patch

___
Python tracker 

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



[issue26462] Patch to enhance literal block language declaration

2016-07-25 Thread Martin Panter

Changes by Martin Panter :


Added file: http://bugs.python.org/file43885/issue26462.v4_regen.diff

___
Python tracker 

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



[issue27619] getopt should strip whitespace from long arguments

2016-07-25 Thread Berker Peksag

Berker Peksag added the comment:

I left some review comments on Rietveld. I think we can treat this as a bug and 
fix it in 3.5 too.

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

___
Python tracker 

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



[issue24773] Implement PEP 495 (Local Time Disambiguation)

2016-07-25 Thread Martin Panter

Martin Panter added the comment:

Just confirming that my Casablanca failure is restricted to the 32-bit build, 
though I think you already figured this out.

--

___
Python tracker 

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



[issue27581] Fix overflow check in PySequence_Tuple

2016-07-25 Thread Martin Panter

Changes by Martin Panter :


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



[issue27579] Add a tutorial for AsyncIO in the documentation

2016-07-25 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Ludovic: Thank you for the offer.  When I post a proposed text with code to 
#27546, I will nosy you if you have not already done so by then.

Viktor: 'full integration' by adding a tk update in the standard _run_once is 
not possible as tkinter is not always present.  I started #27546 by creating a 
custom subclass, but that requires dealing with the Selector and Proactor 
subclasses and default loop policy and still will not work with independent 
implementations.  I considered a tk-loop implementation, but speed tests do not 
make that very inviting. The simple code I then tried is my current best 
recommendation.  It will work with any asyncio compatible implementation.  
Besides the test with IDLE, Guido tested it with Examples/crawl.py, and I will 
improve on that.

--

___
Python tracker 

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



[issue27614] Race in test_docxmlrpc.py

2016-07-25 Thread Martin Panter

Martin Panter added the comment:

The whole point of my suggestion was to bind and set the server socket to 
listing mode before starting the other thread. The socketserver constructor 
should do this before returning:

>>> s = DocXMLRPCServer(("localhost", 0))  # Calls bind() and listen()
>>> s.server_address  # Non-zero port has been allocated
('127.0.0.1', 49806)
>>> c = HTTPConnection(*s.server_address)
>>> c.request("OPTIONS", "*")  # No connection refused error

--

___
Python tracker 

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



[issue24773] Implement PEP 495 (Local Time Disambiguation)

2016-07-25 Thread Alexander Belopolsky

Alexander Belopolsky added the comment:

Could our Morocco issue be similar to Fiji issue?

https://github.com/eggert/tz/commit/6d00980f1ff2ac665f3de027c79faacf4f26d1b0

--

___
Python tracker 

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



[issue27614] Race in test_docxmlrpc.py

2016-07-25 Thread R. David Murray

R. David Murray added the comment:

Because the real port number doesn't exist until the server thread starts 
running and binds the socket using port number 0.

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



[issue24773] Implement PEP 495 (Local Time Disambiguation)

2016-07-25 Thread Alexander Belopolsky

Alexander Belopolsky added the comment:

The remaining failures all seems to be related to the Morocco rules: both 
Africa/El_Aaiun [1] and Africa/Casablanca [2] use those rules.

The affected date is October 4, 2037, for which Morocco has a special rule. [3]


It looks like the problem is with the system date/time library.  The 2037 
transition is specified in the tzfile as POSIX time 2138234400 and system date 
utility produced a value different from that of IANA's date [4]:

$ TZ=/usr/share/zoneinfo/Africa/El_Aaiun date -d @2138234400
Sun Oct  4 03:00:00 WEST 2037
$ TZ=/usr/share/zoneinfo/Africa/El_Aaiun ./date -r 2138234400
Sun Oct  4 02:00:00 WET 2037

[1]: https://github.com/eggert/tz/blob/2016f/africa#L917
[2]: https://github.com/eggert/tz/blob/2016f/africa#L901
[3]: https://github.com/eggert/tz/blob/2016f/africa#L898
[4]: https://github.com/eggert/tz/blob/2016f/date.c

--

___
Python tracker 

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



[issue27620] IDLE: Add keyboard equivalents for mouse actions.

2016-07-25 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 352fc11b9fd2 by Terry Jan Reedy in branch 'default':
Issue #27620: Escape key closes Query box as cancelled.
https://hg.python.org/cpython/rev/352fc11b9fd2

--
nosy: +python-dev

___
Python tracker 

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



[issue27620] IDLE: Add keyboard equivalents for mouse actions.

2016-07-25 Thread Terry J. Reedy

New submission from Terry J. Reedy:

Reading https://en.wikipedia.org/wiki/IBM_Common_User_Access and in particular 
"All operations could be done with either the mouse or the keyboard;", I 
checked IDLE's dialogs.

The Windows dialogs accessed as common dialogs work correctly.  I will assume 
true for other OSes until told otherwise.

The new Query widget recogizes  for [Ok] but not  for [Cancel]. 
 My omission, easily corrected.

Search boxes cannot set options with keys.  Notepad++ can.

The Options dialog has no key equivalents.

--
assignee: terry.reedy
components: IDLE
messages: 271311
nosy: terry.reedy
priority: normal
severity: normal
stage: test needed
status: open
title: IDLE: Add keyboard equivalents for mouse actions.
type: behavior
versions: Python 3.6

___
Python tracker 

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



[issue27619] getopt should strip whitespace from long arguments

2016-07-25 Thread Steven D'Aprano

New submission from Steven D'Aprano:

As reported here:

https://mail.python.org/pipermail/python-list/2016-July/711333.html

there's a possible annoyance with getopt when you accidentally leave whitespace 
on a long option. On my Centos system, getopt ignores leading and trailing 
whitespace on long options.

[steve@ando ~]$ getopt -o "" -l " spam , eggs " -- --spam --eggs arg
 --spam --eggs -- 'arg'


Python's getopt should do the same. (Patch attached.)

--
components: Library (Lib)
files: getopt.patch
keywords: patch
messages: 271310
nosy: steven.daprano
priority: normal
severity: normal
status: open
title: getopt should strip whitespace from long arguments
type: enhancement
versions: Python 3.6
Added file: http://bugs.python.org/file43884/getopt.patch

___
Python tracker 

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



[issue27614] Race in test_docxmlrpc.py

2016-07-25 Thread Martin Panter

Martin Panter added the comment:

I don’t understand why we have so many tests that assign the server port in the 
server thread, and then use some sort of synchronization to get it to the 
client thread. IMO it would be simpler in this case to do something like:

def setUp(self):
serv = DOCXMLRPCServer(...)
self.addCleanup(serv.server_close)
[_, PORT] = serv.server_address  # Eliminates “ready“ event
# Other server setup here
thread = threading.Thread(target=serv.serve_forever)
thread.start()
self.addCleanup(thread.join)  # Instead of self.evt
self.addCleanup(serv.shutdown)
self.client = httplib.HTTPConnection("localhost:%d" % PORT)
self.addCleanup(self.client.close)

--
components: +Tests -Library (Lib)
nosy: +martin.panter
stage:  -> patch review
versions:  -Python 3.2, 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



[issue27618] docs for threading.Lock claim it's a class (since 3.3), but it's not (and has never been, apparently)

2016-07-25 Thread Guido van Rossum

Changes by Guido van Rossum :


--
assignee:  -> docs@python
components: +Documentation
nosy: +docs@python
versions: +Python 3.3, Python 3.4, Python 3.5, Python 3.6

___
Python tracker 

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



[issue27617] Compiled bdist_wininst missing from embedded distribution

2016-07-25 Thread Steve Dower

Steve Dower added the comment:

Also, the doc page at https://docs.python.org/3.5/using/windows.html describes 
this in more detail. (Though it doesn't yet refer to the Nuget packages as 
those are an experiment that I may or may not continue.)

--

___
Python tracker 

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



[issue27617] Compiled bdist_wininst missing from embedded distribution

2016-07-25 Thread Steve Dower

Steve Dower added the comment:

This is deliberate. You should "vendor" packages into the embedded distro by 
copying them from an install into a regular one. Your application installer 
should put the correct files onto the user's machine - don't rely on pip.

If that last sentence didn't make sense, then you probably shouldn't be using 
the embedded distro. If you're just looking for a lightweight install of Python 
that doesn't have any obvious entry points or registration, see whether 
https://www.nuget.org/packages/python/ fits your needs.

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

___
Python tracker 

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



[issue27618] docs for threading.Lock claim it's a class (since 3.3), but it's not (and has never been, apparently)

2016-07-25 Thread R. David Murray

R. David Murray added the comment:

The relevant issue is #10968.  Apparently while editing the doc changes I 
caught the fact that RLock wasn't actually converted, but I missed the fact 
that Lock wasn't converted.  So, it is a doc error and should be corrected.

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



[issue27618] docs for threading.Lock claim it's a class (since 3.3), but it's not (and has never been, apparently)

2016-07-25 Thread Guido van Rossum

New submission from Guido van Rossum:

The docs for threading.Lock say


79534:.. versionchanged:: 3.3
79534:   Changed from a factory function to a class.

but the implementation in threading.py doesn't define a class named Lock, and 
in fact it is an alias for _thread.allocate_lock.

Are the docs wrong, or is the source? Or did this get changed back later?

--
messages: 271305
nosy: gvanrossum
priority: normal
severity: normal
status: open
title: docs for threading.Lock claim it's a class (since 3.3), but it's not 
(and has never been, apparently)

___
Python tracker 

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



[issue27612] socket.gethostbyname resolving octal IP addresses incorrectly

2016-07-25 Thread Eryk Sun

Eryk Sun added the comment:

socket.gethostbyname calls the internal function setipaddr, which tries to 
avoid a name resolution by first calling either inet_pton or inet_addr. 
Otherwise it calls getaddrinfo.

Windows
---

setipaddr calls inet_addr, which supports octal [1]. ctypes example:

ws2_32 = ctypes.WinDLL('ws2_32')
in_addr = ctypes.c_ubyte * 4
ws2_32.inet_addr.restype = in_addr

>>> ws2_32.inet_addr(b'0177...0001')[:]
[127, 0, 0, 1]

3.5+ could call inet_pton since it was added in Vista. However, it does not 
support octal:

>>> addr = in_addr()
>>> ws2_32.inet_pton(socket.AF_INET, b'0177...0001', addr)
0
>>> ws2_32.inet_pton(socket.AF_INET, b'127.0.0.1', addr)
1
>>> addr[:]
[127, 0, 0, 1]

socket.inet_pton instead calls WSAStringToAddressA, which does support octal:

>>> list(socket.inet_pton(socket.AF_INET, '0177...0001'))
[127, 0, 0, 1]

socket.gethostbyname_ex calls gethostbyname since gethostbyname_r isn't 
defined. This does not support octal and errors out:

>>> socket.gethostbyname_ex('0177...0001')
Traceback (most recent call last):
  File "", line 1, in 
socket.herror: [Errno 11001] host not found

getaddrinfo also does not support octal and errors out:

>>> socket.getaddrinfo('0177...0001', None)[0]
Traceback (most recent call last):
  File "", line 1, in 
  File "C:\Program Files\Python35\lib\socket.py", line 732, in getaddrinfo
for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno 11001] getaddrinfo failed

>>> ctypes.FormatError(11001)
'No such host is known.'

[1]: https://msdn.microsoft.com/en-us/library/ms738563#internet_addresses

--
nosy: +eryksun

___
Python tracker 

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



[issue27617] Compiled bdist_wininst missing from embedded distribution

2016-07-25 Thread Ned Deily

Changes by Ned Deily :


--
components: +Windows -Distutils
nosy: +paul.moore, steve.dower, tim.golden, zach.ware -dstufft, eric.araujo

___
Python tracker 

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



[issue27615] IDLE's debugger steps into PyShell.py for calls to print() et al

2016-07-25 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Whether or not to step in idlelib/pyshell.py is part of the general issue of 
stepping into any idlelib file #15335.  I copied the above to that issue.

--
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> IDLE - debugger steps into print and over rpc.py code

___
Python tracker 

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



[issue15335] IDLE - debugger steps into print and over rpc.py code

2016-07-25 Thread Terry J. Reedy

Terry J. Reedy added the comment:

In #27615, which I will close as a duplicate of this, Al Sweigart wrote

"Currently if the user "steps into" a print(), input(), sys.stdout.write() or 
other stdio-related call with the Source checkbox checked, it brings up 
PyShell.py.

This is often confusing for beginner programmers (the target audience of IDLE) 
and most often not helpful for experienced developers who are stepping through 
their program. Comparing the cost/benefit, I'd be much more helpful for IDLE to 
not bring up PyShell.py and instead just treat every "step into" of a 
print()/input()/anything-that-goes-to-pyshell as a "step over" instead."

I have changed my opinion from what I wrote a couple of years ago and now 
agree.  Print and input are different from stdlib functions, such as, "import 
asyncio; loop = asyncio.get_event_loop", in that they are used by nearly all 
beginners, are not imported, and are normally C-coded builtins that cannot be 
stepped into.  If one debugs an import- free program, it is startling to be 
dropped into foreign code.

IDLE should execute and debug user code as transparently as possible.  I now 
think that the debugger should not step into any idlelib file unless this is 
explicitly requested in a separate check box ('for IDLE maintainers'.  I 
suspect a blanket no-idlelib or yes-idlelib policy will be faster than the 
current code, and would avoid the current bug of not stepping into user code.

I recently moved the Pseudofile definitions from pyshell to run so that run 
does not need to import pyshell.  I did not consider whether or how this would 
affect debugging and should not have to. I plan other refactorings and 
movements between files.

Whether to worry about stepping in  is a different 
issue, and one not specific to IDLE.

--
assignee:  -> terry.reedy
nosy: +Al.Sweigart
versions: +Python 3.6 -Python 2.7, Python 3.4, Python 3.5

___
Python tracker 

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



[issue27604] More details about `-O` flag

2016-07-25 Thread Stefan Krah

Changes by Stefan Krah :


--
nosy:  -skrah

___
Python tracker 

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



[issue27617] Compiled bdist_wininst missing from embedded distribution

2016-07-25 Thread Michael Smith

New submission from Michael Smith:

It seems that the embedded distribution is missing bdist_wininst.pyc from the 
python35.zip .  If you go to distutils\command, you'll notice only 23 compiled 
python files, where in the regular web based installer for the same Python 
version there are 24 python files in similar relevant folder.  I encountered 
this while trying to install a library into the python runtime that had this 
import statement:

import distutils.command.bdist_wininst

--
components: Distutils
messages: 271301
nosy: denimpowell, dstufft, eric.araujo
priority: normal
severity: normal
status: open
title: Compiled bdist_wininst missing from embedded distribution
type: compile error
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



[issue24773] Implement PEP 495 (Local Time Disambiguation)

2016-07-25 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 8cc06070e98b by Alexander Belopolsky in branch 'default':
Issue 24773: Added a time_t overflow check.
https://hg.python.org/cpython/rev/8cc06070e98b

--

___
Python tracker 

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



[issue27616] filedialog.askdirectory inconsistent on Windows between returning "C:/" and "C:/users" (no trailing slash)

2016-07-25 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

"C:" is current directory on drive C, "C:/" is root directory on drive C. This 
is not related to Python or Tk, this is how paths work.

Use os.path or pathlib for processing paths.

--
nosy: +serhiy.storchaka
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



[issue27604] More details about `-O` flag

2016-07-25 Thread Brett Cannon

Brett Cannon added the comment:

If you had viewed the comment as esoteric, Ram, then you could have politely 
asked for a more in-depth explanation. To me the explanation seemed clear: the 
optimizations had not been documented so we could feel free in changing what -O 
meant without breaking any assumptions people had made. I didn't think about 
suggesting a doc patch saying as such while still documenting what it currently 
does until after I explained why the documentation is the way it is.

As for discouraging contributions, please stop and think about how your 
messages read to newcomers to bugs.python.org. If I had never contributed and 
stumbled upon this issue thinking it was an easy one to help with and I saw an 
openly antagonistic message, I would think twice about participating if that 
was the kind of attitude I might be confronted with.

And then think about how this discourages me from contributing. I took personal 
time out of my weekend to give you a prompt reply to your issue instead of 
making you wait until Monday or until someone else happened to reply so you 
knew the issue was noticed and you didn't start working on a patch that may not 
get accepted. And in response to me taking the time to respond to your message 
I get an antagonistic response. How does that in any way inspire me to want to 
help you out with this issue? And I certainly don't need this documentation 
change as I know what -O and -OO do, so if my time to try and help someone with 
an issue I don't directly benefit from leads to me getting grief for my efforts 
then why should I bother helping anyone unless it also helps me? It's this sort 
of tone in communication that is unnecessarily hostile towards project 
maintainers that leads to burnout and long-term contributors such as myself 
walking away from a project (and I'm not stating this lightly; thi
 s is just one instance in a string of incidents like this where I have been 
treated poorly that has convinced me to take some time off from helping others 
in my spare time after Python 3.6b1 is released to prevent me from quitting the 
Python project entirely).

I'm going to remove myself from the nosy list so that I recuse myself from this 
issue so that my feelings about this whole situation doesn't influence any 
potential patch review.

--

___
Python tracker 

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



[issue27604] More details about `-O` flag

2016-07-25 Thread Brett Cannon

Changes by Brett Cannon :


--
nosy:  -brett.cannon

___
Python tracker 

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



[issue27616] filedialog.askdirectory inconsistent on Windows between returning "C:/" and "C:/users" (no trailing slash)

2016-07-25 Thread Grant Hillebrand

New submission from Grant Hillebrand:

When running the following code on Windows 7 (64bit os), and selecting a root 
drive letter, eg C:, it returns "C:/", with a slash appended. When selecting 
any other path below root level, eg "C:/users" it returns "C:/users" - no slash 
appended. 
This then introduces an odd edge case in processing the output if the path is 
to be prepended to directory walk data and other file names.

Python 3.5.2 (v3.5.2:4def2a2901a5, Jun 25 2016, 22:18:55) [MSC v.1900 64 bit 
(AMD64)] on win32

>>> from tkinter import filedialog
>>> SourcePath = filedialog.askdirectory()
>>> print(SourcePath)
C:/
>>> SourcePath = filedialog.askdirectory()
>>> print(SourcePath)
C:/NVIDIA
>>>

--
components: Tkinter, Windows
messages: 271296
nosy: Grant Hillebrand, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: filedialog.askdirectory inconsistent on Windows between returning "C:/" 
and "C:/users" (no trailing slash)
type: behavior
versions: Python 3.3, Python 3.5

___
Python tracker 

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



[issue27615] IDLE's debugger steps into PyShell.py for calls to print() et al

2016-07-25 Thread Al Sweigart

New submission from Al Sweigart:

Currently if the user "steps into" a print(), input(), sys.stdout.write() or 
other stdio-related call with the Source checkbox checked, it brings up 
PyShell.py.

This is often confusing for beginner programmers (the target audience of IDLE) 
and most often not helpful for experienced developers who are stepping through 
their program. Comparing the cost/benefit, I'd be much more helpful for IDLE to 
not bring up PyShell.py and instead just treat every "step into" of a 
print()/input()/anything-that-goes-to-pyshell as a "step over" instead.

--
assignee: terry.reedy
components: IDLE
messages: 271295
nosy: Al.Sweigart, terry.reedy
priority: normal
severity: normal
status: open
title: IDLE's debugger steps into PyShell.py for calls to print() et al
versions: Python 3.6

___
Python tracker 

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



[issue27612] socket.gethostbyname resolving octal IP addresses incorrectly

2016-07-25 Thread Matt Robenolt

Matt Robenolt added the comment:

Ah, I just confirmed broken behavior in macOS as well using `getaddrinfo()` in 
C.

I guess I'd be ok with python ignoring this as well. Maybe worth a change to 
documentation to note this?

--

___
Python tracker 

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



[issue27612] socket.gethostbyname resolving octal IP addresses incorrectly

2016-07-25 Thread Xiang Zhang

Xiang Zhang added the comment:

A similar bug report can be seen at 
https://github.com/dotnet/corefx/issues/8362. There someone makes a conclusion 
that getaddrinfo (Python seems to use getaddrinfo to implement gethostbyname) 
doesn't work correctly with octal form. They finally ignore this inconsistent 
behaviour.

--

___
Python tracker 

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



[issue26851] android compilation and link flags

2016-07-25 Thread Xavier de Gaye

Xavier de Gaye added the comment:

Thanks for the suggestion, I won't include them anymore in patches then.

--

___
Python tracker 

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



[issue26944] android: test_posix fails

2016-07-25 Thread Xavier de Gaye

Xavier de Gaye added the comment:

The test is already skipped by the patch, for Android API level < 23, with the 
statement:
raise unittest.SkipTest("need working 'id -G'")

Do you mean that the test should be skipped instead more explicitly with 
something like:
skiIf(support.android_api_level < 23, "-G option of id -G is ignored by 
Android")

--

___
Python tracker 

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



[issue27612] socket.gethostbyname resolving octal IP addresses incorrectly

2016-07-25 Thread Matt Robenolt

Matt Robenolt added the comment:

Is it worth investigating the different behavior then with `getaddrinfo` 
between platforms? As far as I know, that's the only method that works with 
both ipv6 and will tell you "here are all the IP addresses this resolves to".

--

___
Python tracker 

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



[issue27612] socket.gethostbyname resolving octal IP addresses incorrectly

2016-07-25 Thread R. David Murray

R. David Murray added the comment:

Hmm.  Since gethostbyname is a deprecated interface, perhaps there is nothing 
to do here.

However, if someone wants to investigate further and finds a fix, we will 
evaluate it.

--

___
Python tracker 

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



[issue27366] PEP487: Simpler customization of class creation

2016-07-25 Thread Guido van Rossum

Changes by Guido van Rossum :


--
nosy:  -gvanrossum

___
Python tracker 

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



[issue11190] test_locale error on AIX

2016-07-25 Thread STINNER Victor

STINNER Victor added the comment:

I know that test_locale fails on AIX, but I don't think that it's an issue in 
Python itself. Python exposes OS functions. I suggest to simply skip failing 
tests on AIX!

--

___
Python tracker 

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



[issue27366] PEP487: Simpler customization of class creation

2016-07-25 Thread Martin Teichmann

Martin Teichmann added the comment:

I looked over the patch once more and found some places where
I didn't follow normal coding standards. I changed that, namely
now the code returns -1 meaning an exception happened and 0 on
success, which is what many functions in typeobject.c do.

So I think this patch should be ready.

--
Added file: http://bugs.python.org/file43882/pep487.patch

___
Python tracker 

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



[issue11190] test_locale error on AIX

2016-07-25 Thread Michael Felt

Michael Felt added the comment:

FYI: this seems to still be current, although issue11193 seems okay.

michael@x071:[/data/prj/aixtools/python/python-3.6.0.162/Lib/test]../../python 
test_locale.py
..testing with 'en_US.ISO8859-1'... .testing with 
'en_US.ISO8859-1'... Ftesting with 'en_US.ISO8859-1'... .testing with 
'en_US.ISO8859-1'... F.stesting with 
'en_US.ISO8859-1'... .testing with 'en_US.ISO8859-1'... .testing with 
'en_US.ISO8859-1'... .testing with 'en_US.ISO8859-1'... .testing with 
'en_US.ISO8859-1'... .testing with 'en_US.ISO8859-1'... .testing with 
'en_US.ISO8859-1'... 
==
FAIL: test_strcoll_with_diacritic (__main__.TestEnUSCollation)
--
Traceback (most recent call last):
  File "test_locale.py", line 362, in test_strcoll_with_diacritic
self.assertLess(locale.strcoll('▒', 'b'), 0)
AssertionError: 1 not less than 0

==
FAIL: test_strxfrm_with_diacritic (__main__.TestEnUSCollation)
--
Traceback (most recent call last):
  File "test_locale.py", line 365, in test_strxfrm_with_diacritic
self.assertLess(locale.strxfrm('▒'), locale.strxfrm('b'))
AssertionError: '\u01e2\u0100' not less than '\u0164\u0100'

--
Ran 58 tests in 0.050s

FAILED (failures=2, skipped=1)

FYI: make check for libiconv-1.14 has exit status 0.

--
nosy: +Michael.Felt

___
Python tracker 

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



[issue26944] android: test_posix fails

2016-07-25 Thread STINNER Victor

STINNER Victor added the comment:

Ooops, I missed the part where you say that it works on API level >= 23. So I 
suggest to only skip the test on Android API level < 23.

--

___
Python tracker 

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



[issue27612] socket.gethostbyname resolving octal IP addresses incorrectly

2016-07-25 Thread Matt Robenolt

Matt Robenolt added the comment:

And lastly, it seems that `socket.gethostbyname_ex` _does_ work correctly on 
both platforms.

```
>>> socket.gethostbyname_ex('0177...0001')
('0177...0001', [], ['127.0.0.1'])
```

--

___
Python tracker 

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



[issue27612] socket.gethostbyname resolving octal IP addresses incorrectly

2016-07-25 Thread Matt Robenolt

Matt Robenolt added the comment:

Sorry, to add a data point, in C, `gethostbyname` also does the correct thing 
on macOS.

See:

```
#include 
#include 
#include 
#include 
#include 
#include 
#include 

int main(int argc, char *argv[]) {
int i;
struct hostent *lh = gethostbyname("0177...0001");
struct in_addr **addr_list;

if (lh) {
addr_list = (struct in_addr **)lh->h_addr_list;
for (i=0; addr_list[i] != NULL; i++) {
printf("%s", inet_ntoa(*addr_list[i]));
}
printf("\n");
} else {
herror("gethostbyname");
}

return 0;
}
```

So I'm not sure this is platform specific.

Either way, `socket.gethostbyname` is wrong on both linux and macOS. I'm a bit 
lost with what's going on here though, admittedly. :)

--

___
Python tracker 

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



[issue26851] android compilation and link flags

2016-07-25 Thread STINNER Victor

STINNER Victor added the comment:

Note: build-flags_3.patch includes configure.ac and configure. Usually, we 
suggest to not included generated files (configure) in patches, but push them 
when the patch is ready.

--

___
Python tracker 

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



[issue11193] test_subprocess error on AIX

2016-07-25 Thread Michael Felt

Michael Felt added the comment:

Seems to be okay at least with Python 3.6 "test" version - but maybe there is 
better way to call these tests - just to be sure the one needed is not being 
skipped.

On AIX 5.3 TL7 SP0:

root@x064:[/data/prj/aixtools/python/python-3.6.0.162/Lib/test]../../python 
test_subprocess.py
...s...s.s.s...s.s.s.s
--
Ran 254 tests in 113.796s

OK (skipped=24)

On AIX 6.1 TL9 SP4:

michael@x071:[/data/prj/aixtools/python/python-3.6.0.162/Lib/test]../../python 
test_subprocess.py
...s...s.s.s...s.s.s.s
--
Ran 254 tests in 126.684s

OK (skipped=24)
michael@x071:[/data/prj/aixtools/python/python-3.6.0.162/Lib/test]

Please note that GNU libiconv is used by default (version 1.14) rather than IBM 
iconv.

This may be the key issue (will test 11190 as well)

--
nosy: +Michael.Felt

___
Python tracker 

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



[issue26944] android: test_posix fails

2016-07-25 Thread STINNER Victor

STINNER Victor added the comment:

Sorry but I don't see the point of trying to "fix" the unit test on
Android if "id -G" doesn't work as expected.

In fact, I don't really understand the point of such functional test.
Are we still testing Python? Or are we testing the OS itself?

I suggest to remove the whole unit test, or skip the whole unit test
on Android (@skipIf(is_android(), "-G option of id -G is ignored"),
something like that).

--

___
Python tracker 

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



[issue27614] Race in test_docxmlrpc.py

2016-07-25 Thread earl.chew

New submission from earl.chew:

The test test_docxmlrpc.py will sometimes hang because of a timing race.

I've verified that this code is the same up to version 3.5 and master at 
https://github.com/python/cpython/blob/master/Lib/test/test_docxmlrpc.py

A proposed patch is attached.

--
components: Library (Lib)
files: test_docxmlrpc.py
messages: 271279
nosy: earl.chew
priority: normal
severity: normal
status: open
title: Race in test_docxmlrpc.py
type: behavior
versions: Python 2.7, Python 3.2, Python 3.3, Python 3.4, Python 3.5, Python 3.6
Added file: http://bugs.python.org/file43881/test_docxmlrpc.py

___
Python tracker 

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



[issue24875] pyvenv doesn´t install PIP inside a new venv with --system-site-package

2016-07-25 Thread Mark

Mark added the comment:

I have the same problem on a standard installation of Python 3.5 (on OS X via 
Homebrew). This bug is almost a year old, and it is a doozy: it utterly defeats 
the purpose of --system-site-packages. 

In the hope of getting some momentum going, I tried out the option suggested by 
dstufft: adding --ignore-installed in ensurepip's bootstrap() does seem to fix 
the problem.

I've never contributed a patch to Python before so I've probably screwed this 
up, but I'm attaching a patch that applies against latest python 3.5 on github 
(1b279c2). Sorry, I don't know what the equivalent Hg hash is, but this is a 
pretty minimal patch so it should be easy to apply.

--
keywords: +patch
nosy: +mehaase
versions: +Python 3.5
Added file: http://bugs.python.org/file43880/0001-Fix-issue-24875.patch

___
Python tracker 

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



[issue11192] test_socket error on AIX

2016-07-25 Thread Michael Felt

Michael Felt added the comment:

FYI: test fails on AIX 5.3 TL7 SP0 (as expected. The IBM document refers to 5.3 
TL8)

On AIX 6.1 TL9 SP5 (and probably earlier) the test passes. IMHO - can be closed 
(and README.AIX can be updated).

michael@x071:[/data/prj/aixtools/python/python-2.7.11.5/Lib/test]oslevel -q -s 
| head -5
Known Service Packs
---
6100-09-05-1524
6100-09-04-1441

michael@x071:[/data/prj/aixtools/python/python-2.7.11.5/Lib/test]../../python 
test_socket.py
...
--
Ran 124 tests in 15.860s

OK (skipped=7)

On AIX 5.3 (the expected fail...)
root@x064:[/data/prj/aixtools/python/python-2.7.11.5/Lib/test]oslevel -q -s | 
head -5
Known Service Packs
---
5300-07-00-
5300-06-03-0732

root@x064:[/data/prj/aixtools/python/python-2.7.11.5/Lib/test]../../python 
test_socket.py

...

==
FAIL: testGetaddrinfo (__main__.GeneralModuleTests)
--
Traceback (most recent call last):
  File "test_socket.py", line 691, in testGetaddrinfo
self.assertEqual(socktype, socket.SOCK_STREAM)
AssertionError: 0 != 1

--
Ran 124 tests in 16.765s

FAILED (failures=1, skipped=7)
Traceback (most recent call last):
  File "test_socket.py", line 1804, in 
test_main()
  File "test_socket.py", line 1800, in test_main
test_support.run_unittest(*tests)
  File "/data/prj/aixtools/python/python-2.7.11.5/Lib/test/test_support.py", 
line 1428, in run_unittest
_run_suite(suite)
  File "/data/prj/aixtools/python/python-2.7.11.5/Lib/test/test_support.py", 
line 1411, in _run_suite
raise TestFailed(err)
test.test_support.TestFailed: Traceback (most recent call last):
  File "test_socket.py", line 691, in testGetaddrinfo
self.assertEqual(socktype, socket.SOCK_STREAM)
AssertionError: 0 != 1

--
nosy: +Michael.Felt

___
Python tracker 

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



[issue27576] An unexpected difference between dict and OrderedDict

2016-07-25 Thread Xiang Zhang

Xiang Zhang added the comment:

I didn't think about order. I just thought using concrete API may be faster. 
But after your comment, I tested the performance and it seems PyDict_Items 
makes it much slower (it does more work, eg, make tuples). So I agree it is not 
needed at all.

--
Added file: http://bugs.python.org/file43879/odict_update_v2.patch

___
Python tracker 

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



[issue26851] android compilation and link flags

2016-07-25 Thread Xavier de Gaye

Xavier de Gaye added the comment:

The first 'build-flags_3.patch' file that was uploaded did not get a review 
button because ssh://h...@hg.python.org/cpython was down at that time.

The second upload has been successfull !

--

___
Python tracker 

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



[issue26851] android compilation and link flags

2016-07-25 Thread Xavier de Gaye

Changes by Xavier de Gaye :


Added file: http://bugs.python.org/file43878/build-flags_3.patch

___
Python tracker 

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



[issue27604] More details about `-O` flag

2016-07-25 Thread Stefan Krah

Stefan Krah added the comment:

I can see nothing wrong with msg271168. It's polite, informative, not apodictic 
and does not rule out the possibility of accepting a patch.

Also, it answers a direct question from msg271142.

--
nosy: +skrah

___
Python tracker 

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



[issue26944] android: test_posix fails

2016-07-25 Thread Xavier de Gaye

Xavier de Gaye added the comment:

> Hum, does the id program supports -G on Android?

It does on Android 6.0 but prints the same result as 'id' (without -G) on 
previous Android versions.

Here is the output of the commands involved in the test for the root user on my 
archlinux box, the Android 5.0 emulator and the Android 6.0 emulator:

archlinux:
  [root@bilboquet default]# python
  ...
  >>> from posix import getegid, getgroups
  >>> getgroups()
  [0, 1, 2, 3, 4, 6, 10, 19]
  >>> getegid()
  0
  [root@bilboquet default]# id -G
  0 1 2 3 4 6 10 19

Android 5.0 (API level 21)
  root@generic_x86:/data/data/org.bitbucket.pyona # python
  ...
  >>> from posix import getegid, getgroups
  >>> getgroups()
  [1003, 1004, 1007, 1011, 1015, 1028, 3001, 3002, 3003, 3006]
  >>> getegid()
  0
  root@generic_x86:/data/data/org.bitbucket.pyona # id -G
  uid=0(root) gid=0(root) 
groups=1003(graphics),1004(input),1007(log),1011(adb),1015(sdcard_rw),1028(sdcard_r),3001(net_bt_admin),3002(net_bt),3003(inet),3006(net_bw_stats)

Android 6.0 (API level 23)
  root@generic_x86:/data/data/org.bitbucket.pyona # python
  ...
  >>> from posix import getegid, getgroups
  >>> getgroups()
  [1004, 1007, 1011, 1015, 1028, 3001, 3002, 3003, 3006]
  >>> getegid()
  0
  root@generic_x86:/data/data/org.bitbucket.pyona # id -G
  1004 1007 1011 1015 1028 3001 3002 3003 3006

--

___
Python tracker 

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



[issue27604] More details about `-O` flag

2016-07-25 Thread Ram Rachum

Ram Rachum added the comment:

Thanks for your understanding David.

I'll submit a patch for this issue soon.

--

___
Python tracker 

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



[issue27613] Empty iterator is rendered as a single bracket ] when using json's iterencode

2016-07-25 Thread R. David Murray

R. David Murray added the comment:

If you break the invariants (in this case: a list has an accurate len) code 
that expects lists is only going to work by accident.

What you really want to do is define your own json encoder for your type.  If 
that isn't possible for a streamed sequence of undefined length, then enhancing 
json's extension machinery to allow it would be a good feature request.

That said, could json's ability to handle this be improved?  Possibly.  I think 
we would accept a patch if it doesn't make the code more complicated.  Ideally 
handling certain cases as "don't care" makes the code simpler, but that may or 
may not be the case here.  Or it may come out as a consequence of the 
enhancement.

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



[issue27612] socket.gethostbyname resolving octal IP addresses incorrectly

2016-07-25 Thread Xiang Zhang

Xiang Zhang added the comment:

On Linux, it seems it's not an accident. inet_addr(3) explicitly says it can 
handle octal or haxadecimal forms.

--
nosy: +xiang.zhang

___
Python tracker 

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



[issue27604] More details about `-O` flag

2016-07-25 Thread R. David Murray

R. David Murray added the comment:

Heh, clarification on "we're explicit about this".  I was referring to Nick's 
aphorism, "The status quo wins a tie", which means that there has to be a 
*postive* reason to change the status quo.  That's what we're explicit about.

--

___
Python tracker 

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



[issue13963] dev guide has no mention of mechanics of patch review

2016-07-25 Thread Mark Lawrence

Changes by Mark Lawrence :


--
nosy:  -BreamoreBoy

___
Python tracker 

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



[issue27604] More details about `-O` flag

2016-07-25 Thread R. David Murray

R. David Murray added the comment:

Ram: Brett gave you the benefit of the doubt on whether or not your comment was 
*intended* to be antagonistic.  Brett's comment was giving you the historical 
context for why it isn't documented, but said nothing about what we might do 
now.  In fact, his use of the term "historically" implies that we could 
re-evaluate things now if we wish to, whether or not he meant that.  You could 
have given him the benefit of the doubt.  I know that is often hard, though.  
I've reacted negatively to a comment often enough myself that these days I try 
very hard to think two or three times about what the most charitable 
interpretation could be, and what the best way would be for moving the 
conversation forward in my response even if the other party really is being 
antagonistic.  I've found that this works well more often than not.

But yes, it is good for us to be reminded periodically that we should think 
about being welcoming any time we respond to a contribution.  (On the other 
hand, you aren't exactly a new contributor, so Brett may have assumed he could 
take some shortcuts in speaking to you.)

Also, you will find in *every* community that there is a tendency to "defend 
the status quo" (and we're explicit about this), so sometimes you do have to 
mount an argument for changing it.  That's just human nature, but is also 
something I've been trying to train myself to be aware of (I'm still working on 
getting better at both of these :)

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



[issue25170] 3.4.4, 3.4.5, 3.5.0, 3.5.1, 3.5.2 documentation archives missing

2016-07-25 Thread Ned Deily

Ned Deily added the comment:

The actions in PEP 101 cited by Georg in msg251105 above still need to be done.

--

___
Python tracker 

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



[issue27612] socket.gethostbyname resolving octal IP addresses incorrectly

2016-07-25 Thread R. David Murray

R. David Murray added the comment:

To clarify: by platform OS issue, I mean that the octal-conversion-or-not is 
none of Python's doing, it is done by the C library call that gethostbyname is 
a thin wrapper around.

--

___
Python tracker 

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



[issue27612] socket.gethostbyname resolving octal IP addresses incorrectly

2016-07-25 Thread R. David Murray

R. David Murray added the comment:

This would appear to be a platform OS issue.  Is it "broken" also for FreeBSD?  
(I put broken in quotes because  interpreting ocatal isn't part of the posix 
speck for gethostbyname.  It could even be an accident that it works on Linux.

I'm not going to close this yet, since it might be worth a doc issue, or at 
least documenting here what the status of this is on FreeBSD.

--
nosy: +koobs, r.david.murray

___
Python tracker 

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



[issue27607] Importing the main module twice leads to two incompatible instances

2016-07-25 Thread R. David Murray

R. David Murray added the comment:

If you have any sort of implementation of the pep, proving that it does fix 
this issue would be informative.

--

___
Python tracker 

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



[issue26462] Patch to enhance literal block language declaration

2016-07-25 Thread Martin Panter

Martin Panter added the comment:

I think generating it with Mercurial (and not using Mercurial’s Git patch 
format) is the best way. I just left some more notes at 
.

--

___
Python tracker 

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



[issue25170] 3.4.4, 3.4.5, 3.5.0, 3.5.1, 3.5.2 documentation archives missing

2016-07-25 Thread Martin Panter

Martin Panter added the comment:

The documentation for recent releases looks nice and functional now, thanks. So 
at least that aspect is fixed.

--

___
Python tracker 

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



[issue27590] tarfile module next() method hides exceptions

2016-07-25 Thread Yujie Chen

Yujie Chen added the comment:

I do want tarfile module to stop at the first invalid header. My question is 
why does tarfile module NOT throw exception about the error in header, instead 
it just hide it silently.

--

___
Python tracker 

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



[issue13963] dev guide has no mention of mechanics of patch review

2016-07-25 Thread Martin Panter

Martin Panter added the comment:

FTR: The Mercurial bug has wandered to 
. It suggests using “hg 
--config diff.git=0 diff”.

Also, this 2011 post has some details of how the Git patch format is accepted 
or not (not sure if anything has changed since then):
https://mail.python.org/pipermail/python-dev/2011-March/110163.html

--
nosy: +martin.panter

___
Python tracker 

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



[issue27613] Empty iterator is rendered as a single bracket ] when using json's iterencode

2016-07-25 Thread Grigory Statsenko

Grigory Statsenko added the comment:

With streaming you never know the real length before you're done iterating.

Anyway, the fix really shouldn't be that complicated:
In _iterencode_list just yield  the '[' instead of saving it to buf

--

___
Python tracker 

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



[issue27613] Empty iterator is rendered as a single bracket ] when using json's iterencode

2016-07-25 Thread Grigory Statsenko

Grigory Statsenko added the comment:

If __len__ is not defined, then the iterator is considered empty and is always 
rendered as [] even if it really isn't empty

--

___
Python tracker 

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



[issue26944] android: test_posix fails

2016-07-25 Thread STINNER Victor

STINNER Victor added the comment:

> ValueError: invalid literal for int() with base 10: 'uid=0(root)'

Hum, does the id program supports -G on Android? The output looks like the 
regular id output (without -G). Example on my Linux (Fedora 24):

$ id
uid=1000(haypo) gid=1000(haypo) groupes=1000(haypo),10(wheel) 
contexte=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023

$ id -G
1000 10

--

___
Python tracker 

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



[issue27576] An unexpected difference between dict and OrderedDict

2016-07-25 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I think this case (fast path for exact dict) is not needed at all. Exact dict 
is not ordered, and OrderedDict created from exact dict has nondetermined order 
(unless a dict has size 0 or 1).

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue27613] Empty iterator is rendered as a single bracket ] when using json's iterencode

2016-07-25 Thread SilentGhost

SilentGhost added the comment:

The question is why are you defining __len__ if you don't know the size of your 
final object? Or at least, why are you starting with a potentially wrong 
initial value? This issue doesn't exist if you either don't define the method 
or return correct value.

--

___
Python tracker 

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



[issue27613] Empty iterator is rendered as a single bracket ] when using json's iterencode

2016-07-25 Thread Grigory Statsenko

Grigory Statsenko added the comment:

My bad - it doesn't work with non-empty iterators if you set len to 0, so not a 
solution

--

___
Python tracker 

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



[issue27607] Importing the main module twice leads to two incompatible instances

2016-07-25 Thread Emanuel Barry

Emanuel Barry added the comment:

@Cameron - I don't think this issue can be solved without the PEP, so possibly 
that the best move would be to work on the PEP and submit it for another round 
on Python-Dev, to get it reviewed. Thanks!

--

___
Python tracker 

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



[issue27613] Empty iterator is rendered as a single bracket ] when using json's iterencode

2016-07-25 Thread Grigory Statsenko

Grigory Statsenko added the comment:

Actually, it does work with len = 0
even if the iterator is not empty. So, I guess that is a solution.
But still, I think the more correct way would be to make it work with > 0

--

___
Python tracker 

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



[issue27613] Empty iterator is rendered as a single bracket ] when using json's iterencode

2016-07-25 Thread Grigory Statsenko

Grigory Statsenko added the comment:

I can't do that if I don't know how many entries there will be ahead of time. 
In my real-life situation I'm fetching the data from a database not knowing how 
many entries I'll get before I actually get them (in the iterator). In most 
cases there are huge amounts of entries that take up too much memory - that's 
why I need to stream it. But sometimes the result set is empty - and that's 
when everything fails.

--

___
Python tracker 

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



[issue27613] Empty iterator is rendered as a single bracket ] when using json's iterencode

2016-07-25 Thread SilentGhost

SilentGhost added the comment:

Why does your __len__ method returns 1? Shouldn't it be 0 since this is an 
empty iterator? Changing it to zero seems to fix the "issue" too.

--
nosy: +SilentGhost

___
Python tracker 

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



[issue27613] Empty iterator is rendered as a single bracket ] when using json's iterencode

2016-07-25 Thread Grigory Statsenko

New submission from Grigory Statsenko:

JSONEncoder.iterencode doesn't work with empty iterators correctly.
Steps:
1. Define an iterator that is recognized by json as a list (inherit from list 
and define nonzero __len__).
2. Use json.dump with data containing an empty iterator defined as described in 
step#1 (but doesn't generate any items)

Expected result: it should be rendered as an empty list: '[]'

Actual result: it is rendered as ']' (only the closing bracket)
interestingly enough this behavior is not reproduced when using the dumps 
function.
I tried other alternatives to the standard json module: simplejson, ujson, hjson
All of them work as expected in this case (both brackets are rendered).

Here is an example of the code that demonstrates this error (compares the 
results of the dump and dumps functions):


import json as json
import io

class EmptyIterator(list):
def __iter__(self):
while False:
yield 1
def __len__(self):
return 1

def dump_to_str(data):
return json.dumps(data)

def dump_to_file(data):
stream = io.StringIO()
json.dump(data, stream)
return stream.getvalue()


data = {'it': EmptyIterator()}
print('to str: {0}'.format(dump_to_str(data)))
print('to file: {0}'.format(dump_to_file(data)))



This prints:
to str: {"it": []}
to file: {"it": ]}

--
messages: 271249
nosy: altvod
priority: normal
severity: normal
status: open
title: Empty iterator is rendered as a single bracket ] when using json's 
iterencode
type: behavior
versions: Python 3.5

___
Python tracker 

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



[issue27607] Importing the main module twice leads to two incompatible instances

2016-07-25 Thread Sylvia van Os

Sylvia van Os added the comment:

My apologies, I can't get that test case to run here either. Here is a slightly 
older one that does reproduce the issue too.

I specifically run it with python3 main.py.

--
Added file: http://bugs.python.org/file43877/issue27607.zip

___
Python tracker 

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



[issue27607] Importing the main module twice leads to two incompatible instances

2016-07-25 Thread Sylvia van Os

Changes by Sylvia van Os :


Removed file: 
http://bugs.python.org/file43867/a040de8b978dcc4c272c0571d456a382-ea6d8fb8acc988a1f060c94070f70a6ed8439069.zip

___
Python tracker 

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



[issue27576] An unexpected difference between dict and OrderedDict

2016-07-25 Thread Xiang Zhang

Xiang Zhang added the comment:

Submit a patch to fix this. Hope it helps.

--
keywords: +patch
nosy: +xiang.zhang
Added file: http://bugs.python.org/file43876/odict_update.patch

___
Python tracker 

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



[issue26851] android compilation and link flags

2016-07-25 Thread Xavier de Gaye

Xavier de Gaye added the comment:

Thanks for the review and the suggestions Martin :)
New patch.

--
Added file: http://bugs.python.org/file43875/build-flags_3.patch

___
Python tracker 

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



[issue27579] Add a tutorial for AsyncIO in the documentation

2016-07-25 Thread Ludovic Gasc

Ludovic Gasc added the comment:

Hi Terry,

>  I don't yet know how to work with git and github.

I don't yet know how to work with tkinter and TK.

I propose to combine our respective knowledge to improve the documentation 
together.

If you give an all in one python file example with tkinter, I'll add that in 
the documentation via git and Github.

Thanks for your help.

Have a nice day.

--

___
Python tracker 

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



[issue27607] Importing the main module twice leads to two incompatible instances

2016-07-25 Thread Cameron Simpson

Cameron Simpson added the comment:

On 25Jul2016 02:56, Python Bug Reports  wrote:
>
>Emanuel Barry added the comment:
>
>I'm fairly sure enums aren't related to this issue, so I'm unassigning Ethan 
>(but feel free to self-assign back if you so desire :). As I said on IRC (I'm 
>Vgr), I think that importing a module twice is the problem here, and that PEP 
>499 is the way to properly solve this and related issues. Thanks for opening 
>this issue!
>
>I added Cameron Simpson (PEP 499's author) to the nosy list, hoping he still 
>wants to work on this (and let us know otherwise). I would personally like to 
>see the PEP accepted and implemented for 3.6.

Thank you; I do want to finish off PEP 499 and get it accepted. I have been 
very remiss in pursuing that.

What can I do to assist here?

Cheers,
Cameron Simpson 

--

___
Python tracker 

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



[issue27612] socket.gethostbyname resolving octal IP addresses incorrectly

2016-07-25 Thread SilentGhost

Changes by SilentGhost :


--
components: +Macintosh
nosy: +ned.deily, ronaldoussoren

___
Python tracker 

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



[issue26462] Patch to enhance literal block language declaration

2016-07-25 Thread Julien

Julien added the comment:

Oh and, is there a proper way for me to generate a diff that rietveld can eat 
without someone regeneratig it?

--

___
Python tracker 

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



[issue26462] Patch to enhance literal block language declaration

2016-07-25 Thread Julien

Julien added the comment:

Upladed a new patch, I was working on 3.5 branch so I did not get all errors.

I'm still having:

WARNING: Could not parse literal_block as "ini". highlighting skipped.

But it may be considered another bug: pygments ini parser can't parse ini 
syntax used in configparser doc (probably due to the columns usage instead of 
equals signs): I prefer having an "can't parse ini" on an ini paragraph than 
"can't parse python3".

--
Added file: http://bugs.python.org/file43874/issue26462.diff

___
Python tracker 

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



[issue27604] More details about `-O` flag

2016-07-25 Thread Ram Rachum

Ram Rachum added the comment:

Yes, my comment was antagonistic. I'm baffled that the first response to 
someone who wants to contribute to Python is an esoteric argument against the 
contribution. I understand that sometimes not all contributions can be accepted 
because they break existing assumptions, but since that's not the case here, I 
think that this kind of responses just put people off contributing.

How about "Great idea, lots of people have been asking about Python's 
optimization mode on Stack Overflow and it'll be much nicer if they could see 
this information officially in the docs where they have more confidence that 
this information is correct. Except one thing, could you please mention that 
this behavior could change in future versions? This is important."

Anyway, I'll send a patch later.

--

___
Python tracker 

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



[issue24773] Implement PEP 495 (Local Time Disambiguation)

2016-07-25 Thread koobs

koobs added the comment:

koobs-freebsd-* 3.x builds are now passing, but I'd like to make an additional 
(trivial) proposal, and that is:

If the tests that were previously failling, aren't *specifically* testing for 
'backward compatible' timezone definitions, that the tests that currently use 
$ROOT/Iran timezone file, instead use a timezone file that is *not* contained 
within the 'backwards' (backwards compatible) timezone file in the zoneinfo 
distribution, which may or may not be installed in various environments.

For example, the tests could instead use Asia/Tehran

--

___
Python tracker 

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



[issue27546] Integrate tkinter and asyncio (and async)

2016-07-25 Thread Terry J. Reedy

Terry J. Reedy added the comment:

I was thinking of starting (Mon. afternoon/evening, its now 2:40 am) with 
updating done stats with every done fetcher, updating stat display every 
second, and listing urls with html body, with a way to view the body.  Log to 
text easy too.  Table of connections will require experiments with 
ttk.Treeview, which I want to do anyway.

--

___
Python tracker 

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



[issue27612] socket.gethostbyname resolving octal IP addresses incorrectly

2016-07-25 Thread Matt Robenolt

New submission from Matt Robenolt:

This also affects socket.getaddrinfo on macOS only, but is fine on Linux. I've 
not tested on Windows to see behavior there.

Given the IP address `0177...0001`, which is a valid octal format 
representing `127.0.0.1`, we can see varying results. Confirmed in both python 
2.7 and 3.5.

First, socket.gethostbyname is always wrong, and always returns `177.0.0.1`:

```
>>> socket.gethostbyname('0177...0001')
'177.0.0.1'
```

This can be seen on both Linux and macOS.

With `socket.getaddrinfo`, resolution is correct on Linux, but the bad 
177.0.0.1 on macOS.

Linux:
```
>>> socket.getaddrinfo('0177...0001', None)[0]
(2, 1, 6, '', ('127.0.0.1', 0))
```

macOS:
```
>>> socket.getaddrinfo('0177...0001', None)[0]
(2, 2, 17, '', ('177.0.0.1', 0))
```

This behavior exists in both 2.7.12 and 3.5.2 at least. I haven't tested many 
others, but I assume pretty universal.

--
components: Library (Lib)
messages: 271237
nosy: mattrobenolt
priority: normal
severity: normal
status: open
title: socket.gethostbyname resolving octal IP addresses incorrectly
type: behavior
versions: Python 2.7, Python 3.5

___
Python tracker 

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



[issue25170] 3.4.4, 3.4.5, 3.5.0, 3.5.1, 3.5.2 documentation archives missing

2016-07-25 Thread Larry Hastings

Larry Hastings added the comment:

Okay, I've updated the doc, and verified that the links work.  The 
releases/3.5.0 directory had problems; it had bad permissions, and was stuck on 
3.5.0a3 or something.  I blew it away and installed the 3.5.0 final docs from 
the tarball and set the permissions by hand.

Is this bug fixed now?

--

___
Python tracker 

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