[issue31063] List Comprehension Bug

2017-07-27 Thread Steven D'Aprano

Steven D'Aprano added the comment:

In the future, please do not post screenshots, please copy and paste the text. 
Screenshots are hard or impossible for the blind or visually impaired to see, 
but they can use a screen reader to work with text.

--
nosy: +steven.daprano

___
Python tracker 

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



[issue31063] List Comprehension Bug

2017-07-27 Thread Tim Peters

Tim Peters added the comment:

This isn't a bug.  84 appears twice in the list, the first time at index 9.  
The .index() method finds the first (leftmost; smallest index) occurrence.  
Since 9 isn't even, the `if` test isn't satisfied, so 84 does not appear in the 
result.

--
nosy: +tim.peters
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



[issue31063] List Comprehension Bug

2017-07-27 Thread Hyun Jae Moon

New submission from Hyun Jae Moon:

Please check the photo attached.
This was tested on Python 3.6.0. It seems that there is a bug in list 
comprehension. The list b should include 84 as well according to the code I 
wrote. I believe this is a quite severe bug.
Thank you very much.

--
components: macOS
files: Screen Shot 2017-07-27 at 9.59.40 PM.png
messages: 299363
nosy: hyunjaemoon, ned.deily, ronaldoussoren
priority: normal
severity: normal
status: open
title: List Comprehension Bug
type: behavior
versions: Python 3.6
Added file: http://bugs.python.org/file47044/Screen Shot 2017-07-27 at 9.59.40 
PM.png

___
Python tracker 

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



[issue31004] IDLE, configdialog: Factor out FontTab class from ConfigDialog

2017-07-27 Thread Terry J. Reedy

Terry J. Reedy added the comment:

I may have changed the Font group since the copy was made.  So unless merges 
since are carefully checked, the configdialog part of Step 1 should be redone.  
I think the latter would be easier.

Since #30853 might be merged tomorrow, I will 'freeze' the font/indent code 
unless I hear otherwise, or there is an unexpected delay.  When this is merged, 
I will do the same for the general part.  And so on.

In Step 2, delete 'Modify code as desired.' I must have forgotten the 
synchonization problem.  We don't want to modify the copy until it can be 
htested.  As soon as the copy *is* changed, the original is no longer a 
complete backup.

I thought of saying that FontPage should subclass Frame, like we have done 
before.  But TabbedPageSet creates a Frame for each page name.  So 
ConfigDialog, the only user, is expected to pass names, then retrieve the blank 
frames to fill in.  We could change that, but not now unless we really need to. 
 It should be possible to replace the blank frame, but there are at least two 
references to replace.

--

___
Python tracker 

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



[issue31036] building the python docs requires the blurb module

2017-07-27 Thread Ned Deily

Ned Deily added the comment:


New changeset 362e9fb0de4321bf265dbca290f7dc1f383a4a47 by Ned Deily in branch 
'3.4':
[3.5] bpo-31036: use an existing Misc/NEWS rather than trying to use blurb 
(#2874) (#2926)
https://github.com/python/cpython/commit/362e9fb0de4321bf265dbca290f7dc1f383a4a47


--

___
Python tracker 

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



[issue31036] building the python docs requires the blurb module

2017-07-27 Thread Ned Deily

Changes by Ned Deily :


--
pull_requests: +2977

___
Python tracker 

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



[issue31054] Python 2.7.8 Release does not update the system Path variable

2017-07-27 Thread Ned Deily

Changes by Ned Deily :


--
components: +Windows -Installation
nosy: +paul.moore, steve.dower, tim.golden, zach.ware
versions: +Python 2.7

___
Python tracker 

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



[issue31020] Add support for custom compressor in tarfile

2017-07-27 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

You can pass a custom file object that implements a custom compression to the 
TarFile constructor. I don't see a need in other way.

--

___
Python tracker 

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



[issue31058] FileFinder fails to find modules for import if modules are created at runtime and don't result in a directory mtime update

2017-07-27 Thread Ned Deily

Changes by Ned Deily :


--
nosy: +brett.cannon, eric.snow, ncoghlan

___
Python tracker 

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



[issue30119] (ftplib) A remote attacker could possibly attack by containing the newline characters

2017-07-27 Thread Ned Deily

Changes by Ned Deily :


--
priority: release blocker -> 
resolution:  -> fixed
stage: backport needed -> 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



[issue30853] IDLE: configdialog -- factor out Tracer subclass

2017-07-27 Thread Terry J. Reedy

Terry J. Reedy added the comment:

A minor change.  Complete the path by adding the other var-trace pairs and 
after checking carefully, I will be ready to push.

I prefer one easy to remember short-name function to two longer-named 
functions.  However, the docstring should specify the tuple as idleConf 
config-type, section, and option names.  Either *add* or *make_callback* could 
check len = 3 and callback[0] in idleConf.config_types, with a test added.

"changing the existing code seemed a little hackish": I don't understand 
exactly what you think is hackish.

There might be people who would prefer (possibly as less hakish)

def add(tkvar, parent, cb_info):
var = tkvar(parent)
if isinstance(callback, tuple):
callback = self.make_callback(var, cb_info)
else:
callback = cb_info
self.untraced.append((var, callback))
return var

I don't know if this would make the add calls readable, but is does factor the 
var calls into one place, replaces () with ',' (at the cost of passing one more 
reference), and avoids the hackish return of an input.  It also simplifies the 
code in a way by making it 'flatter' instead of nested.  Did I miss something?  
What do you think?

 The parameter name change is an independent idea that should satisfy someone 
who objects to calling something an x that is not an x.

--

___
Python tracker 

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



[issue28600] asyncio: Optimize loop.call_soon

2017-07-27 Thread Chris Jerdonek

Changes by Chris Jerdonek :


--
title: shutdown_asyncgens -> asyncio: Optimize loop.call_soon

___
Python tracker 

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



[issue28600] shutdown_asyncgens

2017-07-27 Thread Chris Jerdonek

Changes by Chris Jerdonek :


--
title: asyncio: Optimize loop.call_soon -> shutdown_asyncgens

___
Python tracker 

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



[issue31060] IDLE: Finish regrouping ConfigDialog methods

2017-07-27 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
resolution:  -> fixed
stage: needs patch -> resolved
status: open -> closed

___
Python tracker 

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



[issue31060] IDLE: Finish regrouping ConfigDialog methods

2017-07-27 Thread Terry J. Reedy

Terry J. Reedy added the comment:


New changeset 2cbb6733bfe54e87622a6372f83b73bddf3c4078 by Terry Jan Reedy in 
branch '3.6':
[3.6] bpo-31060: IDLE: Finish regrouping ConfigDialog methods (GH-2908) (#2925)
https://github.com/python/cpython/commit/2cbb6733bfe54e87622a6372f83b73bddf3c4078


--

___
Python tracker 

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



[issue31020] Add support for custom compressor in tarfile

2017-07-27 Thread Mariatta Wijaya

Changes by Mariatta Wijaya :


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



[issue31020] Add support for custom compressor in tarfile

2017-07-27 Thread Mariatta Wijaya

Mariatta Wijaya added the comment:

Adding serhiy.storchaka who recently made changes to tarfile.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue31020] Add support for custom compressor in tarfile

2017-07-27 Thread Mariatta Wijaya

Mariatta Wijaya added the comment:

Adding lars.gustaebel who is listed as maintainer for tarfile.

--
nosy: +Mariatta, lars.gustaebel

___
Python tracker 

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



[issue31020] Add support for custom compressor in tarfile

2017-07-27 Thread Mariatta Wijaya

Changes by Mariatta Wijaya :


--
stage:  -> patch review

___
Python tracker 

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



[issue18943] argparse: default args in mutually exclusive groups

2017-07-27 Thread paul j3

paul j3 added the comment:

Another manifestation of the complications in handling '?' positionals is in

http://bugs.python.org/issue28734

argparse: successive parsing wipes out nargs=? values

--

___
Python tracker 

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



[issue28734] argparse: successive parsing wipes out nargs=? values

2017-07-27 Thread paul j3

paul j3 added the comment:

The problem described here is restricted to `?` and `*' positionals, and is 
caused by the subtle way in which 'empty' optional positionals are handled.

The regular handling of defaults at the start of `parse_known_args` works fine. 
 The default is only written to the namespace if something isn't there already.

 if not hasattr(namespace, action.dest):
 if action.default is not SUPPRESS:
  setattr(namespace, action.dest, action.default)

But a positional with ? or * is always 'seen' because an empty list of strings 
satisfies the nargs pattern.  'get_values()' has special handling for this case:

if not arg_strings and action.nargs == OPTIONAL:

value = action.default

That is, it replaces the empty list with the 'default'. 

But take_action(), which does the actual saving, is conditional:

# take the action if we didn't receive a SUPPRESS value
# (e.g. from a default)
if argument_values is not SUPPRESS:
action(self, namespace, argument_values, option_string)

That explains why 'default=SUPPRESS' solves this issue.

It's enough to satisfy the OP's situation, but I don't think it's a robust fix.

I don't have a patch idea yet, but this probably should be reopened so there's 
a record of the potential problem.

More on the complications raised by these 'seen default actions' in 

http://bugs.python.org/issue18943

--
nosy: +paul.j3
status: closed -> open

___
Python tracker 

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



[issue30995] Support logging.getLogger(style='{')

2017-07-27 Thread Mitar

Mitar added the comment:

> That's the problem, right there. I don't think the ways of doing this are 
> bulletproof and require too much cooperation between third-party libraries.

Which third-party libraries? The thing I am proposing works for that particular 
file you call getLogger with.

In my files I already have:

logger = logging.getLogger(__name__)

Changing that to:

logger = logging.getLogger(__name__, style='{')

seems easy and backwards compatible. How will I break any other 3rd party use 
by doing this? It is my code in my file.

The only issue is that you have to make sure you are not passing object on. But 
that again, is your code, so you should know what you are passing on.

We could also add logger.defaultStyle() to return the same logger, with default 
style, so that you can pass it on to other function which might expect a 
logger, if you want that. Or, you could define:

defaultLogger = logging.getLogger(__name__)
logger = logging.getLogger(__name__, style='{')

at the beginning of the file, and then use logger in the file, and pass 
defaultLogger on.

There are so many options to address your concerns.

> I don't see how it's "really cumbersome". A simple approach is outlined in

Simple approach by everywhere in my code having to use __ now? So I have _ for 
string translations, and __ for logging. This is cumbersome. Because it could 
be solved by having it only once in the file. Not that I have to call it 
manually everywhere in the file.

> which is also described in the documentation here:

Yes, I have read it, used it, didn't like it. So I thought about it and it 
feels pretty easy to provide a capacity to have a default style applied to the 
whole file. Instead of manually having to call __. It would effectively be the 
same internally. Just cleaner code. Do not repeat yourself. Repeating __ 
everywhere is repeating myself a lot. I would like this style. Let this be 
specified only once.

--

___
Python tracker 

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



[issue31060] IDLE: Finish regrouping ConfigDialog methods

2017-07-27 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
pull_requests: +2976

___
Python tracker 

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



[issue31060] IDLE: Finish regrouping ConfigDialog methods

2017-07-27 Thread Terry J. Reedy

Terry J. Reedy added the comment:


New changeset b1660800f4f519dbfab9e5a4ad3eae1cfabab3ed by Terry Jan Reedy in 
branch 'master':
bpo-31060: IDLE: Finish regrouping ConfigDialog methods (#2908)
https://github.com/python/cpython/commit/b1660800f4f519dbfab9e5a4ad3eae1cfabab3ed


--

___
Python tracker 

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



[issue31062] socket.makefile does not handle line buffering

2017-07-27 Thread Kevin Chen

New submission from Kevin Chen:

File objects generated with socket.makefile and that attempt to use line 
buffering appear to not actually use line buffering, at least for writing.  In 
this example, the string does not appear to be written until the flush call.

First, set up a socket:
$ nc -l -U /tmp/foo

Then:

Python 3.6.2 (default, Jul 26 2017, 01:41:27) 
[GCC 4.8.4] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import socket
>>> s = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
>>> s.connect("/tmp/foo")
>>> f = s.makefile("rw", buffering=1)
>>> f.write("asdf\n")
5
>>> f.flush()

The following patch appears to fix the problem:

--- socket.py.orig  2017-07-25 21:41:39.974554944 -0400
+++ socket.py   2017-07-27 17:02:58.223353418 -0400
@@ -253,7 +253,11 @@
 buffer = io.BufferedWriter(raw, buffering)
 if binary:
 return buffer
-text = io.TextIOWrapper(buffer, encoding, errors, newline)
+line_buffering = False
+if buffering == 1:
+line_buffering = True
+text = io.TextIOWrapper(buffer, encoding, errors, newline,
+line_buffering)
 text.mode = mode
 return text

--
components: Library (Lib)
messages: 299351
nosy: kchen
priority: normal
severity: normal
status: open
title: socket.makefile does not handle line buffering
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



[issue30931] Race condition in asyncore may access the wrong dispatcher

2017-07-27 Thread Nir Soffer

Nir Soffer added the comment:

Victor, I mostly agree with you, but I think we have here several bugs, and
we should do the minimal fix for each of them. Your PR is too big, trying
to fix too much.

(Bug 1) The dispatcher A closes the dispatcher B. Currently, asyncore calls the 
handlers of the dispatcher B.

We don't have such bug now - if dispatcher B is closed, it is not in the map, 
and current code will skip the fd when checking:

for fd in r:
obj = map.get(fd)
if obj is None:
continue

(Bug 2) Dispatcher A close Dispatcher B, create Dispatcher C. C get may use the 
same
fd as B. If B was ready, asyncore may get C from the map and access it instead 
of B.

This issue is reported in this bug.

(Bug 3) if handle_read() closed the dispatcher, asyncore will call 
handle_write() on
a closed dispatcher. This is a very old bug with asyncore.readwrite().

(Bug 4) handle_xxx_event() internal methods may call multiple handle_xxx() user
methods, again not checking if dispatcher was closed after each invocation.
Same, very old bug.

So I suggest that we fix *only* bug 2 in 
https://github.com/python/cpython/pull/2854.

The issue in readwrite() can be solved with the approach you suggest, but I 
prefer
to make small an careful steps so we don't introduce regressions in stable 
versions.

Also, there is already too much noise here an in the various PRs about this 
issue,
better file bugs for the rest of the issues and discuss them separately.

This commit
https://github.com/python/cpython/pull/2854/commits/bbd2d09ab999fa2214cbbd2589ae3642facd3057

Looks fine with the test_poll_close_replace_dispatchers test added in the later
commit.

--

___
Python tracker 

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



[issue31061] asyncio segfault when using threadpool and "_asyncio" native module

2017-07-27 Thread Yury Selivanov

Yury Selivanov added the comment:

Interesting. A code to reproduce this crash would help tremendously. So far 
this is the first time I hear about this crash.

--
nosy: +inada.naoki

___
Python tracker 

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



[issue31060] IDLE: Finish regrouping ConfigDialog methods

2017-07-27 Thread Terry J. Reedy

Terry J. Reedy added the comment:

After finishing the patch, I expect that the highlight and keys groups will 
need some changes.

--
title: IDLE: Finish rearranging ConfigDialog methods -> IDLE: Finish regrouping 
ConfigDialog methods

___
Python tracker 

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



[issue31061] asyncio segfault when using threadpool and "_asyncio" native module

2017-07-27 Thread Alexander Mohr

Alexander Mohr added the comment:

btw I've seen this issue in 3.5.2 + 3.6.2 on debian jessie + stretch

--

___
Python tracker 

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



[issue31061] asyncio segfault when using threadpool and "_asyncio" native module

2017-07-27 Thread Alexander Mohr

New submission from Alexander Mohr:

I have a project in a prod environment which heavily uses asyncio and a 
threadpool.  It uses the threadpool to run CPU heavy tasks (in this case 
populating a defaultdict) to avoid blocking the main thread (no async code in 
thread).  For some time now my service has been randomly crashing at the same 
place in the thread which does the dict updating.  I've finally got both the 
python and native stack traces, and based on the information presented it 
looked very similar to the issue found by the devs at home-assistant 
(https://github.com/home-assistant/home-assistant/issues/7752#issuecomment-30519,
 which points to https://github.com/home-assistant/home-assistant/pull/7848).  
So I tried their fix of disabling the "_asyncio" module, and lo and behold 
python no longer segfaults.

Per the stacktrace it's crashing in PyObject_GC_Del, and the only place this is 
used in the asyncio module seems to be here: 
https://github.com/python/cpython/blob/master/Modules/_asynciomodule.c#L996

does anyone have any idea why it's crashing on this line?  Are there thread 
protections missing in this file?

I'm trying to reproduce this in a testcase but it's proving very difficult as 
I'm guessing it's timing related.

--
components: asyncio
files: native___python_crash_stacks.txt
messages: 299346
nosy: thehesiod, yselivanov
priority: normal
severity: normal
status: open
title: asyncio segfault when using threadpool and "_asyncio" native module
type: crash
versions: Python 3.5, Python 3.6
Added file: http://bugs.python.org/file47043/native___python_crash_stacks.txt

___
Python tracker 

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



[issue31042] Inconsistency in documentation of operator.index

2017-07-27 Thread Joseph Fox-Rabinovitz

Joseph Fox-Rabinovitz added the comment:

I brought up the issue because it was really a point of confusion for me.
Could we make the change to "Roughly equivalent" and make that a link to
https://docs.python.org/3/reference/datamodel.html#special-method-lookup?
That would make it clear how the lookup is actually done.

While I agree that making the docs unnecessarily pedantic is probably a bad
thing, I am going to guess that I am not the only person that looks to them
for technical accuracy.

Regards,

-Joe

On Thu, Jul 27, 2017 at 4:04 PM, R. David Murray 
wrote:

>
> R. David Murray added the comment:
>
> I agree with Raymond.  I'm not sure that adding roughly is going to
> decrease the possibility of confusion, but I won't object to it.
>
> In a way, it's too bad we didn't make the attribute lookup machinery look
> up all dunder methods on the class, so that a.__index__ would call the
> class method.  I think backward compatibility prevented that.
>
> --
> nosy: +r.david.murray
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue31042] Inconsistency in documentation of operator.index

2017-07-27 Thread R. David Murray

R. David Murray added the comment:

I agree with Raymond.  I'm not sure that adding roughly is going to decrease 
the possibility of confusion, but I won't object to it.

In a way, it's too bad we didn't make the attribute lookup machinery look up 
all dunder methods on the class, so that a.__index__ would call the class 
method.  I think backward compatibility prevented that.

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



[issue31055] All Sphinx generated pages could have a new "Edit This Page" link adjacent to the existing "Show Source"

2017-07-27 Thread R. David Murray

R. David Murray added the comment:

No, we understand the process, the problem is that except for the 'dev' docs, 
the link would be to a branch other than master.  That's the problem that we're 
discussing.

Maybe instead of an edit link on non-dev docs we could have a message saying 
that if you want to propose a change you can use the edit link on the 'dev' 
version of the docs?  Maybe with a link or button that would take them to the 
dev version of the page?

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



[issue31036] building the python docs requires the blurb module

2017-07-27 Thread Larry Hastings

Larry Hastings added the comment:


New changeset 3de144890ad3bc50694368a1b33be6d7f3a780b3 by larryhastings (Ned 
Deily) in branch '3.5':
[3.5] bpo-31036: use an existing Misc/NEWS rather than trying to use blurb 
(#2874)
https://github.com/python/cpython/commit/3de144890ad3bc50694368a1b33be6d7f3a780b3


--

___
Python tracker 

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



[issue30119] (ftplib) A remote attacker could possibly attack by containing the newline characters

2017-07-27 Thread Larry Hastings

Larry Hastings added the comment:


New changeset 2a5a26c87e82c7d9a348792891feccd1b5e9a769 by larryhastings 
(Dong-hee Na) in branch '3.4':
[3.4] bpo-30119: fix ftplib.FTP.putline() to throw an error for a illegal 
command (#1214) (#2893)
https://github.com/python/cpython/commit/2a5a26c87e82c7d9a348792891feccd1b5e9a769


--

___
Python tracker 

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



[issue31042] Inconsistency in documentation of operator.index

2017-07-27 Thread Raymond Hettinger

Raymond Hettinger added the comment:

This seems like a generic issue for magic methods and is already covered by 
"for custom classes, implicit invocations of special methods are only 
guaranteed to work correctly if defined on an object’s type, not in the 
object’s instance dictionary."

While you're technically correct with suggesting "Equivalent to 
`type(a).__index__(a)`", I don't think this is an improvement.  It makes the 
docs safe against overly pedantic readings, but it also reduces the 
intelligibility for everyday users.

The usual approach in the docs is to say "a[b] <==> a.__getitem__(b)" rather 
than "a[b] <==> type(a).__getitem__(a, b)".  The latter is more correct but it 
is also less helpful.  For the most part, this style of presentation has worked 
well for a lot of people for a long time.

I recommend closing this or not doing any more than changing "Equivalent to:" 
to "Roughly equivalent to:".

--
nosy: +rhettinger
priority: normal -> low

___
Python tracker 

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



[issue24954] No way to generate or parse timezone as produced by datetime.isoformat()

2017-07-27 Thread Alexander Belopolsky

Alexander Belopolsky added the comment:

John,

An RFC3339 parser is beyond the scope of this issue which is limited to adding 
str[fp]time code(s) to produce and consume RFC3339-formatted timezones.

We can still have fromisoformat() constructor implemented in 3.7, but someone 
needs to address the issues raised at #15873.

--

___
Python tracker 

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



[issue31055] All Sphinx generated pages could have a new "Edit This Page" link adjacent to the existing "Show Source"

2017-07-27 Thread Paul Hammant

Paul Hammant added the comment:

Hi folks, I'm not explaining Github's non-commiter contribution process very 
well.

Click this link everyone - 
https://github.com/BuildRadiator/BuildRadiator/edit/master/README.md - pretend 
to make a contribution to one of my projects :)

--

___
Python tracker 

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



[issue31055] All Sphinx generated pages could have a new "Edit This Page" link adjacent to the existing "Show Source"

2017-07-27 Thread Fred L. Drake, Jr.

Fred L. Drake, Jr. added the comment:

On Thu, Jul 27, 2017 at 3:01 PM, Fred L. Drake, Jr.
 wrote:
> If the link went to an edit form with the version of the content the
> user was reading,
> and includes an explanation of the multiple-versions issue, it might
> prove reasonable

Egads, look at that formatting!

Somedays I miss my VT-100 terminals and sane line handling.

  -Fred

--

___
Python tracker 

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



[issue31055] All Sphinx generated pages could have a new "Edit This Page" link adjacent to the existing "Show Source"

2017-07-27 Thread Fred L. Drake, Jr.

Fred L. Drake, Jr. added the comment:

On Thu, Jul 27, 2017 at 1:03 PM, Mariatta Wijaya  wrote:
> I don't think we should add this link.
>
> When we make edits to the docs, even simple typo fixes, it should first be 
> done
> in the master branch, instead of the maintenance branches (e.g. 2.7, 3.5 or 
> 3.6).
>
> If "Edit This Page" link takes you to edit the documentation in branches other
> than "master", that's not desirable workflow.
>
> If "Edit This Page" link takes you to edit the master branch, it can be 
> confusing
> to the contributor since the content on "master" might be different.

I wonder if a better solution lies somewhere between the original
suggestion and just
not including such a link.

If the link went to an edit form with the version of the content the
user was reading,
and includes an explanation of the multiple-versions issue, it might
prove reasonable
to try applying the diff between the modified and original text to the
HEADs of each
maintenance branch.  If the diff doesn't apply, the (possibly new)
contributor can be
offered a chance to deal with edits to each version (which might be a bit much).

At any rate, the diff could be used to construct a temporary branch,
b.p.o issue, and
PR. This would allow us to provide the contributor with a way to see
that their suggested
changes are being considered, and we're less likely to lose them in a
wall of email.

There'd be a bit of work to make all this play out, though.

  -Fred

--
nosy: +fdrake

___
Python tracker 

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



[issue30522] Allow replacing a logging.StreamHandler's stream

2017-07-27 Thread Vinay Sajip

Changes by Vinay Sajip :


--
pull_requests: +2975

___
Python tracker 

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



[issue31060] IDLE: Finish rearranging ConfigDialog methods

2017-07-27 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
pull_requests: +2974

___
Python tracker 

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



[issue31060] IDLE: Finish rearranging ConfigDialog methods

2017-07-27 Thread Terry J. Reedy

New submission from Terry J. Reedy:

Finish rearranging the methods of configdialog.ConfigDialog to group together 
methods pertaining to each tab and the button block.  Doing so has and will 
help in writing tests.  It is also preparation for splitting ConfigDialog, 
which currently has more than 70 methods, into multiple more maintainable 
classes.

#30993, pr2831 moved the methods pertaining to the font tab right after 
create_font_tab.  #31003, pr2859 did the same for methods pertaining to the 
general tab.  In both case, the generated diff had a + block at the new 
location and - block at the old locations.

When I did the same for the highlight tab for #31001, the number of methods and 
lines moved was perhaps doubled, which meant that more of the other lines 
changed position.  The result was a huge diff, by default unrendered, that 
deleted and inserted most of the lines in the file.  Adding real edits on top 
of this would result in a worse huge diff.

So I decided instead to open this issue and finish method movement (for the 
dialog, button group, and keys group) to the extent I can now.  (The order 
within groups may be adjusted later as tests are written and knowledge about 
the methods is gained.)

--
assignee: terry.reedy
components: IDLE
messages: 299335
nosy: terry.reedy
priority: normal
severity: normal
stage: needs patch
status: open
title: IDLE: Finish rearranging ConfigDialog methods
type: enhancement
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



[issue30995] Support logging.getLogger(style='{')

2017-07-27 Thread Vinay Sajip

Vinay Sajip added the comment:

> You only have to make sure they do not use this logger without knowing about 
> new format, which can be done in various ways (like prefixing the name of the 
> logger, for example).

That's the problem, right there. I don't think the ways of doing this are 
bulletproof and require too much cooperation between third-party libraries.

> using non-legacy formatting in logging message is really cumbersome

I don't see how it's "really cumbersome". A simple approach is outlined in

http://plumberjack.blogspot.co.uk/2010/10/supporting-alternative-formatting.html

So that logging using brace formatting could be as simple as 

logger.misc(__('User {} logged in', username))

which is also described in the documentation here:

https://docs.python.org/3.3/howto/logging-cookbook.html#use-of-alternative-formatting-styles

--

___
Python tracker 

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



[issue24954] No way to generate or parse timezone as produced by datetime.isoformat()

2017-07-27 Thread John Nagle

John Nagle added the comment:

As the original author of the predecessor bug report (issue 15873) in 2012, I 
would suggest that there's too much bikeshedding here. I filed this bug because 
there was no usable ISO8601 date parser available.  PyPi contained four 
slightly different buggy ones, and three more versions were found later.  

I suggested following RFC3339, "Date and Time on the Internet: Timestamps", 
section 5.6, which specifies a clear subset of ISO8601.  Five years later, I 
suggest just going with that. Fancier variations belong in non-standard 
libraries.

Date parsing should not be platform-dependent.  Using an available C library 
was convenient, but not portable. 

Let's get this done.

--

___
Python tracker 

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



[issue30222] make_zip.py had a bug when setting up full 64 bit distribution.

2017-07-27 Thread Steve Dower

Changes by Steve Dower :


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



[issue31059] asyncio.StreamReader.read hangs if n<0

2017-07-27 Thread Sergey Kostyuk

New submission from Sergey Kostyuk:

Good day

Maybe I misunderstood something, but I'm failed to fetch any data by calling 
asyncio.StreamReader.read if `n` is less than zero (or left default). It just 
hangs in the loop forever (see line number 614 of asyncio/streams.py: 
https://github.com/python/cpython/blob/3e56ff0/Lib/asyncio/streams.py#L614). If 
`n` is equal to any positive value - coroutine works as expected and returns if 
there is any data in socket buffer. Even if available data size is less than 
`n` bytes.

Expected behavior: collect all data from the buffer and return
Current behavior: hangs in the loop forever if n < 0

My usage sample: https://git.io/v7nJq

--
components: asyncio
messages: 299332
nosy: Sergey Kostyuk, yselivanov
priority: normal
severity: normal
status: open
title: asyncio.StreamReader.read hangs if n<0
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



[issue31058] FileFinder fails to find modules for import if modules are created at runtime and don't result in a directory mtime update

2017-07-27 Thread Paul Goins

New submission from Paul Goins:

If modules are added to a package namespace at runtime, there is a chance that 
they will not be properly detected if adding the module does not also result in 
an update to the parent directory's st_mtime attribute.

This manifests in not being able to import the module in question, despite it 
clearly existing on disk and despite being to import it via a new Python 
interpreter if a second one is opened in parallel.

Attached is a SSCCE which reproduces this issue.  On my Windows dev machine, it 
works flawlessly on Python 2.7 and 3.6.  However, on a Linux VM, it works on 
Python 2.7 yet fails fairly consistently on Python 3.6.

I'm working around the issue by walking sys.path_importer_cache and resetting 
FileFinder._path_mtime to 0, forcing the cache to be recreated on the next call 
to FileFinder.find_spec().

This bug is admittedly a bit of a corner case, but I did end up spend many 
hours trying to figure out what was going on, so whether or not this gets 
fixed, I hope this may be useful info to someone.  Thanks for your attention.

--
components: Library (Lib)
files: import_tester.py
messages: 299331
nosy: pdgoins
priority: normal
severity: normal
status: open
title: FileFinder fails to find modules for import if modules are created at 
runtime and don't result in a directory mtime update
type: behavior
versions: Python 3.6
Added file: http://bugs.python.org/file47042/import_tester.py

___
Python tracker 

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



[issue5288] tzinfo objects with sub-minute offsets are not supported (e.g. UTC+05:53:28)

2017-07-27 Thread Alexander Belopolsky

Alexander Belopolsky added the comment:

In PR 2896, I've modified %z formatting code to output sub-minute data if 
present.  I think %z parsing should be also modified to accept sub-minute data, 
but I would like to do it in the context of issue 24954.  Thoughts?

--

___
Python tracker 

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



[issue9566] Compilation warnings under x64 Windows

2017-07-27 Thread Segev Finer

Segev Finer added the comment:

The only warnings that remain are:

1. The one from gcmodule.c due to dtrace, which is handled in PR 2852.
2. The peephole warnings which I'm not sure about. Are overflows possible there 
or not? That is, if there are already internal caps that prevent them. If they 
are possible, it might require a larger change to support EXTENDED_ARG in some 
places. i.e. can the consts table really grow larger than `unsigned int` or can 
a jump target be large enough to overflow?

--

___
Python tracker 

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



[issue31057] pydoc for tempfile.TemporaryDirectory should say it returns the name

2017-07-27 Thread R. David Murray

R. David Murray added the comment:

It actually returns the path, since "name" often means the last component of 
the path.  Just saying "path" might be confused with pathlib, though.  So I 
guess we'd have to say "returning its path as a string", which sounds awkward.  
The original wording is in fact accurate, since most people will understand 
"the directory" as the directory path as a string.  I'm not sure this change 
would be an improvement.  I'm not saying no, though.  I guess you'd say I'm -0 
on changing it.

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



[issue30222] make_zip.py had a bug when setting up full 64 bit distribution.

2017-07-27 Thread Segev Finer

Segev Finer added the comment:

Since PR 2750 is merged, I think this can be closed.

--

___
Python tracker 

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



[issue31048] ResourceWarning in test_asyncio.test_events.ProactorEventLoopTests.test_create_server_ssl_verify_failed

2017-07-27 Thread Segev Finer

Changes by Segev Finer :


--
pull_requests: +2973

___
Python tracker 

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



[issue30940] Documentation for round() is incorrect.

2017-07-27 Thread Mark Dickinson

Mark Dickinson added the comment:

[Serhiy]
> is it worth to mention explicitly that round(number) and round(number, None) 
> > delegate to number.__round__()?

Yes, if we can find a non-clunky wording that does that. The current wording 
does seem to misleadingly suggest that the delegation to `__round__` only 
happens for the two-argument version of round.

How about just:

> For a general Python object ``number``, ``round`` delegates to
> ``number.__round__``.

--

___
Python tracker 

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



[issue31055] All Sphinx generated pages could have a new "Edit This Page" link adjacent to the existing "Show Source"

2017-07-27 Thread Mariatta Wijaya

Mariatta Wijaya added the comment:

I don't think we should add this link.

When we make edits to the docs, even simple typo fixes, it should first be done 
in the master branch, instead of the maintenance branches (e.g. 2.7, 3.5 or 
3.6).

If "Edit This Page" link takes you to edit the documentation in branches other 
than "master", that's not desirable workflow.

If "Edit This Page" link takes you to edit the master branch, it can be 
confusing to the contributor since the content on "master" might be different.

--
nosy: +Mariatta

___
Python tracker 

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



[issue31044] FAIL: test_makedev (test.test_posix.PosixTester) on AMD64 FreeBSD CURRENT

2017-07-27 Thread STINNER Victor

Changes by STINNER Victor :


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

___
Python tracker 

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



[issue31044] FAIL: test_makedev (test.test_posix.PosixTester) on AMD64 FreeBSD CURRENT

2017-07-27 Thread STINNER Victor

STINNER Victor added the comment:


New changeset c2f7fb61511456c62877592988b31714cb8ba266 by Victor Stinner in 
branch '2.7':
[2.7] bpo-31044: Skip test_posix.test_makedev() on FreeBSD (#2915) (#2918)
https://github.com/python/cpython/commit/c2f7fb61511456c62877592988b31714cb8ba266


--

___
Python tracker 

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



[issue31044] FAIL: test_makedev (test.test_posix.PosixTester) on AMD64 FreeBSD CURRENT

2017-07-27 Thread STINNER Victor

STINNER Victor added the comment:


New changeset 54cb3400e500f99bd57a0273aa7ef84ffd37558e by Victor Stinner in 
branch '3.6':
bpo-31044: Skip test_posix.test_makedev() on FreeBSD (#2915) (#2917)
https://github.com/python/cpython/commit/54cb3400e500f99bd57a0273aa7ef84ffd37558e


--

___
Python tracker 

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



[issue30640] NULL + 1 in _PyFunction_FastCallDict()

2017-07-27 Thread Zackery Spytz

Changes by Zackery Spytz :


--
pull_requests: +2972

___
Python tracker 

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



[issue31028] test_pydoc fails when run directly

2017-07-27 Thread STINNER Victor

STINNER Victor added the comment:

Bug fixed in Python 2.7, 3.6 and master.

--
versions: +Python 2.7

___
Python tracker 

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



[issue31044] FAIL: test_makedev (test.test_posix.PosixTester) on AMD64 FreeBSD CURRENT

2017-07-27 Thread STINNER Victor

Changes by STINNER Victor :


--
pull_requests: +2971

___
Python tracker 

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



[issue31028] test_pydoc fails when run directly

2017-07-27 Thread STINNER Victor

STINNER Victor added the comment:


New changeset d019c7965d411b2132f68ed6bb33e538b4d9eba3 by Victor Stinner in 
branch '3.6':
bpo-31028: Fix test_pydoc when run directly (#2864) (#2910)
https://github.com/python/cpython/commit/d019c7965d411b2132f68ed6bb33e538b4d9eba3


--

___
Python tracker 

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



[issue31028] test_pydoc fails when run directly

2017-07-27 Thread STINNER Victor

STINNER Victor added the comment:


New changeset fd6736d17901e539d6a9ddf50a9927a3a97a9c06 by Victor Stinner in 
branch '2.7':
bpo-31028: Fix test_pydoc when run directly (#2864) (#2911)
https://github.com/python/cpython/commit/fd6736d17901e539d6a9ddf50a9927a3a97a9c06


--

___
Python tracker 

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



[issue31044] FAIL: test_makedev (test.test_posix.PosixTester) on AMD64 FreeBSD CURRENT

2017-07-27 Thread STINNER Victor

Changes by STINNER Victor :


--
pull_requests: +2970

___
Python tracker 

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



[issue27715] call-matcher breaks if a method is mocked with spec=True

2017-07-27 Thread David Hoyes

David Hoyes added the comment:

I came across a different failing test case, which looks a lot like the same 
issue:

```
from unittest import mock

class Foo(object):
def __call__(self, x):
return x

m = mock.create_autospec(Foo, instance=True)
m(7)
m.assert_called_once_with(7)
```

In mock 1.0.1 this passes, but in Python 3.5 we get this error:

```
TypeError: missing a required argument: 'x'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "euhpc/tmp/mockbug.py", line 12, in 
m.assert_called_once_with(7)
  File "/usr/lib/python3.5/unittest/mock.py", line 803, in 
assert_called_once_with
return self.assert_called_with(*args, **kwargs)
  File "/usr/lib/python3.5/unittest/mock.py", line 792, in assert_called_with
raise AssertionError(_error_message()) from cause
AssertionError: Expected call: mock(7)
Actual call: mock(7)
```

--
nosy: +David Hoyes

___
Python tracker 

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



[issue31056] Import Module Not Working According To Documentation Python 3.6.2

2017-07-27 Thread Paul Moore

Paul Moore added the comment:

I've tested this on Python 3.6.1 and Python 3.6.2 on Windows 7, 64-bit, and it 
works as expected. I don't see the problem here - do you have any unusual 
environment settings or config?

--

___
Python tracker 

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



[issue31057] pydoc for tempfile.TemporaryDirectory should say it returns the name

2017-07-27 Thread Roundup Robot

Changes by Roundup Robot :


--
pull_requests: +2968

___
Python tracker 

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



[issue31057] pydoc for tempfile.TemporaryDirectory should say it returns the name

2017-07-27 Thread Thomas Thurman

New submission from Thomas Thurman:

Currently the pydoc for tempfile.TemporaryDirectory begins

"Create and return a temporary directory."

It doesn't explain anywhere *what* it returns (in fact, it returns the name of 
the directory as a string). The return type is further obscured by 
TemporaryDirectory being a context manager.

--
assignee: docs@python
components: Documentation
messages: 299317
nosy: Thomas Thurman, docs@python
priority: normal
severity: normal
status: open
title: pydoc for tempfile.TemporaryDirectory should say it returns the name
type: enhancement
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



[issue31056] Import Module Not Working According To Documentation Python 3.6.2

2017-07-27 Thread Joey DiGiorgio

New submission from Joey DiGiorgio:

I am running Windows 7 and Python 3.6.2 trying to import module A from withing 
module B where both Module A and B are located in the same directory. I get the 
ModuleNotFoundError. I try the exact same setup with Python 3.5.2 and get no 
errors and I get the expected behavior.

For more details about the exact process I went through and everything I tried, 
see the StackOverflow post I made about it here: 
https://stackoverflow.com/questions/45336678/python-3-import-module-not-working-according-to-docs?noredirect=1#comment77637921_45336678

--
components: Windows
messages: 299316
nosy: MrJman006, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: Import Module Not Working According To Documentation Python 3.6.2
type: crash
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



[issue31044] FAIL: test_makedev (test.test_posix.PosixTester) on AMD64 FreeBSD CURRENT

2017-07-27 Thread STINNER Victor

STINNER Victor added the comment:


New changeset 12953ffe12ac781332b384c36b25d12216b1db62 by Victor Stinner in 
branch 'master':
bpo-31044: Skip test_posix.test_makedev() on FreeBSD (#2915)
https://github.com/python/cpython/commit/12953ffe12ac781332b384c36b25d12216b1db62


--

___
Python tracker 

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



[issue31044] FAIL: test_makedev (test.test_posix.PosixTester) on AMD64 FreeBSD CURRENT

2017-07-27 Thread STINNER Victor

STINNER Victor added the comment:

At May 23, the dev_t type changed from 32 bits to 64 bits on FreeBSD in the 
kernel, but minor() wasn't updated. I reported a bug to FreeBSD:
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=221048

--

___
Python tracker 

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



[issue31044] FAIL: test_makedev (test.test_posix.PosixTester) on AMD64 FreeBSD CURRENT

2017-07-27 Thread STINNER Victor

Changes by STINNER Victor :


--
pull_requests: +2967

___
Python tracker 

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



[issue30853] IDLE: configdialog -- factor out Tracer subclass

2017-07-27 Thread Cheryl Sabella

Cheryl Sabella added the comment:

Just as an FYI with blurb, I installed it in the same venv as coverage, so I 
was able to run it with 3.7.  It's really cool.

--

___
Python tracker 

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



[issue30853] IDLE: configdialog -- factor out Tracer subclass

2017-07-27 Thread Cheryl Sabella

Cheryl Sabella added the comment:

The font vars went well, so I also added general vars.

I created the blurb.  I didn't know if it would work with no body, so I just 
put a placeholder.

I did have another question.  Instead of just one tracers.add() method, I was 
wondering if there's an advantage to having one called add_callback(var, 
callback) and a separate one called add_default(var, config)?  Design-wise, I 
don't know which is the preferred way, but changing the existing code seemed a 
little hackish.

--

___
Python tracker 

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



[issue31044] FAIL: test_makedev (test.test_posix.PosixTester) on AMD64 FreeBSD CURRENT

2017-07-27 Thread STINNER Victor

STINNER Victor added the comment:

Confirmation that minor() truncates high bits:

CURRENT-amd64% ./python -c 'import os; print(hex(os.minor(0xaabbccddff)))'
0xbbcc00ff

--

___
Python tracker 

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



[issue31044] FAIL: test_makedev (test.test_posix.PosixTester) on AMD64 FreeBSD CURRENT

2017-07-27 Thread STINNER Victor

STINNER Victor added the comment:

The problem is more the major(), minor() and makedev() commands:

CURRENT-amd64% ./python   
Python 3.7.0a0 (heads/master:d5ed47dea2, Jul 28 2017, 00:10:54) 
[GCC 4.2.1 Compatible FreeBSD Clang 5.0.0 (trunk 308421)] on freebsd12
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> dev=954774858155; os.makedev(os.major(dev), os.minor(dev))
1292118443

"makedev, major, minor -- device number conversion" doc on FreeBSD CURRENT:

https://www.freebsd.org/cgi/man.cgi?query=makedev=0=0=FreeBSD+12-current=default=html



SYNOPSIS
 #include 

 dev_t
 makedev(int major, int minor);

 int
 major(dev_t dev);

 int
 minor(dev_t dev);

DESCRIPTION
 The makedev() macro allows a unique device number to be generated based
 on its major and minor number.  The major() and minor() macros can be
 used to obtain the original numbers from the device number dev.

 In previous implementations of FreeBSD all block and character devices
 were uniquely identified by a pair of major and minor numbers.  The major
 number referred to a certain device class (e.g. disks, TTYs) while the
 minor number identified an instance within the device class.  Later ver-
 sions of FreeBSD automatically generate a unique device number for each
 character device visible in /dev/.  These numbers are not divided in
 device classes.

 On FreeBSD these macros are only used by utilities that need to exchange
 numbers with other operating systems that may use different encodings for
 dev_t, but also applications that present these numbers to the user in a
 more conventional way.

RETURN VALUES
 The major() macro returns a device major number that has a value between
 0 and 255.  The minor() macro returns a device minor number whose value
 can span the complete range of an int.

--

___
Python tracker 

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



[issue31044] FAIL: test_makedev (test.test_posix.PosixTester) on AMD64 FreeBSD CURRENT

2017-07-27 Thread STINNER Victor

STINNER Victor added the comment:

os.stat() seems correct, st_dev and st_ino are the same than the system command 
"stat":

   
CURRENT-amd64% ./python -c 'import os; st=os.stat("setup.py"); print(st)'   
   
os.stat_result(st_mode=33188, st_ino=2384528, st_dev=954774858155, st_nlink=1, 
st_uid=1003, st_gid=1003, st_size=99944, st_atime=1501162007, 
st_mtime=1501162007, st_ctime=1501162007)

CURRENT-amd64% stat setup.py
   
954774858155 2384528 -rw-r--r-- 1 haypo haypo 18446744073709551615 99944 "Jul 
27 23:26:47 2017" "Jul 27 23:26:47 2017" "Jul 27 23:26:47 2017" "Jul 27 
23:26:47 2017" 100352 79 0x800 setup.py


The used filesystem for /home is ZFS:

CURRENT-amd64% df .
Filesystem   1K-blocks Used   Avail Capacity  Mounted on
storage/home  17041752 11205517 583623566%/usr/home

CURRENT-amd64% mount|grep home
storage/home on /usr/home (zfs, local, noatime, nfsv4acls)

--

___
Python tracker 

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



[issue31044] FAIL: test_makedev (test.test_posix.PosixTester) on AMD64 FreeBSD CURRENT

2017-07-27 Thread STINNER Victor

STINNER Victor added the comment:

I'm able to reproduce the bug on koobs's FreeBSD CURRENT:

* stat() returns st_dev = 0xde4d0429ab
* major(0xde4d0429ab) returns 0x29
* minor(0xde4d0429ab) returns 0x4d0400ab

minor() truncates most significant bits. major/minor are defined in sys/types.h:
https://github.com/freebsd/freebsd/blob/master/sys/sys/types.h#L372

#define major(x)((int)(((u_int)(x) >> 8)&0xff)) /* major number */
#define minor(x) ((int)((x)&0x00ff)) /* minor number */

The definition of minor() confirms that most significant bits are truncated by 
"& 0x00ff".

I'm surprised that stat().st_dev returns a device larger than INT_MAX: 
0xde4d0429ab.

--

___
Python tracker 

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



[issue30853] IDLE: configdialog -- factor out Tracer subclass

2017-07-27 Thread Cheryl Sabella

Changes by Cheryl Sabella :


--
pull_requests: +2966

___
Python tracker 

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



[issue30885] test_subprocess hangs on AMD64 Windows8.1 Refleaks 3.x

2017-07-27 Thread STINNER Victor

STINNER Victor added the comment:

test_subprocess also hangs on this Python 3.5 build. It's the only test not 
listed in the output:

http://buildbot.python.org/all/builders/AMD64%20Windows10%203.5/builds/356/steps/test/logs/stdio

...
1:01:45 [395/398] test_codecmaps_tw
1:01:47 [396/398] test_grammar
1:01:48 [397/398] test_posix
test_posix skipped -- No module named 'posix'

command timed out: 1200 seconds without output running 
['Tools\\buildbot\\test.bat', '-x64', '-j2', '--timeout', '900'], attempting to 
kill
program finished with exit code 1
elapsedTime=4915.543000

--

___
Python tracker 

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



[issue31055] All Sphinx generated pages could have a new "Edit This Page" link adjacent to the existing "Show Source"

2017-07-27 Thread Paul Hammant

New submission from Paul Hammant:

Show Source links to: 
https://github.com/python/cpython/blob/path/to/resource.rst

Edit This Page would link to
https://github.com/python/cpython/edit/path/to/resource.rst

And yes, GitHub does the right thing if you're not ordinarily permitted to 
change python/cpython

--
assignee: docs@python
components: Documentation
messages: 299306
nosy: Paul Hammant, docs@python
priority: normal
severity: normal
status: open
title: All Sphinx generated pages could have a new "Edit This Page" link 
adjacent to the existing "Show Source"
versions: Python 2.7

___
Python tracker 

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



[issue29902] copy breaks staticmethod

2017-07-27 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
assignee:  -> benjamin.peterson
nosy: +benjamin.peterson

___
Python tracker 

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



[issue30891] importlib: _find_and_load() race condition on sys.modules[name] check

2017-07-27 Thread STINNER Victor

STINNER Victor added the comment:

Victor:
> I'm not sure that backporting the unit test is interesting. If the test 
> fails, we will be unable to fix it.

Serhiy closed his PR:
https://github.com/python/cpython/pull/2645#event-1181495893

So now I close this issue.

--
resolution:  -> fixed
stage: needs patch -> resolved
status: open -> closed
versions:  -Python 3.5

___
Python tracker 

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



[issue30814] Import dotted name as alias breaks with concurrency

2017-07-27 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


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

___
Python tracker 

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



[issue30876] SystemError on importing module from unloaded package

2017-07-27 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



[issue30876] SystemError on importing module from unloaded package

2017-07-27 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:


New changeset f9fbed19a964e55ee703005823d8a7408f83d7f4 by Serhiy Storchaka in 
branch '3.5':
[3.5] bpo-30876: Add new import test files to projects. (GH-2851). (#2913)
https://github.com/python/cpython/commit/f9fbed19a964e55ee703005823d8a7408f83d7f4


--

___
Python tracker 

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



[issue30814] Import dotted name as alias breaks with concurrency

2017-07-27 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:


New changeset 95b16a9705d6b4d31c016c014e59744fc33d53ea by Serhiy Storchaka in 
branch '3.6':
[3.6] bpo-30814, bpo-30876: Add new import test files to projects. (GH-2851). 
(#2912)
https://github.com/python/cpython/commit/95b16a9705d6b4d31c016c014e59744fc33d53ea


--

___
Python tracker 

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



[issue30876] SystemError on importing module from unloaded package

2017-07-27 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:


New changeset 95b16a9705d6b4d31c016c014e59744fc33d53ea by Serhiy Storchaka in 
branch '3.6':
[3.6] bpo-30814, bpo-30876: Add new import test files to projects. (GH-2851). 
(#2912)
https://github.com/python/cpython/commit/95b16a9705d6b4d31c016c014e59744fc33d53ea


--

___
Python tracker 

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



[issue30931] Race condition in asyncore may access the wrong dispatcher

2017-07-27 Thread STINNER Victor

STINNER Victor added the comment:

Much shorter summary:

* Handlers of dispatcher must not be called if the dispatcher was called.
* If a dispatcher is closed between the execution of two of his handlers, the 
next handlers should not be called

My PR 2854 adds 3 unit tests to verify this behaviour of 3 different "race 
conditions".

--

___
Python tracker 

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



[issue30931] Race condition in asyncore may access the wrong dispatcher

2017-07-27 Thread STINNER Victor

STINNER Victor added the comment:

Ok, wow, the discussion on this issue, bpo-30985, PR 2854, PR 2804, etc. was 
very productive. We identified much more race conditions than the first one 
that I spotted.


(Bug 1) The dispatcher A closes the dispatcher B. Currently, asyncore calls the 
handlers of the dispatcher B.

Technically, the close() method of a dispatcher closes immediately a socket 
object. So it's very likely that handlers of the dispatcher B fails on recv(), 
send(), or any other operation on the socket.

There is also a risk that somehow dispatcher B tries to closes again the socket 
(technically, socket, pipe or something else) and gets a OSError(EBADF) or 
worse: closes an unrelated socket!


(Bug 2) Similar to (Bug 1), but the subtle coming from the current 
implementation causes even worse bugs. The dispatcher A closes the dispatcher 
B, and then the dispatcher A (or another dispatcher, it doesn't matter who make 
that) creates a new dispatcher C which reuses the same file descriptor than the 
old closed file descriptor of dispatcher B.

The consequence is that handlers of dispatcher C are called even if the socket 
is not ready to read or to write. Since sockets are non-blocking, recv() and 
send() are likely to fail with BlockingIOError. These errors are usually 
correctly handled in asynchronous code, but they can cause bugs. More 
generally, calling handlers when the socket is not ready can cause many kinds 
of bugs.


(Bug 3) If a socket is ready to read and ready to write, handle_read() and 
handle_write() handlers are expected to be called. The problem is when 
handle_read() (first called handler) closes the dispatcher.

It was decided to not call handle_write() is that case.


(Bug 4) Ok, this one is the best one :-) When a socket is ready, asyncore calls 
methods like handle_write_event(). These methods usually call a single handler 
like handle_write(), *but* sometimes can call multiple handlers like 
handle_connect() followed by handle_write(). If a first handler closes the 
dispatcher, the following handler may fail badly on trying to use a closed 
socket.

IMHO (Bug 3) and (Bug 4) are less surprising than (Bug 1) or (Bug 2) since they 
are determistic and so less "race condition". Since these bugs are determistic, 
I expect that applications are already written to handle these corner cases, 
somehow. The simplest option is to catch and ignore errors, asyncore already 
ignores many errors for us. For example asyncore already ignores EBADF, whereas 
IMHO it hides a design issue (the 4 bugs I just listed).

Technically, fixing (Bug 3) using my PR 2854 design (check if map[fd] is still 
the same dispatcher) is safe since it doesn't rely at all on the actual 
implementation of asyncore handle_xxx_event() (which can be overriden) not 
handle_xxx() methods defined by third party code.

Fixing (Bug 4) is more complex since it requires to decide how to detect that a 
dispatcher was closed (it seems like "dispatcher._fileno is None" test is the 
best choice), and to modify handle_xxx_event() methods, whereas these methods 
can and *are* overridden in subclasses.

--

About backward compatibility, in short, fixing any of these bug changes the 
exact behaviour, since fixing all these bugs require to *not* call a handler if 
the dispatcher was closed. *If* a specific application requires that handlers 
are called anyway, changes are likely to break these applications.

A workaround for these applications is to copy asyncore.py from an old Python 
version to keep the exact same behaviour. Another smoother workaround is to 
monkey-patch poll() and poll2(), and maybe also override handle_xxx_event() 
methods, to restore the old behaviour.

I don't want to add a flag to re-enable the old behaviour, since it seems like 
we all agree that the described bugs are clearly very bad design bugs and that 
they must be fixed.

--

Another option, Nir will probably not like it, is to consider that asyncore is 
dead and will not be fixed.

That's not my favorite option. Nir explained that on Python 2.7, asyncore is 
the most convenient module for his use case, he deeply rely on it, and so "just 
want" to fix know bugs.

--

I suggest to use this bpo to fix (Bug 1), (Bug 2) and (Bug 3), since they can 
all be fixed in poll() and poll2() with the same design, like my PR 2854.

For (Bug 4), I suggest to use bpo-30985 where we already discussed many options 
how to detect that a dispatcher was closed. I have no strong opinion on this 
bug, if it should be fixed or not. IMHO it's less important and applications 
already know how handle the bug.

--

___
Python tracker 

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



[issue31048] ResourceWarning in test_asyncio.test_events.ProactorEventLoopTests.test_create_server_ssl_verify_failed

2017-07-27 Thread Segev Finer

Changes by Segev Finer :


--
title: ResourceWarning in 
test_asyncio.test_events..ProactorEventLoopTests.test_create_server_ssl_verify_failed
 -> ResourceWarning in 
test_asyncio.test_events.ProactorEventLoopTests.test_create_server_ssl_verify_failed

___
Python tracker 

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



[issue31048] ResourceWarning in test_asyncio.test_events..ProactorEventLoopTests.test_create_server_ssl_verify_failed

2017-07-27 Thread Segev Finer

Changes by Segev Finer :


--
components: +asyncio
nosy: +yselivanov

___
Python tracker 

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



[issue30876] SystemError on importing module from unloaded package

2017-07-27 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
pull_requests: +2965

___
Python tracker 

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



[issue30876] SystemError on importing module from unloaded package

2017-07-27 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
pull_requests: +2964

___
Python tracker 

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



[issue30814] Import dotted name as alias breaks with concurrency

2017-07-27 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
pull_requests: +2963

___
Python tracker 

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



[issue29640] _PyThreadState_Init and fork race leads to inconsistent key list

2017-07-27 Thread Thomas Mortensson

Thomas Mortensson added the comment:

Hey, any status update on this bug? Suffered a similar issue on a Centos 6.5 
kernel when spawning multiple processes in a Twisted environment. Is this PR 
targeted for inclusion into the source tree? 

Thanks,

Tom

--
nosy: +Thomas Mortensson

___
Python tracker 

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



[issue30940] Documentation for round() is incorrect.

2017-07-27 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

In the documentation:

   For a general Python object ``number``, ``round(number, ndigits)`` delegates 
to
   ``number.__round__(ndigits)``.

Mark, is it worth to mention explicitly that round(number) and round(number, 
None) delegate to
number.__round__()?

The custom __round__() method should support calling without the argument, but 
it can not support calling with None.

--

___
Python tracker 

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



[issue31028] test_pydoc fails when run directly

2017-07-27 Thread STINNER Victor

Changes by STINNER Victor :


--
pull_requests: +2962

___
Python tracker 

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



[issue31028] test_pydoc fails when run directly

2017-07-27 Thread STINNER Victor

Changes by STINNER Victor :


--
pull_requests: +2961

___
Python tracker 

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



[issue30876] SystemError on importing module from unloaded package

2017-07-27 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:


New changeset d5ed47dea25e04a3a144eddf99a4ac4a29242dbc by Serhiy Storchaka in 
branch 'master':
bpo-30814, bpo-30876: Add new import test files to projects. (#2851)
https://github.com/python/cpython/commit/d5ed47dea25e04a3a144eddf99a4ac4a29242dbc


--

___
Python tracker 

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



  1   2   >