[issue24805] Python installer having problem in installing Python for all users in Windows

2015-10-27 Thread mandeep

mandeep added the comment:

But if there is a machine which  already has Python. If we remove python 
manually and try the script .

The python folder is created.
I can see python in start- all programs.
But PYTHON its missing from control panel. It does not allow me to uninstall.

--

___
Python tracker 

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



[issue23391] Documentation of EnvironmentError (OSError) arguments disappeared

2015-10-27 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

There is an outdated comment in Objects/exceptions.c that explains args 
hacking. It refers to no longer supported syntax:

except OSError, (errno, strerror):

--

___
Python tracker 

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



[issue25481] PermissionError in subprocess.check_output() when running as a different user (not login shell)

2015-10-27 Thread eryksun

eryksun added the comment:

In subprocess.py there's the following code that builds a sequence of potential 
paths for the executable [1]:

executable = os.fsencode(executable)
if os.path.dirname(executable):
executable_list = (executable,)
else:
# This matches the behavior of os._execvpe().
executable_list = tuple(
os.path.join(os.fsencode(dir), executable)
for dir in os.get_exec_path(env))

In this case it tries to execute "/home/user1/bin/asdf", which fails with 
EACCES (to log this using strace, use -f to follow the fork). This occurs in 
child_exec in _posixsubprocess.c, in the following loop [2]:

/* This loop matches the Lib/os.py _execvpe()'s PATH search when */
/* given the executable_list generated by Lib/subprocess.py. */
saved_errno = 0;
for (i = 0; exec_array[i] != NULL; ++i) {
const char *executable = exec_array[i];
if (envp) {
execve(executable, argv, envp);
} else {
execv(executable, argv);
}
if (errno != ENOENT && errno != ENOTDIR && saved_errno == 0) {
saved_errno = errno;
}
}
/* Report the first exec error, not the last. */
if (saved_errno)
errno = saved_errno;

saved_errno will be set to EACCES and stored back to errno after all attempts 
to execute potential paths fail. This is then reported back to the parent 
process, which raises a PermissionError.

[1]: https://hg.python.org/cpython/file/3.5/Lib/subprocess.py#l1463
[2]: https://hg.python.org/cpython/file/3.5/Modules/_posixsubprocess.c#l487

--
nosy: +eryksun

___
Python tracker 

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



[issue24805] Python installer having problem in installing Python for all users in Windows

2015-10-27 Thread mandeep

mandeep added the comment:

It works when I try it on a clean machine.

--
nosy: +manddy221

___
Python tracker 

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



[issue25356] Idle (Python 3.4 on Ubuntu) does not allow typing accents

2015-10-27 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Thank you for the confirmation that this is a tcl/tk problem. At least this 
report is here for anyone else using 8.6 with non-US keyboard on linux.

--
resolution:  -> third party
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue25488] IDLE: Remove idlelib from sys.path when added

2015-10-27 Thread Terry J. Reedy

New submission from Terry J. Reedy:

Problem: Consider module idlelib.run.  The following is correct.

C:\Users\Terry>python -c "import run"
Traceback (most recent call last):
  File "", line 1, in 
ImportError: No module named 'run'

But in IDLE started from icon or command line
>>> import run
>>> 

With respect to the goal of developing code that can run outside of IDLE, not 
raising ImportError is a bug. Suppose a user erroneously writes 'import run' or 
'import help' (in repository IDLE).  The error could be that the file is 
'runner' or 'helper' or that 'run' or 'help' is not in the same directory. The 
import should fail rather than the user getting a error later because the wrong 
file was imported.

Reason: When python runs 'somepath/file.py', it prepends 'somepath' to 
sys.path.  So when python runs '.../idlelib/whatever.py', it prepends 
'.../idlelib' to sys.path.  This occurs in both IDLE and user processes.

When 'somepath/file.py' is either on startup or from the editor, IDLE first 
prepends 'somepath' to sys.path just as python does.

We are planning to add perhaps 50 new short lowercase (PEP8) names to idlelib.  
This will greatly increase the possibility of accidentally matching something 
users write, if only in error, or even of  masking a stdlib module.

Solution: In PyShell.main and run.main, remove the prepended idlelib entry *if 
it is there* (see below).  On Windows, at least, for installed python, sys.path 
would then be identical on startup whether a file is run with python or IDLE.  

Would this affect IDLE itself?  I am sure not. AFAIK, IDLE does not exploit the 
presence of idlelib on sys.path, and always imports idlelib files via idlelib.

Further more, when IDLE is started from console Python with 'import 
idlelib.idle', which I regularly do for the repository version, '.../idlelib' 
is *not* prepended.  This is why IDLE should not depend on its presence and why 
removal should check first.  This also means that whether a file runs in IDLE 
depends on how IDLE is started, whether directly or via '>>> import 
idlelib.idle' within console python.


Note 1. idlelib.idle prepends repository 'lib' even when already present; this 
could be fixed also.  Another issue to track down, probably not due to IDLE, is 
that at least on Windows the binary directory is present twice.)

Note 2: The contents of sys.modules would still be different, along with the 
problem that 'import tkinter; tkinter.font' runs in IDLE.  (This example comes 
from a Stackoverflow question.) But this is a different issue and I cannot see 
a fix for it.

--
assignee: terry.reedy
messages: 253525
nosy: markroseman, terry.reedy
priority: normal
severity: normal
stage: needs patch
status: open
title: IDLE: Remove idlelib from sys.path when added
type: behavior
versions: Python 2.7, 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



[issue25467] Put “deprecated” warnings first

2015-10-27 Thread Tony R.

Tony R. added the comment:

> On Oct 26, 2015, at 4:28 PM, Ezio Melotti  wrote:
> 
> This is true, but on the other hand you might want to see the [new in 3.4] 
> while looking at 3.6 docs and working on a program that must support Python 
> 3.3+.  Anyway we can discuss this again once we have a patch -- depending on 
> how it is implemented, it might be easy enough to include the tag only for 
> functions added in the last 2 releases, or perhaps the tag won't be 
> particularly distracting and can be used for all versions.

Smart use of CSS and a sprinkle of JavaScript could solve this.  

- Add all versions in the markup
- By default, use CSS to hide all except latest version
- Using JavaScript and a simple `localStorage` variable, save a preference to 
“lower the version threshold” if desired

I tend to prefer non-JS solutions when possible, but this would only take a few 
lines of code.  (And of course, one `localStorage` variable along the lines of 
`minimumAddedInPythonVersion = ‘3.2’`, or whatever.)

—Tony

--

___
Python tracker 

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



[issue23237] Interrupts are lost during readline PyOS_InputHook processing (reopening)

2015-10-27 Thread Martin Panter

Martin Panter added the comment:

>From memory my biggest worry was changing the API (meaning of return value). I 
>don’t know what the policy is, but it might need a new separate API. You might 
>find more input from experts on the python-dev list or something.

--

___
Python tracker 

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



[issue25017] htmllib deprecated: Which library to use? Missing sane default in docs

2015-10-27 Thread Martin Panter

Martin Panter added the comment:

This looks good enough to me. I would have probably avoided littering the page 
with too many Deprecated and Note boxes, but I can respect your and Berker’s 
preference to add the separate box.

--

___
Python tracker 

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



[issue25228] Regression in cookie parsing with brackets and quotes

2015-10-27 Thread Pathangi Jatinshravan

Pathangi Jatinshravan added the comment:

Has there been any movement on this issue?

--

___
Python tracker 

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



[issue23735] Readline not adjusting width after resize with 6.3

2015-10-27 Thread Martin Panter

Martin Panter added the comment:

How does this patch affect a user-defined SIGWINCH handler, or is that not 
really supported when Readline is in use?

--
stage: needs patch -> patch review

___
Python tracker 

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



[issue25489] sys.exit() caught in exception handler

2015-10-27 Thread Brian Sutherland

New submission from Brian Sutherland:

Running the attached file with python3 shows that SystemExit is caught rather 
than causing the process to stop. That's quite surprising.

--
components: asyncio
files: test_sys_exit_in_exception_handler.py
messages: 253529
nosy: gvanrossum, haypo, jinty, yselivanov
priority: normal
severity: normal
status: open
title: sys.exit() caught in exception handler
versions: Python 3.5
Added file: 
http://bugs.python.org/file40867/test_sys_exit_in_exception_handler.py

___
Python tracker 

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



[issue25476] close() behavior on non-blocking BufferedIO objects with sockets

2015-10-27 Thread Martin Panter

Martin Panter added the comment:

David, what’s your use case for doing non-blocking buffered writing 
“correctly”? Would you be able to use the context manager functionality? I 
would have thought you would explicitly call flush() as many times as 
necessary, but only call close() once when you are done.

At least in blocking mode, close() is meant do as much as possible, despite any 
intermediate exceptions. It doesn’t seem wise to break this rule in 
non-blocking mode.

--
nosy: +martin.panter

___
Python tracker 

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



[issue25488] IDLE: Remove idlelib from sys.path when added

2015-10-27 Thread Terry J. Reedy

Terry J. Reedy added the comment:

When python is started without running a file (Windows icon or command line), 
'' is prepended to sys.path.  When IDLE is started from 3.5 icon, '' is 
prepended temporally after and spatially before '.../idlelib', so the latter, 
to be removed, is sys.path[1] and not sys.path[0].

'' in sys.path interpreted as the current working directory.

When IDLE is started from the command line with '-m idlelib' instead of 
'.../idlelib/idle.py' (for instance), the current working directory is added 
instead of .../idlelib (in second position).

Adding the startup current directory is redundant with '' until the user 
imports os and changes the cwd.  Then I expect the behavior of Shell to be 
different from python interactive mode, which would be a bug.  I will try to 
find a test case later.
  
PyShell.main manipulates 'sys.path' in lines 1521 and 1525, but these are 
sys.argv of the idle process, not the user process, each of which have their 
own sys.argv. If filenames are given on the command line to be edited, the 
directory of each is added to sys.path *for the idle process* (line 1521).  I 
suspect this is for completions. Line 1525 add the current working directory.  
I don't know why.  Perhaps it is a holdover for -n single process mode.

--

___
Python tracker 

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



[issue7322] Socket timeout can cause file-like readline() method to lose data

2015-10-27 Thread Martin Panter

Martin Panter added the comment:

IMO it might make sense in some cases to disallow subsequent reading from a 
buffered socket reader (or probably any BufferedReader) that raises an 
exception (not just a timeout). But the restriction seems unnecessary for 
unbuffered raw readers, and it also seems to go against the “consenting adults” 
philosophy for David Murray’s test server case.

David Beazley: For non-blocking sockets, the documentation currently says “the 
socket must be in blocking mode”. I’m not sure why that restriction is 
necessary; maybe it could be lifted at least for raw unbuffered streams.

Maybe you could make an argument for caching the partial data in the 
BufferedReader if a timeout (or no more non-blocking data, or other exception) 
occurs. The biggest problem is that it could mean storing more than the normal 
buffer size. I would think this would be a new feature (for 3.6+) rather than a 
behavioural bug fix though.

And see also Issue 13322 about inconsistencies with buffered reading 
non-blocking streams in general.

--
nosy: +martin.panter

___
Python tracker 

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



[issue25470] Random Malloc error raised

2015-10-27 Thread Martin Panter

Martin Panter added the comment:

Are you able to reproduce this easily? Perhaps a GDB backtrace might be useful, 
or posting instructions or code (simplified if possible) to reproduce it.

I’m guessing the Valgrind errors may be caused by the same problem that causes 
the initial assertion error.

--
nosy: +martin.panter
stage:  -> test needed

___
Python tracker 

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



[issue21998] asyncio: support fork

2015-10-27 Thread Christian H

Changes by Christian H :


--
nosy: +Christian H

___
Python tracker 

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



[issue25300] Enable Intel MPX (Memory protection Extensions) feature

2015-10-27 Thread Florin Papa

Florin Papa added the comment:

Hi Stefan,

The GCC MPX feature proved stable when using O0, having tested multiple times 
with regrtest on Skylake, Broadwell and Haswell.

Still, this is a new feature and GCC might improve it with time.

--

___
Python tracker 

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



[issue25467] Put “deprecated” warnings first

2015-10-27 Thread Ezio Melotti

Ezio Melotti added the comment:

I would rather avoid a JS-based solution.

It should be possible to create a mixin that adds the checks for 
deprecated/versionadded directives among the children of the node, and then 
define new directives for functions/methods/classes that inherit from the 
existing one and the mixin.
These directives can be added to 
https://hg.python.org/cpython/file/tip/Doc/tools/extensions/pyspecific.py

--

___
Python tracker 

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



[issue25492] subprocess with redirection fails after FreeConsole

2015-10-27 Thread George Prekas

New submission from George Prekas:

Under Windows, if I do FreeConsole and then subprocess.call with redirected 
stdin or stdout or stderr, then subprocess.call fails. The only solution is 
either DO NOT redirect any handle OR to redirect ALL of them. The problem lies 
in function _get_handles at subprocess.py:810 (Python 2.7.10), which does:
* GetStdHandle
* DuplicateHandle via _make_inheritable.

DuplicateHandle fails if called on stdin, stdout or stderr after FreeConsole.

$ cygstart /mnt/c/utils/Python35/python.exe testcase.py fails
$ cygstart /mnt/c/utils/Python35/python.exe testcase.py works1
$ cygstart /mnt/c/utils/Python35/python.exe testcase.py works2
$ cygstart /mnt/c/utils/Python35/python.exe testcase.py works3

--
components: Library (Lib)
files: testcase.py
messages: 253547
nosy: George Prekas
priority: normal
severity: normal
status: open
title: subprocess with redirection fails after FreeConsole
type: behavior
versions: Python 2.7, Python 3.5
Added file: http://bugs.python.org/file40868/testcase.py

___
Python tracker 

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



[issue25489] sys.exit() caught in exception handler

2015-10-27 Thread R. David Murray

R. David Murray added the comment:

Ah, I misunderstood your report, because I didn't actually run the example.  
The exception is being ignored because it is raised during a __del__ method 
execution.  This has nothing to do with set_exception_handler.  And in fact if 
you raise sys.exit in an excepthook handler it is ignored completely, so the 
cases are parallel in that sense.  Interestingly, if you replace your Exception 
in boom with sys.exit, your sys.exit in the handler actually works, because in 
that case the handler isn't getting called from the Task __del__.

I don't think there's a bug in python here, I think the bug is in your program. 
 You aren't yielding from the task, so the exception from boom only gets dealt 
with during Task finalization.  I find this to be the most confusing part of 
asyncio programming, myself.  I don't know why the handler doesn't get called 
just from creating the Task and running the loop. I often end up writing 
wrapper functions that yield from a function that does the work inside a 
try/except, and/or yield from the task in a 'wait_closed' method.

Maybe someone with more asyncio inside knowledge will be able to clear this up, 
and we can figure out a doc improvement.
I suspect we need a "best practices" document about this...

--

___
Python tracker 

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



[issue25487] imp module DeprecationWarning in test suite

2015-10-27 Thread Brett Cannon

Changes by Brett Cannon :


--
assignee:  -> brett.cannon

___
Python tracker 

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



[issue25489] sys.exit() caught in exception handler

2015-10-27 Thread Yury Selivanov

Yury Selivanov added the comment:

> because in that case the handler isn't getting called from the Task __del__

It's possible to fix -- see the attached future.patch.  And perhaps this should 
be fixed in Future.__del__ and Task.__del__ -- ignoring BaseExceptions isn't 
good.

--
keywords: +patch
Added file: http://bugs.python.org/file40869/future.patch

___
Python tracker 

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



[issue25491] ftplib.sendcmd only accepts string

2015-10-27 Thread wozlaf

New submission from wozlaf:

The FTP server (ProFTPD 1.3.5a) returns some file and folder names not properly 
encoded in UTF-8, when requesting with FTP command "MLSD" and "OPTS UTF8 ON".
To access I need to send them back to the server exactly as they came (bytes) 
with ftp.sendcmd(b"CWD" + path_bytes).

This results in an exception:
 File "C:\Python34\lib\ftplib.py", line 190, in putline
 line = line + CRLF
 TypeError: can't concat bytes to str

Sadly this makes ftplib only support sending of UTF-8 commands and file names. 
So I need to work around with my own version of "sendcmd" for now.

"ftplib.sendcmd()" should handle bytes and strings (UTF-8).

--
components: Library (Lib)
messages: 253542
nosy: wozlaf
priority: normal
severity: normal
status: open
title: ftplib.sendcmd only accepts string
type: behavior
versions: Python 3.4

___
Python tracker 

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



[issue25489] sys.exit() caught in exception handler

2015-10-27 Thread Brian Sutherland

Brian Sutherland added the comment:

the workaround I am using at the moment is this:

def handler(loop, context):
print('Got error, exiting')
loop.call_soon(sys.exit, 42)

which actually does cause the process to exit

--

___
Python tracker 

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



[issue25481] PermissionError in subprocess.check_output() when an inaccessible directory on the path

2015-10-27 Thread Gregory P. Smith

Gregory P. Smith added the comment:

Definitely a bug. The path search should silently skip directories it can't
access.

On Tue, Oct 27, 2015, 7:05 AM R. David Murray 
wrote:

>
> R. David Murray added the comment:
>
> So, two interesting questions: does this in fact match the behavior of
> os._execvpe, and does it match the behavior of the shell?  The latter would
> appear to be false, and could arguably be claimed to be a bug.  If we agree
> that it is, we need to learn what the behavior of the shell is in a bunch
> of corner cases (only inaccessible directories on path, only match is
> accessible but not executable, etc).
>
> If this is a bug I'd guess it applies to all supported python versions.
>
> Note that it should be possible to reproduce this using a single user, so
> I've changed the title accordingly.
>
> --
> nosy: +gps
> title: PermissionError in subprocess.check_output() when running as a
> different user (not login shell) -> PermissionError in
> subprocess.check_output() when an inaccessible directory on the path
>
> ___
> Python tracker 
> 
> ___
>

--
nosy: +gregory.p.smith

___
Python tracker 

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



[issue25490] small mistake in example for random.choice()

2015-10-27 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

There is no mistake. weighted_choices is a list of pairs.

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



[issue25493] warnings.warn: wrong stacklevel causes import of local file "sys"

2015-10-27 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis :


--
nosy: +Arfrever

___
Python tracker 

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



[issue25489] sys.exit() caught in exception handler

2015-10-27 Thread R. David Murray

R. David Murray added the comment:

Not until you convince me there is a reason for deviating from Python's normal 
__del__ handling :)  (Or other asyncio developers agree with you and not me.)

--

___
Python tracker 

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



[issue23735] Readline not adjusting width after resize with 6.3

2015-10-27 Thread Eric Price

Eric Price added the comment:

SIGWINCH handler for readline.  Fixed indentation issues.

--
Added file: http://bugs.python.org/file40870/rl_sigwinch_update.patch

___
Python tracker 

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



[issue23735] Readline not adjusting width after resize with 6.3

2015-10-27 Thread Eric Price

Changes by Eric Price :


Removed file: http://bugs.python.org/file40844/rl_sigwinch_update.patch

___
Python tracker 

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



[issue25483] Improve f-string implementation: FORMAT_VALUE opcode

2015-10-27 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



[issue25489] sys.exit() caught in exception handler

2015-10-27 Thread Yury Selivanov

Yury Selivanov added the comment:

> No, you are talking about *all* exceptions, since they all descend from 
> BaseException.  Python's normal __del__ handling just prints the ignored 
> exception to stdout, even if it is a BaseException.  Why should asyncio be 
> different (other than logging it instead, which would be useful)?

My bad -- my current patch does indeed re-raise all exceptions.  But would you 
be OK with something like this:

def __del__():
...

try:
self._loop.call_exception_handler(context)
except Exception as ex:
# log or re-raise
logger.log(...)
except BaseException as ex:
logger.error(
'BaseException in Future.__del__, will be re-raised soon',
exc_info=True)
def throw():
raise ex
self._loop.call_soon(throw)

--

___
Python tracker 

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



[issue25493] warnings.warn: wrong stacklevel causes import of local file "sys"

2015-10-27 Thread R. David Murray

Changes by R. David Murray :


--
nosy: +brett.cannon

___
Python tracker 

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



[issue25492] subprocess with redirection fails after FreeConsole

2015-10-27 Thread Zachary Ware

Changes by Zachary Ware :


--
components: +Windows
nosy: +eryksun, paul.moore, steve.dower, tim.golden, zach.ware

___
Python tracker 

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



[issue23735] Readline not adjusting width after resize with 6.3

2015-10-27 Thread Eric Price

Eric Price added the comment:

At the moment, it just overwrites any existing SIGWINCH handler.

I don't know how to do anything better -- one could try to store an existing 
SIGWINCH handler and call it, but it still wouldn't really work for an 
application that wanted to add and remove handlers.  I think such applications 
are rare, though -- readline mucks with the terminal in various ways, so it's 
unlikely that other applications will also muck with the terminal and expect to 
be compatible with it.

--

___
Python tracker 

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



[issue25489] sys.exit() caught in exception handler

2015-10-27 Thread R. David Murray

R. David Murray added the comment:

So, any exception raised in the exception handler will be re-raised via 
call_soon.  I think the message would be clearer if it said that (that the 
exception comes from the registered exception handler).

But, I'm not sure this is a good idea.  Exceptions are ignored in __del__ 
because they are asynchronous to the currently running code when the exception 
is executed (because they are triggered by garbage collection)...that is, 
there's no currently active statement when the exception is raised.  Just 
because asyncio is an async framework doesn't really change this fundamental 
truth (between explicit yield points, asyncio code is synchronous, that's its 
big attraction).

Making this change would make asyncio inconsistent with python's normal 
practice, and I don't (yet?) see a coherent motivation for doing so.

--

___
Python tracker 

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



[issue25489] sys.exit() caught in exception handler

2015-10-27 Thread Yury Selivanov

Yury Selivanov added the comment:

Trapping those exceptions in __del__ isn't good.

Another way to address this would be to at least modify call_exception_handler 
to log when an exception handler raises a BaseException error.

--

___
Python tracker 

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



[issue25493] warnings.warn: wrong stacklevel causes import of local file "sys"

2015-10-27 Thread Brett Cannon

Brett Cannon added the comment:

I'll have to dig into this to figure out what's going on, but since the sys 
module is built into Python it makes it so import won't accidentally import 
some file named sys. the real question is who thinks the 'sys' file should be 
considered.

--
assignee:  -> brett.cannon

___
Python tracker 

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



[issue25489] sys.exit() caught in exception handler

2015-10-27 Thread Yury Selivanov

Yury Selivanov added the comment:

I see your points, but we're talking about BaseExceptions here -- 
KeyboardInterrupt, SystemExit etc.  Those things usually mean that the program 
has to crash.

--

___
Python tracker 

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



[issue25489] sys.exit() caught in exception handler

2015-10-27 Thread R. David Murray

R. David Murray added the comment:

No, you are talking about *all* exceptions, since they all descend from 
BaseException.  Python's normal __del__ handling just prints the ignored 
exception to stdout, even if it is a BaseException.  Why should asyncio be 
different (other than logging it instead, which would be useful)?

--

___
Python tracker 

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



[issue25493] warnings.warn: wrong stacklevel causes import of local file "sys"

2015-10-27 Thread Michael Laß

New submission from Michael Laß:

When there is a file called "sys" in the local directory of a python script and 
warning.warn is called with an invalid stacklevel, python tries to import that 
file and throws an error like the following:

>>> import warnings
>>> warnings.warn("foo", Warning, stacklevel=2)
Traceback (most recent call last):
  File "/usr/lib/python3.5/tokenize.py", line 392, in find_cookie
line_string = line.decode('utf-8')
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x80 in position 24: 
invalid start byte

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/lib/python3.5/warnings.py", line 18, in showwarning
file.write(formatwarning(message, category, filename, lineno, line))
  File "/usr/lib/python3.5/warnings.py", line 26, in formatwarning
line = linecache.getline(filename, lineno) if line is None else line
  File "/usr/lib/python3.5/linecache.py", line 16, in getline
lines = getlines(filename, module_globals)
  File "/usr/lib/python3.5/linecache.py", line 47, in getlines
return updatecache(filename, module_globals)
  File "/usr/lib/python3.5/linecache.py", line 136, in updatecache
with tokenize.open(fullname) as fp:
  File "/usr/lib/python3.5/tokenize.py", line 456, in open
encoding, lines = detect_encoding(buffer.readline)
  File "/usr/lib/python3.5/tokenize.py", line 433, in detect_encoding
encoding = find_cookie(first)
  File "/usr/lib/python3.5/tokenize.py", line 397, in find_cookie
raise SyntaxError(msg)
SyntaxError: invalid or missing encoding declaration for 'sys'

In this case "sys" is a binary that belongs to openafs (/usr/bin/sys) and of 
course it is no valid python.

"import sys" produces no error though, so typically python is able to 
distinguish between its sys module and this file.

A workaround is to run python with the "-I" parameter.

Expected output:

>>> import warnings
>>> warnings.warn("foo", Warning, stacklevel=2)
sys:1: Warning: foo

This bug was spotted in Gnome's pygobject bindings. Here is the corresponding 
bug report:
https://bugzilla.gnome.org/show_bug.cgi?id=757184

--
components: Interpreter Core
messages: 253551
nosy: bevan-bi-co
priority: normal
severity: normal
status: open
title: warnings.warn: wrong stacklevel causes import of local file "sys"
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



[issue25479] Increase unit test coverage for abc.py

2015-10-27 Thread Brett Cannon

Changes by Brett Cannon :


--
stage:  -> patch review

___
Python tracker 

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



[issue8231] Unable to run IDLE without write-access to home directory

2015-10-27 Thread Mark Roseman

Mark Roseman added the comment:

Can I suggest that this issue continues to be about IDLE not being able to 
write its preferences directory/files due to permissions, and we create a new 
issue for the fact that IDLE is storing it in the wrong place under Windows?

--

___
Python tracker 

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



[issue25017] htmllib deprecated: Which library to use? Missing sane default in docs

2015-10-27 Thread Martin Panter

Martin Panter added the comment:

Not quite. This is a two-step deprecation:

1. “htmllib” is removed in favour of HTMLParser. The API is different, so no 
automatic 2to3 change would be practical.

2. HTMLParser is renamed to “html.parser”, and 2to3 handles this. This is 
already documented at .

--

___
Python tracker 

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



[issue25493] warnings.warn: wrong stacklevel causes import of local file "sys"

2015-10-27 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

The "sys" file is not imported. It is read by linecache.

warnings.warn() tries to determine the file name by looking at __file__ in 
module's globals. If it fails, it falls back to the module name. Definitely it 
fails also for builtin modules, binary extensions and zipimported modules.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue1117601] os.path.exists returns false negatives in MAC environments.

2015-10-27 Thread Stefano Mazzucco

Stefano Mazzucco added the comment:

FWIW, I have just been experiencing this on CentOS 6.5 with Python 2.7.5 
(sorry).

I could make the Python code happy by running chcon[1] with the correct context 
type, otherwise os.path.exists would happily return False for a file that 
actually existed.


[1] https://fedoraproject.org/wiki/SELinux/chcon

--
nosy: +stefano-m

___
Python tracker 

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



[issue25494] Four quotes used to begin docstring

2015-10-27 Thread John Mark Vandenberg

New submission from John Mark Vandenberg:

Introduced in the initial version of statistics was  starting a docstring

https://hg.python.org/cpython/annotate/685e044bed5e/Lib/statistics.py#l380

Somewhere the fourth quote is dropped, as it doesnt appear in the docs:

https://docs.python.org/3/library/statistics.html#statistics.median_grouped

--
assignee: docs@python
components: Documentation, Library (Lib)
files: cpython-statistics.patch
keywords: patch
messages: 253568
nosy: John.Mark.Vandenberg, docs@python
priority: normal
severity: normal
status: open
title: Four quotes used to begin docstring
type: enhancement
versions: Python 3.4, Python 3.5, Python 3.6
Added file: http://bugs.python.org/file40871/cpython-statistics.patch

___
Python tracker 

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



[issue25017] htmllib deprecated: Which library to use? Missing sane default in docs

2015-10-27 Thread R. David Murray

R. David Murray added the comment:

OK, then the note should be dropped.

--

___
Python tracker 

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



[issue25493] warnings.warn: wrong stacklevel causes import of local file "sys"

2015-10-27 Thread R. David Murray

R. David Murray added the comment:

Hmm.  I remember fixing problems with linecache and inspect.  I wonder if this 
is a variation on that?  I don't remember the issue number.

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



[issue25470] Random Malloc error raised

2015-10-27 Thread augustin rieunier

augustin rieunier added the comment:

I should be able to reproduce it yes.
Can't really give the code, as it's in a big program i'm working on, and it's 
never at the same place ..
One thing though: it never happened on QA/UAT environments. So it might be 
linked to something (libs, programs) on my dev environment.

Will update this with gdb data when I have some time :)

--

___
Python tracker 

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



[issue25494] Four quotes used to begin docstring

2015-10-27 Thread John Mark Vandenberg

John Mark Vandenberg added the comment:

The additional quotation mark is shown in help()

>>> help(statistics.median_grouped)
Help on function median_grouped in module statistics:

median_grouped(data, interval=1)
"Return the 50th percentile (median) of grouped continuous data.

--

___
Python tracker 

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



[issue6860] Inconsistent naming of custom command in setup.py help output

2015-10-27 Thread Camilla Montonen

Camilla Montonen added the comment:

Apologies, I should have clarified:
I can still replicate the bug in the original post, but I no longer believe 
this is an issue, because the wording in the documentation has been changed 
for Python 2.X 
https://docs.python.org/2/distutils/apiref.html#creating-a-new-distutils-command

and for Python 3.X
https://docs.python.org/3/distutils/apiref.html#creating-a-new-distutils-command

--

___
Python tracker 

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



[issue6860] Inconsistent naming of custom command in setup.py help output

2015-10-27 Thread Camilla Montonen

Camilla Montonen added the comment:

This is still an issue in Python 3.4.3, but I believe the relevant 
documentation has been changed already to alert users to the fact that the 
class name and the command name should be the same. 

Quoting from: 
https://docs.python.org/3/distutils/apiref.html#module-distutils.command

Copy this file to a new module with the same name as the new command you’re 
implementing. This module should implement a class with the same name as the 
module (and the command). So, for instance, to create the command peel_banana 
(so that users can run setup.py peel_banana), you’d copy command_template to 
distutils/command/peel_banana.py, then edit it so that it’s implementing the 
class peel_banana, a subclass of distutils.cmd.Command.


Following this documentation, a user would not implement a custom command class 
called 'TestClass' with a command called 'test'.

--
nosy: +Winterflower

___
Python tracker 

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



[issue25492] subprocess with redirection fails after FreeConsole

2015-10-27 Thread eryksun

eryksun added the comment:

For me, fails() lives up to its name in Windows 7, but it doesn't fail in 
Windows 10. It shouldn't fail in Windows 8, either. 

In Windows 8+ the console interface is implemented using a kernel device. 
Console handles reference virtual files on the ConDrv device, such as Connect, 
Input, and Output. The example doesn't fail because the I/O handles (Input and 
Output) are valid even if the main console handle (Connect) has been closed by 
calling FreeConsole. 

OTOH, prior to Windows 8, console I/O handles don't reference kernel objects. 
You may have noticed that the old API tags the values by setting the lower 2 
bits (e.g. 3, 7, 11). This enables redirecting actions on console I/O handles 
to functions in the console host process (i.e. conhost.exe in Win 7, and 
csrss.exe in XP/Vista). For example, for a regular kernel object, the 
DuplicateHandle API is serviced by the system call NtDuplicateObject. But for a 
console handle, Windows instead sends the request to the console LPC port, to 
be dispatched to SrvDuplicateHandle in the console. Obviously this can't work 
after the client has called FreeConsole. 

Prior to Windows 8, this invalid-handle error can also be the result of running 
pythonw.exe from a console application such as python.exe or cmd.exe. See issue 
3905. In this case Windows is copying the values of the parent's standard 
handles into the pythonw.exe process parameters, but they're meaningless values 
since pythonw.exe doesn't attach to a console automatically. (You could of 
course manually call AllocConsole or AttachConsole.) The new implementation in 
Windows 8 and 10 is smart enough to initialize the standard handles to 0 in 
this case. Thus in Windows 10 Terry's example in msg220218 doesn't raise and 
exception, and p.stdout.read() == b'32\r\n'.

A workaround for Python 3.4+ on older Windows versions would be to check 
os.get_handle_inheritable, which calls WinAPI GetHandleInformation [1]:

ERROR_INVALID_HANDLE = 0x0006

if stdin is None:
p2cread = _winapi.GetStdHandle(_winapi.STD_INPUT_HANDLE)
try:
os.get_handle_inheritable(p2cread)
except OSError as e:
if e.winerror != ERROR_INVALID_HANDLE:
raise
p2cread = None
if p2cread is None:
p2cread, _ = _winapi.CreatePipe(None, 0)
p2cread = Handle(p2cread)
_winapi.CloseHandle(_)

For 2.7, GetHandleInformation could be added to _subprocess. But then it may as 
well be added to Python 3's _winapi as well. 

[1]: https://msdn.microsoft.com/en-us/library/ms724329

--
versions: +Python 3.4, Python 3.6

___
Python tracker 

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



[issue25494] Four quotes used to begin docstring

2015-10-27 Thread John Mark Vandenberg

John Mark Vandenberg added the comment:

Thank you for clarifying that.
Does that mean that this issue should not be assigned to docs@python and should 
not have a Component of 'Documentation'?

--

___
Python tracker 

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



[issue25454] operator.methodcaller should accept additional arguments during the call

2015-10-27 Thread Josh Rosenberg

Josh Rosenberg added the comment:

I could see the argument for this to make methodcaller more like an unbound 
version of functools.partial. Partial lets you prebind some things and not 
others, you might want to do the same thing with methods, where you prebind the 
method name and some arguments, but dynamically bind the instance and some 
additional arguments.

--
nosy: +josh.r

___
Python tracker 

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



[issue25495] binascii documentation incorrect

2015-10-27 Thread R. David Murray

R. David Murray added the comment:

I agree that the documentation is not optimal.  To give you some background, 
binascii was primarily implemented to support the email module, and the 
standard it is referring to is in fact the MIME standard that references base64 
(I believe at the time the independent base64 standard did not exist).  The 
number 57 is derived from the fact that 57 * 4/3 = 76; that is, input data of 
length 57 will result in an encoded line that is equal to the maximum 
recommended line length.  Thus in encoding an email the email package 
(originally, it no longer does this) passed the data in in 57 byte chunks and 
appended the resulting lines to the output buffer.

So, this documentation is historically correct, but no longer particularly 
useful.  Suggested improvements are welcome.  

This state of affairs exists because the binascii module doesn't really have a 
current maintainer. Someday I'd love to have enough time to pick it up, since I 
maintain email and it is still used by email (and could be used better, with 
some module improvements).

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



[issue25492] subprocess with redirection fails after FreeConsole

2015-10-27 Thread eryksun

eryksun added the comment:

I forgot to first check whether p2cread is None:

ERROR_INVALID_HANDLE = 0x0006

if stdin is None:
p2cread = _winapi.GetStdHandle(_winapi.STD_INPUT_HANDLE)
if p2cread is not None:
try:
os.get_handle_inheritable(p2cread)
except OSError as e:
if e.winerror != ERROR_INVALID_HANDLE:
raise
p2cread = None
if p2cread is None:
p2cread, _ = _winapi.CreatePipe(None, 0)
p2cread = Handle(p2cread)
_winapi.CloseHandle(_)

--

___
Python tracker 

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



[issue8231] Unable to run IDLE without write-access to home directory

2015-10-27 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Yes, that is what this issue *is* about.  IDLE, like Python itself, expects to 
be run on machines that users can write to normally, that have not been 
crippled by bureaucratic policies, or by users. The editor is useless if the 
user cannot write files somewhere.  None of this is specific to Windows.

Ned's idea of a temporary directory seems easy.  Change the warning and 
replace'raise SystemExit' with 'td = tempfile.TemporaryDirectory(); userDir = 
td.name' (see msg222694).  For 2.7, however, TemporayDirectory is not 
available. For the underlying mkdtemp, the user "is responsible for deleting 
the temporary directory and its contents when done with it."  (I presume 
failure of apps to do this is why temp file cleanup is needed.)  My inclination 
for 2.7 would be to copy a stripped down copy of TemporaryDirectory with just 
the finalizer code.  In fact, since we do not need or want the implicit cleanup 
warning (do we?), we could do that for all versions.

We do not have to accommodate all possibilities. One report, possibly on 
Stackoverflow, was from a user whose home dir and, I presume, appdata dir, were 
on a remote server.  Maybe he also had an offline home dir, I don't remember.  
In any case, IDLE was not happy with the setup.

As I said before, permanently and unconditionally moving user config files on 
Windows will break compatibility with all previous releases, so I would not do 
that unless we decide to break compatibility anyway, for reasons other than 
MS's recommendations.  However, after a general solution is applied we could 
consider in a separate issue using Appdata as future-looking, Windows-specific 
alternative to a temporary directory.  However, this would require careful 
though lest we end up with two userdirs because the non-writability of homedir 
is only temporary.

--
type: behavior -> enhancement

___
Python tracker 

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



[issue25489] sys.exit() caught in exception handler

2015-10-27 Thread Guido van Rossum

Guido van Rossum added the comment:

Whew. Complex issue!

The OP should probably use his workaround or call loop.stop() instead of 
raising SystemExit.

Asyncio in general is rather careless about "true" BaseExceptions (i.e. that 
aren't also Exceptions), we should decide what we want to do for these (there 
are definitely ways to get in a bad state if you catch one and then resume the 
loop).

call_exception_handler() tries to log and then ignore exceptions raised by the 
handler, so the except clause Yuri's patch adds to __del__ in fact will only 
see true BaseExceptions.

Adding an except clause to __del__ seems very unprincipled -- there's another 
__del__ that would require the same treatment (all our __del__ methods seem to 
call call_exception_handler()) and *if* we want to catch it we should probably 
do it in call_exception_handler().

boom() does in fact yield.

--

___
Python tracker 

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



[issue25494] Four quotes used to begin docstring

2015-10-27 Thread Emanuel Barry

Emanuel Barry added the comment:

I don't know why you believe docstrings are programmatically linked to the 
library reference...

Here is the file that is used to make the online documentation: 
https://hg.python.org/cpython/file/tip/Doc/library/statistics.rst

--
nosy: +ebarry

___
Python tracker 

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



[issue25495] binascii documentation incorrect

2015-10-27 Thread Mouse

New submission from Mouse:

binascii b2a_base64() documentation says:

The length of data should be at most 57 to adhere to the base64 standard.

This is incorrect, because there is no base64 standard that restricts the 
length of input data, especially to such a small value.

What RFC4648 (that superseded RFC3548 that your documentation still keeps 
referring to) actually says is that MIME enforces the limit ofthe OUTPUT LINE 
length at 76, but NOT of the entire output, and certainly not of the entire 
input.

Please correct the documentation, making it conformant with what the ACTUAL 
base64 standard says.

See https://en.wikipedia.org/wiki/Base64 and
https://tools.ietf.org/html/rfc4648

Thanks!

--
assignee: docs@python
components: Documentation
messages: 253572
nosy: docs@python, mouse07410
priority: normal
severity: normal
status: open
title: binascii documentation incorrect
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



[issue25494] Four quotes used to begin docstring

2015-10-27 Thread Zachary Ware

Zachary Ware added the comment:

Documentation is fine for docstrings, it gets the attention of the docs@ list.  
Library is also fine, since the change actually goes in Lib/.  Both is most 
correct :)

Thanks for the report and patch!

--
nosy: +zach.ware

___
Python tracker 

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



[issue25494] Four quotes used to begin docstring

2015-10-27 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 041701817c5d by Zachary Ware in branch '3.4':
Issue #25494: Remove extra quote from docstring.
https://hg.python.org/cpython/rev/041701817c5d

New changeset 2dd97ad96021 by Zachary Ware in branch '3.5':
Issue #25494: Merge with 3.4
https://hg.python.org/cpython/rev/2dd97ad96021

New changeset d9bb7a3ed51e by Zachary Ware in branch 'default':
Closes #25494: Merge with 3.5
https://hg.python.org/cpython/rev/d9bb7a3ed51e

--
nosy: +python-dev
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



[issue25439] Add type checks to urllib.request.Request

2015-10-27 Thread Nan Wu

Nan Wu added the comment:

The do_request_() method which is defined in AbstractHTTPHandler seems not 
cover the check at least for the first case Ezio brought up. `unknown_open` has 
been called and gives out a relatively confusing message.

--

___
Python tracker 

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



[issue25454] operator.methodcaller should accept additional arguments during the call

2015-10-27 Thread Raymond Hettinger

Raymond Hettinger added the comment:

I would rather leave lambda or plain function definitions as the way to handle 
any cases not covered by itergetter, attrgettr, and methodcaller.   It feels 
like we're working way too hard to produce more ways to do it.   

Also, the suggested use cases with all() and map() would likely be expressed 
more cleanly (and readably) with a list comprehension.  The reduce() example 
isn't clear at all (that is part of the reason it was banished to the functools 
module).  I would not want to encounter any of the examples during a debugging 
session.

I think we should decline this feature request as being "a bridge too far" and 
not what the zen-of-python would encourage us to do.  I can't think of any 
existing code that would be improved by the availability of this extension.  
Instead, we ought to focus on making the core language as expressive as 
possible.

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



[issue25439] Add type checks to urllib.request.Request

2015-10-27 Thread Martin Panter

Martin Panter added the comment:

I meant removing one of the checks in AbstractHTTPHandler.do_request_(). I left 
a note in the review at the relevant line.

One more thing I forgot to mention, although I am afraid it is 90% nit picking 
the dict iterable check. For the “http:” scheme, an iterable of “bytes-like” 
objects is supported (again not documented though). For HTTPS (over SSL), not 
every bytes-like object is supported, but common ones like bytearray() still 
work I think.

--

___
Python tracker 

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



[issue25439] Add type checks to urllib.request.Request

2015-10-27 Thread Nan Wu

Nan Wu added the comment:

Will fix the other two issues. Thanks.

--

___
Python tracker 

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



[issue25494] Four quotes used to begin docstring

2015-10-27 Thread Emanuel Barry

Emanuel Barry added the comment:

It probably shouldn't be assigned to docs@python, but it's still a typo in the 
source code, so it should probably be under Library anyway.

LGTM

--

___
Python tracker 

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



[issue25489] sys.exit() caught in exception handler

2015-10-27 Thread R. David Murray

R. David Murray added the comment:

I expected this function to be parallel to sys.excepthook, but I see that 
sys.excepthook does not get called if you call sys.exit() at the python prompt. 
 So I guess I agree with you that it is surprising, although I actually 
expected the opposite (that sys.excepthook would get called for sys.exit).

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



[issue25017] htmllib deprecated: Which library to use? Missing sane default in docs

2015-10-27 Thread R. David Murray

R. David Murray added the comment:

The note should actually be parallel to the http one (assuming 2to3 does do the 
translation), rather than say "use instead", which would be incorrect advice 
for a python2 user :)

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



[issue25490] small mistake in example for random.choice()

2015-10-27 Thread Anton Tagunov

New submission from Anton Tagunov:

Invalid example at this page: https://docs.python.org/3.6/library/random.html

'.items()' is missed in the line below:

>>> population = [val for val, cnt in weighted_choices for i in range(cnt)]


The correct variant:

>>> population = [val for val, cnt in weighted_choices.items() for i in 
>>> range(cnt)]

--
assignee: docs@python
components: Documentation
messages: 253537
nosy: Anton Tagunov, docs@python
priority: normal
severity: normal
status: open
title: small mistake in example for random.choice()
versions: Python 3.5, Python 3.6

___
Python tracker 

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



[issue25300] Enable Intel MPX (Memory protection Extensions) feature

2015-10-27 Thread Stefan Krah

Stefan Krah added the comment:

> The Python MPX binary will be built with –O0 because other optimization 
> levels will change instruction order and cause crashes, making it useful for 
> debugging purposes.

I've trouble understanding this: Is the gcc mpx feature not stable?



Looking at the patch, we'd introduce many new macros for everyone
to learn, but I'm generally not too enthusiastic about the proliferation
of memory protection schemes after having been bitten by a bug in
FORTIFY_SOURCE memmove wrappers. :(

--

___
Python tracker 

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



[issue25481] PermissionError in subprocess.check_output() when an inaccessible directory on the path

2015-10-27 Thread R. David Murray

R. David Murray added the comment:

So, two interesting questions: does this in fact match the behavior of 
os._execvpe, and does it match the behavior of the shell?  The latter would 
appear to be false, and could arguably be claimed to be a bug.  If we agree 
that it is, we need to learn what the behavior of the shell is in a bunch of 
corner cases (only inaccessible directories on path, only match is accessible 
but not executable, etc).

If this is a bug I'd guess it applies to all supported python versions.

Note that it should be possible to reproduce this using a single user, so I've 
changed the title accordingly.

--
nosy: +gps
title: PermissionError in subprocess.check_output() when running as a different 
user (not login shell) -> PermissionError in subprocess.check_output() when an 
inaccessible directory on the path

___
Python tracker 

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