[issue5901] missing meta-info in documentation pdf

2016-04-01 Thread Berker Peksag

Berker Peksag added the comment:

I get the following output when I try Python 3.5.1 docs:

$ pdfinfo using.pdf 
Title:  
Subject:
Keywords:   
Author: 
Creator:LaTeX with hyperref package
Producer:   pdfTeX-1.40.14
CreationDate:   Sat Apr  2 00:17:54 2016
ModDate:Sat Apr  2 00:17:54 2016
Tagged: no
Pages:  69
Encrypted:  no
Page size:  595.276 x 841.89 pts (A4)
File size:  368343 bytes
Optimized:  no
PDF version:1.5

--
nosy: +berker.peksag
stage:  -> needs patch
type: resource usage -> behavior
versions: +Python 3.5, Python 3.6 -Python 3.3

___
Python tracker 

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



[issue26647] ceval: use Wordcode, 16-bit bytecode

2016-04-01 Thread Demur Rumed

Demur Rumed added the comment:

Got f_lasti working as -1. Applied PEP7. Unrelated: fixed a misnamed variable 
in test_grammar because it ran into a peephole bug (const -> jump_if_false 
erase didn't work when EXTENDED_ARGs were involved). dis has argval/arg set to 
None instead of the unused argument value

Things are seeming more brittle with f_lasti as -1. But maybe it's all in my 
head

--
Added file: http://bugs.python.org/file42353/wpy4.patch

___
Python tracker 

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



[issue26657] Directory traversal with http.server and SimpleHTTPServer on windows

2016-04-01 Thread Martin Panter

Martin Panter added the comment:

Thomas: My check for os.path.devnull was just a half-hearted attempt to check 
for special device names like NUL on Windows. It is far from foolproof, and 
would fail my CON.fusion test that I mentioned above. Anyway, to address this 
specific bug it would be better to keep the changes to a minimum and not add 
any new APIs.

One slight concern I have with Philipp’s patch is the new os_path parameter. I 
am a bit squeamish about adding parameters that are just to help testing. 
Perhaps it is enough to just rely on testing this on Windows, or to 
monkey-patch os.path = ntpath in the test suite? What do others think?

I am posting a modified version (v3) of Philipp’s patch. This version 
monkey-patches os.path in the tests and avoids the os_path parameter. It is 
also stricter, by ignoring any path component that does not appear to be a 
simple file or directory name.

This version will change how some questionable URLs are handled, but I expect 
that all of these URLs won’t have genuine use cases. Let me know if you think 
it is okay or not.

--
stage:  -> patch review
Added file: http://bugs.python.org/file42352/fix-path-traversal-26657.v3.patch

___
Python tracker 

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



[issue21069] test_fileno of test_urllibnet intermittently fails

2016-04-01 Thread Martin Panter

Martin Panter added the comment:

Here is a patch implementing my ideas. Let me know what you think of the ideas 
and/or the patch :)

If people think this change is too much for 3.5, I could try making a more 
minimal patch that calls something like socket.getpeername() rather than 
read(). That should also avoid the non-blocking problem.

--
keywords: +patch
stage: needs patch -> patch review
Added file: http://bugs.python.org/file42351/rewrite-fileno.patch

___
Python tracker 

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



[issue26679] curses: Descripton of KEY_NPAGE and KEY_PPAGE inverted

2016-04-01 Thread Berker Peksag

Berker Peksag added the comment:

Thanks, Robert and SilentGhost.

I verified the patch with the following script:

import curses


def main(stdscr):
while True:
c = stdscr.getch()
if c == curses.KEY_PPAGE:
stdscr.addstr('Page Up')
elif c == curses.KEY_NPAGE:
stdscr.addstr('Page Down')
else:
stdscr.addstr('Another key')

curses.wrapper(main)

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



[issue26679] curses: Descripton of KEY_NPAGE and KEY_PPAGE inverted

2016-04-01 Thread Roundup Robot

Roundup Robot added the comment:

New changeset f41d3321007f by Berker Peksag in branch '3.5':
Issue #26679: Fix description of KEY_PPAGE and KEY_NPAGE constants
https://hg.python.org/cpython/rev/f41d3321007f

New changeset 23d986228c6b by Berker Peksag in branch 'default':
Issue #26679: Fix description of KEY_PPAGE and KEY_NPAGE constants
https://hg.python.org/cpython/rev/23d986228c6b

--
nosy: +python-dev

___
Python tracker 

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



[issue26688] unittest2 referenced in unittest.mock documentation

2016-04-01 Thread Berker Peksag

Berker Peksag added the comment:

Good catch, thanks Ashley!

3.3 and 3.4 are in security-fix-only mode so we don't fix documentation issues 
in those branches.

--
nosy: +berker.peksag
resolution:  -> fixed
stage:  -> resolved
status: open -> closed
type:  -> behavior
versions:  -Python 3.3, Python 3.4

___
Python tracker 

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



[issue26688] unittest2 referenced in unittest.mock documentation

2016-04-01 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 73279e4a1107 by Berker Peksag in branch '3.5':
Issue #26688: Fix module name in mock docs
https://hg.python.org/cpython/rev/73279e4a1107

New changeset 24efe844e598 by Berker Peksag in branch 'default':
Issue #26688: Fix module name in mock docs
https://hg.python.org/cpython/rev/24efe844e598

--
nosy: +python-dev

___
Python tracker 

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



[issue26488] hashlib command line interface

2016-04-01 Thread Martin Panter

Martin Panter added the comment:

I left some replies to Rietveld comments (sending review emails seems buggy).

For a chunk size, don’t worry too much about it. I would say keep it large 
enough to limit time spent executing Python code and syscalls, keep it small to 
avoid wasting high speed cache memory, and keep it a power of two to work with 
OS and filesystem buffers.

--
dependencies:  -argparse.FileType for '-' doesn't work for a mode of 'rb'

___
Python tracker 

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



[issue26678] Incorrect linking to elements in datetime package

2016-04-01 Thread Martin Panter

Martin Panter added the comment:

Can you link to other methods? E.g. try io.IOBase.close(), which is done the 
normal way as a method indented under its class, and nntplib.NNTP.quit(), which 
is listed separately from its class definition. 

Regarding CRLFs in “configure”, all I can guess is some strange Mercurial user 
configuration. Maybe you can work around it by using the “dos2unix” command, or 
rebuilding the script with “autoreconf”.

--
versions: +Python 2.7, Python 3.5

___
Python tracker 

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



[issue26678] Incorrect linking to elements in datetime package

2016-04-01 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 30e077f886cc by Martin Panter in branch '3.5':
Issue #26678: Fix indexing of datetime.tzinfo and timezone classes
https://hg.python.org/cpython/rev/30e077f886cc

New changeset 854db1a2cd98 by Martin Panter in branch 'default':
Issue #26678: Merge datetime doc fixes from 3.5
https://hg.python.org/cpython/rev/854db1a2cd98

New changeset 4cad272cec82 by Martin Panter in branch '2.7':
Issue #26678: Fix datetime.tzinfo indexing and “tzinfo” attribute links
https://hg.python.org/cpython/rev/4cad272cec82

--
nosy: +python-dev

___
Python tracker 

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



[issue26646] Allow built-in module in package

2016-04-01 Thread Brett Cannon

Brett Cannon added the comment:

Referring to the other issue was more about tying the two issues together than 
necessarily expecting the other patch to work.

As for supporting packages as well as submodules, I'm not sure. It seems a 
little odd not to support the idea, but then again if something is built-in 
then there really isn't a need to support the concept of a directory containing 
more modules. But then again since there is a difference in terms of how a 
module vs package looks it should probably be supported.

And if you do try and support it, there might be nothing more needed than to 
have the module be named pkg.__init__ and have some special handling to strip 
out the '__init__' part of the name and to set `__path__ = []` in importlib. 
Then importlib can simply try for `name` and `name.__init__` and then use that 
to figure out if the module should be considered a package or not.

This whole issue is unfortunately one of those things where it's uncommon 
enough to have to think about all edge cases and the overall impact on other 
users if the suggested changes are made and to not have a clear-cut answer.

--

___
Python tracker 

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



[issue26686] email.parser stops parsing headers too soon.

2016-04-01 Thread Martin Panter

Martin Panter added the comment:

Also see Issue 24363, basically the same bug in the HTTP parser, which 
(ab?)uses the email package to do most of the work. In that case, according to 
my note the faulty header field ends with:

X-Frame-Options: SAMEORIGIN\r\n
Set-Cookie: mb-CookieP=; HttpOnly; \r\n
Secure\r\n
Set-Cookie: mb-CookieP=; HttpOnly; Secure\r\n
\r\n

But in this case, perhaps because of the implications of dropping the “Secure” 
flag, people are asking that the faulty line be appended to the previous header 
field. IMO I don’t think that is super important though. An alternative would 
be to add it to the defect list, and then raise an exception or warning if any 
defects are detected.

--
nosy: +martin.panter

___
Python tracker 

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



[issue26646] Allow built-in module in package

2016-04-01 Thread Daniel Shaulov

Daniel Shaulov added the comment:

Hi Brett,

I don't think that the patch from that issue is relevant anymore.
I did take the test case that was proposed in that issue and I am attaching a 
fixed version here.

I did realize from the discussion that my patch probably doesn't work on 
Windows (I think the change itself is fine - It's just won't have the test 
module), I will try to get a working Windows environment and make the 
appropriate changes tomorrow.

Also, the other issue was also asking for built-in packages and not just 
built-in submodules. I already have a note about that in my original message.
Can we move forward as-is or do you want me to add support for built-in 
packages as well?

--
Added file: http://bugs.python.org/file42350/test_builtin_submodule.py

___
Python tracker 

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



[issue26642] Replace stdout and stderr with simple standard printers at Python exit

2016-04-01 Thread STINNER Victor

STINNER Victor added the comment:

+if (!closed) {
+PyObject *res = PyObject_CallMethod(file, "close", "");
+PyErr_Clear();
+Py_XDECREF(res);
+}
+if (!dunder_closed) {
+PyObject *res = PyObject_CallMethod(dunder_file, "close", "");
+PyErr_Clear();
+Py_XDECREF(res);
+}

Hum, since it's common to have sys.__stderr__ = sys.stderr, maybe it's worth to 
skip the second close if dunder_file == file?

--

___
Python tracker 

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



[issue26668] Remove Lib/test/test_importlib/regrtest.py?

2016-04-01 Thread STINNER Victor

STINNER Victor added the comment:

> once I/someone double-checks that all the tests in 
> test.test_importlib.import_ are doing the right thing in regards to 
> util.test_both(..., __import__=util.__import__).

Ah, I didn't understand that it was a question. I'm not interested to check 
that.

--

___
Python tracker 

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



[issue26642] Replace stdout and stderr with simple standard printers at Python exit

2016-04-01 Thread STINNER Victor

STINNER Victor added the comment:

Patch version 2:

* check if the stream was already "closed" (see below and comment in the patch)
* first replace stream and then close it and DECREF the object
* don't close stdin anymore


> 1. Is there a reason only name is closed, not dunder_name? (Josh's question, 
> but I'm interesting too).

Fixed.

> 2. Is it worth to first replace standard streams with "standard printers", 
> and then close original streams? This allows to log warnings from closing 
> streams.

Fixed.

> 3. "standard printers" are used at startup and at shutdown. Can we reuse some 
> code?

I looked at the code creating standard printer during Python startup: it's just 
a few lines and it doesn't handle the case when stdout/stderr is already open. 
I don't think that it's worth to reuse code.

Anyway, with my new patch, the code is much more complex to handle the case if 
stderr and/or __stderr__ is "closed" (is NULL, None, getting closed attribute 
raises an error, or closed attribute is false).

> 4. Daemons close standard streams and fileno(stdout) can return unrelevant 
> value.

Fixed.

--
Added file: http://bugs.python.org/file42349/replace_stdio-2.patch

___
Python tracker 

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



[issue26668] Remove Lib/test/test_importlib/regrtest.py?

2016-04-01 Thread Brett Cannon

Brett Cannon added the comment:

Yes, I'm fine with removing it once I/someone double-checks that all the tests 
in test.test_importlib.import_ are doing the right thing in regards to 
util.test_both(..., __import__=util.__import__).

--

___
Python tracker 

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



[issue26673] Tkinter error when opening IDLE configuration menu

2016-04-01 Thread Terry J. Reedy

Terry J. Reedy added the comment:

I should have thought of .idlerc as being a possible problem.  The usual fix is 
to delete its contents.

For this tracker, exiting with a traceback is a behavior issue; a crash is 
something worse, a core dump or whatever the MAC equivalent is.

.idlerc should not have config-main.cfg unless you change one of the values in 
idlelib/config-main.def.  If you change anything, the redundant entries will be 
removed.  Similarly for the other .idlerc/*.cfg versus idlelib/*.def files.

So missing that file should not have been a problem.  But it might have been if 
idlelib/config-main.def is corrupt.  I suggest you check it.  However, it it 
were, I would expect IDLE startup to fail, but it did not.

Since .idlerc is common to all installed version of Python, and hence to all 
IDLEs, it is not touched by installation or removal of any particular version.

The file you copied is perhaps a decade old.  However, the only changes should 
be

[EditorWindow]
font= TkFixedFont
[General]
print-command-posix=lpr %%s
print-command-win=start /min notepad /p %%s
[Theme]
name2=
# name2 set in user config-main.cfg for themes added after 2015 Oct 1

The third is needed if you select the new IDLE Dark color theme.

In ConfigDialog, self.fontSize is a StringVar, so it would seem that the error 
was it being '' rather than something like '10'.  Since you have 'fixed' the 
problem, I don't anticipate being to verify what its value was or why.  Hence I 
will close this.  However, feel free to post additional relevant information.  
(Interpret 'Not a bug' here as 'cause unknown' ;-).

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

___
Python tracker 

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



[issue26687] Use Py_RETURN_NONE in sqlite3 module

2016-04-01 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

This patch and more can be generated by Сoccinelle [1] semantic patch.

spatch --in-place --dir . --sp-file py_return_none_macro.cocci

But be aware that some maintainers consider such sort of changes a code churn.

[1] http://coccinelle.lip6.fr/

--
nosy: +serhiy.storchaka
Added file: http://bugs.python.org/file42348/py_return_none_macro.cocci

___
Python tracker 

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



[issue26488] hashlib command line interface

2016-04-01 Thread Aviv Palivoda

Aviv Palivoda added the comment:

Publishing another patch after SilentGhost and Victor CR. I also changed the 
block size to 256 KB. If someone can remove the dependency on issue 14156 (I 
don't think I have permissions).

--
Added file: 
http://bugs.python.org/file42347/hashlib-script-mod-md5sum-style-4.patch

___
Python tracker 

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



[issue26688] unittest2 referenced in unittest.mock documentation

2016-04-01 Thread Ashley Anderson

New submission from Ashley Anderson:

I noticed a few references to `unittest2` in the documentation in the 
`unittest.mock` "getting started" section:

https://docs.python.org/3.6/library/unittest.mock-examples.html#patch-decorators

I am attaching a patch that just changes these occurrences from `unittest2` to 
`unittest`.

--
assignee: docs@python
components: Documentation
files: unittest2.patch
keywords: patch
messages: 262767
nosy: aganders3, docs@python
priority: normal
severity: normal
status: open
title: unittest2 referenced in unittest.mock documentation
versions: Python 3.3, Python 3.4, Python 3.5, Python 3.6
Added file: http://bugs.python.org/file42346/unittest2.patch

___
Python tracker 

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



[issue26606] logging.baseConfig is missing the encoding parameter

2016-04-01 Thread Vinay Sajip

Vinay Sajip added the comment:

> and almost no one shows how to use the stream.

Because most examples out there don't care about Unicode, etc.

> I understand the redirection in the following way (also shown in the Dive 
> Into Python book)

There's certainly no need to do that, and that would not be a normal way of 
using logging. The use of stream= should be clear from the documentation for 
basicConfig() parameters.

--

___
Python tracker 

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



[issue26668] Remove Lib/test/test_importlib/regrtest.py?

2016-04-01 Thread STINNER Victor

STINNER Victor added the comment:

Do you mean that you are ok to remove this file in Python 3.6? The file is not 
used by test_importlib.

--

___
Python tracker 

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



[issue26348] activate.fish sets VENV prompt incorrectly

2016-04-01 Thread Vinay Sajip

Vinay Sajip added the comment:

Implementing this patch has led to another issue being raised: #26664. Dan - 
would you care to take a look and comment? Thanks.

--

___
Python tracker 

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



[issue26295] Random failures when running test suite in parallel (-m test -j0) caused by test_regrtest

2016-04-01 Thread STINNER Victor

STINNER Victor added the comment:

Finally, I fixed the issue differently: test_regrtest now creates a temporary 
directory and uses --testdir command line parameter.

Before, using --testdir didn't work because regrtest always added "test." 
prefix to module names (ex: test_os => test.test_os). It isn't the case anymore 
when --testdir is used.

Buildbots are green, so I close the issue.

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



[issue26606] logging.baseConfig is missing the encoding parameter

2016-04-01 Thread Jānis Šlapiņš

Jānis Šlapiņš added the comment:

Many examples in the internet only show the usage of the filename parameter of 
basicConfig() and almost no one shows how to use the stream. That's why I 
wanted to use the filename parameter. But now I tested other options and they 
work for me. My case may be very specific as I need to log words in very 
different languages including not only those having the Latin script but also 
cyrillic - Russian, Greek etc.

Regarding the codecs module and open() - yes, I made a mistake. There is no 
need for that in Python3.

About sys.stdout. I understand the redirection in the following way (also shown 
in the Dive Into Python book):
normal_stdout = sys.stdout
sys.stdout = open(mylogfile, 'w', encoding='utf-8')
logging.basicConfig(level=logging.INFO, stream=sys.stdout)

After that, all the STDOUT goes to mylogfile. In order to send the output to 
the terminal window again, sys.stdout must be set back to normal:
sys.stdout = normal_stdout

--

___
Python tracker 

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



[issue26509] asyncio: spurious ConnectionAbortedError logged on Windows

2016-04-01 Thread STINNER Victor

STINNER Victor added the comment:

> Can someone please commit the patch?

Done.

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



[issue26509] asyncio: spurious ConnectionAbortedError logged on Windows

2016-04-01 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 68e694475483 by Victor Stinner in branch '3.5':
asyncio: Don't log ConnectionAbortedError
https://hg.python.org/cpython/rev/68e694475483

--
nosy: +python-dev

___
Python tracker 

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



[issue26673] Tkinter error when opening IDLE configuration menu

2016-04-01 Thread wysaard

wysaard added the comment:

I just fixed this problem.

In my ~/.idlerc/ folder there was no `config-main.cfg` so I created it and used 
the settings found here: 
https://svn.python.org/projects/python/trunk/Mac/IDLE/config-main.def

After doing that everything worked fine again.

I'm not sure where this bug came from though, whether it's my package manager, 
or some bug in IDLE itself that created this problem; I also don't know if this 
is normal behavior for a missing config file; so I do n't know whether to close 
this or not, so I'll leave that to you.

--

___
Python tracker 

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



[issue26509] asyncio: spurious ConnectionAbortedError logged on Windows

2016-04-01 Thread STINNER Victor

Changes by STINNER Victor :


--
title: spurious ConnectionAbortedError logged on Windows -> asyncio: spurious 
ConnectionAbortedError logged on Windows

___
Python tracker 

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



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

2016-04-01 Thread STINNER Victor

Changes by STINNER Victor :


--
nosy: +haypo

___
Python tracker 

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



[issue26647] ceval: use Wordcode, 16-bit bytecode

2016-04-01 Thread STINNER Victor

STINNER Victor added the comment:

I reviewed wpy3.patch.

I concur with Raymond, it's really nice to have a regular structure for the 
bytecode.

--

Serhiy proposed to *reduce* the size of bytecode by adding new specialized 
bytecode which include the argument. For example (LOAD_CONST, 0) => 
LOAD_CONST_0. I would like to hear his opinion on this change.
https://mail.python.org/pipermail/python-ideas/2016-February/038276.html

Data+code loaded by import is the top #1 memory consumer on basic scripts 
according to tracemalloc:
https://docs.python.org/dev/library/tracemalloc.html#examples

I don't know the ratio between data and code. But here we are only talking 
about the co_code fields of code objects. I guess that the file size of .pyc is 
a good estimation.

I don't think that the memory footprint of bytecode (co_code fields of code 
objects) really matters on computers (and smartphones?) of 2016.

*If* I have to choose between CPU performance and memory footprint, I choose 
the CPU!

--

> This does _not_ include having f_lasti be -1 instead of -2

IMHO it's ok to break the C API, but I would prefer to keep the backward 
compatibility for the Python API (replace any negative number with -1 for the 
Python API).

--

___
Python tracker 

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



[issue18293] ssl.wrap_socket (cert_reqs=...), getpeercert, and unvalidated certificates

2016-04-01 Thread Sascha Silbe

Sascha Silbe added the comment:

Has there been any progress on this? For my application I'd very much like 
"ssh-like" operation, using the public key itself as identifier rather than 
requiring some kind of automated CA setup.

Being able to set a custom verification callback would be great, but just being 
able to cause a dummy callback that accepts any certificate to be used would go 
a long way. The validation could be done after the connection was established 
in this case. For some applications, that may even be the best approach, 
presenting any verification error via the application layer (e.g. HTTP) where 
they are closer to the problem domain and thus make more sense to the user.

--
nosy: +sascha_silbe

___
Python tracker 

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



[issue26687] Use Py_RETURN_NONE in sqlite3 module

2016-04-01 Thread STINNER Victor

STINNER Victor added the comment:

py_return_none_macro.diff looks good to me.

--
nosy: +haypo

___
Python tracker 

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



[issue26673] Tkinter error when opening IDLE configuration menu

2016-04-01 Thread wysaard

wysaard added the comment:

In the screen of `About IDLE` it shows "Tk version 8.6.4".
It used to work, as least since last september (when I installed this) I've had 
no problems. I assumed reinstalling would solve it but that did nothing. I've 
removed the entire python package, made my package manager download a fresh 
version and install it from scratch, and did the same with Tk.

Trying to find any related bug reports on the Arch Linux bug tracker I found 
something linking to this (open) issue: https://bugs.python.org/issue24951
I'm not sure the cause is exactly the same,  but the traceback is near 
identical.

It seems to have something to do with a config file. Maybe there's something 
broken in there, or perhaps a something is missing?
A broken config file would be weird as reinstalling doesn't fix anything, 
unless my package manager doesn't remove the config file when uninstalling the 
package, which isn't impossible either.

--

___
Python tracker 

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



[issue26687] Use Py_RETURN_NONE in sqlite3 module

2016-04-01 Thread Berker Peksag

New submission from Berker Peksag:

The attached patch replaces all "Py_INCREF(Py_None); return Py_None;" lines 
with the Py_RETURN_NONE macro in sqlite3 module.

--
components: Extension Modules
messages: 262754
nosy: berker.peksag
priority: normal
severity: normal
stage: patch review
status: open
title: Use Py_RETURN_NONE in sqlite3 module
type: enhancement
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



[issue26687] Use Py_RETURN_NONE in sqlite3 module

2016-04-01 Thread Berker Peksag

Changes by Berker Peksag :


--
keywords: +patch
Added file: http://bugs.python.org/file42345/py_return_none_macro.diff

___
Python tracker 

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



[issue26683] Questionable terminology for describing what locals() does

2016-04-01 Thread Terry J. Reedy

Terry J. Reedy added the comment:

I requested that we stop (mis)using 'free variable' in the docs years ago.  A 
strong +1 from me.

The 'locals' function what named when 'local' and 'non-global' were synonyms.  
When non-local, non-global names were added, nonlocals were included with 
'locals' as 'non-global'.  (This must have been thought to be more useful than 
adding nonlocals() or excluding them.)

They are, of course, local in some surrounding non-global context.  And for 
most purposes, their entries in locals() should also be treated as read-only.  
I think the doc should say that function locals() includes the locals of 
surrounding function contexts, even though they are called 'nonlocal' within 
the nested function.

--
nosy: +terry.reedy

___
Python tracker 

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



[issue26686] email.parser stops parsing headers too soon.

2016-04-01 Thread SilentGhost

Changes by SilentGhost :


--
components: +email
nosy: +barry, r.david.murray
versions: +Python 3.5 -Python 3.4

___
Python tracker 

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



[issue26673] Tkinter error when opening IDLE configuration menu

2016-04-01 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Serhiy, what do you make of the TclError?  Could it be an ArchLinux-specific 
bug in tk?

Here is the entire function:

def SetFontSample(self, event=None):
fontName = self.fontName.get()
fontWeight = tkFont.BOLD if self.fontBold.get() else tkFont.NORMAL
newFont = (fontName, self.fontSize.get(), fontWeight)
self.labelFontSample.config(font=newFont)
self.textHighlightSample.configure(font=newFont)

The first 3 lines were last touched on 2014-08-03, the last 3 on 2012-10-22. 
The code seem unexceptional.  This works fine for me and, I presume, most 
everyone else.

wysaard: What tk version does Arch Linux provide you?  Check Help => About IDLE 
before you hit configure.

--

___
Python tracker 

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



[issue26686] email.parser stops parsing headers too soon.

2016-04-01 Thread Mark Sapiro

Mark Sapiro added the comment:

Added Python 2.7 to versions:

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



[issue26686] email.parser stops parsing headers too soon.

2016-04-01 Thread Mark Sapiro

New submission from Mark Sapiro:

Given an admittedly defective (the folded Content-Type: isn't indented) message 
part with the following headers/body

---
Content-Disposition: inline; filename="04EBD_._A546BB.zip"
Content-Type: application/x-rar-compressed; x-unix-mode=0600;
name="04EBD_._A546BB.zip"
Content-Transfer-Encoding: base64

UmFyIRoHAM+QcwAADQBKRXQgkC4ApAMAAEAHAAACJLrQXYFUfkgdMwkAIGEw
ZjEwZi5qcwDwrrI/DB2NDI0TzcGb3Gpb8HzsS0UlpwELvdyWnVaBQt7Sl2zbJpx1qqFCGGk6
...
---

email.parser parses the headers as

---
Content-Disposition: inline; filename="04EBD_._A546BB.zip"
Content-Type: application/x-rar-compressed; x-unix-mode=0600;
---

and the body as

---
name="04EBD_._A546BB.zip"
Content-Transfer-Encoding: base64

UmFyIRoHAM+QcwAADQBKRXQgkC4ApAMAAEAHAAACJLrQXYFUfkgdMwkAIGEw
ZjEwZi5qcwDwrrI/DB2NDI0TzcGb3Gpb8HzsS0UlpwELvdyWnVaBQt7Sl2zbJpx1qqFCGGk6
...
---

and shows no defects.

This is wrong. RFC5322 section 2.1 is clear that everything up to the first 
empty line is headers. Even the docstring in the email/parser.py module says 
"The header block is terminated either by the end of the string or by a blank 
line."

Since the message is defective, it isn't clear what the correct result should 
be, but I think

Headers:
Content-Disposition: inline; filename="04EBD_._A546BB.zip"
Content-Type: application/x-rar-compressed; x-unix-mode=0600;
Content-Transfer-Encoding: base64

Body:
UmFyIRoHAM+QcwAADQBKRXQgkC4ApAMAAEAHAAACJLrQXYFUfkgdMwkAIGEw
ZjEwZi5qcwDwrrI/DB2NDI0TzcGb3Gpb8HzsS0UlpwELvdyWnVaBQt7Sl2zbJpx1qqFCGGk6
...

Defects:
name="04EBD_._A546BB.zip"

would be more appropriate. The problem is that the Content-Transfer-Encoding: 
base64 header is not in the headers so that get_payload(decode=True) doesn't 
decode the base64 encoded body making malware recognition difficult.

--
components: Library (Lib)
messages: 262750
nosy: msapiro
priority: normal
severity: normal
status: open
title: email.parser stops parsing headers too soon.
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



[issue26488] hashlib command line interface

2016-04-01 Thread STINNER Victor

STINNER Victor added the comment:

> The blocksize should be fixed and large (perhaps 256kB).

I used strace to check md5sum & sha1sum: they use read() syscalls of 32,768 
bytes.

stat().st_blksize is 4,096 bytes.

I'm not sure that it matters so much to use large read. But I don't really 
care, I'm also ok to use something large like 256 kB.

Note: The cp command uses read() syscalls of 131,072 bytes.

--

___
Python tracker 

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



[issue26664] find a bug in activate.fish of venv of cpython3.6

2016-04-01 Thread 鄭景文

鄭景文 added the comment:

First, I use python 3.5.1 to create virtual environment. It works fine with 
fish. There is no $ in the activate.fish file.
Second, after I removed the $, It works fine, both in ubuntu and arch linux.

I guess it is because the $ is for bash not for fish, the activate.fish didn't 
work.
These are why I assert the $ is unwanted.

--

___
Python tracker 

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



[issue26488] hashlib command line interface

2016-04-01 Thread SilentGhost

SilentGhost added the comment:

Left comments on Rietveld.

--

___
Python tracker 

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



[issue26606] logging.baseConfig is missing the encoding parameter

2016-04-01 Thread Vinay Sajip

Vinay Sajip added the comment:

> you have also to remember to restore sys.stdout

I'm not sure you understand how it works. The value of sys.stdout isn't 
changed, so why does it need to be restored?

> for non-English languages it would be more appropriate to use codecs.open() 
> instead of just open()

codecs.open() for older versions of Python, perhaps, but in newer Pythons (this 
issue is marked for Python 3.5), open is io.open which takes an encoding 
parameter.

basicConfig() is meant for the simplest cases, so you have to draw the line 
somewhere as to what "basic" means. I don't propose to change where the line is 
drawn - and AFAIK this is the first time it's come up, so it looks as if the 
many non-English speaking Python users are managing just fine with 
basicConfig() as it is ... note that this kind of thing is always a judgement 
call.

> The complexity of the code grows and increases a danger of "more code, more 
> bugs".

Maybe that's why I'm choosing not to increase the complexity of my code ;-)

--

___
Python tracker 

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



[issue26679] curses: Descripton of KEY_NPAGE and KEY_PPAGE inverted

2016-04-01 Thread SilentGhost

SilentGhost added the comment:

Here is the patch.

--
nosy: +SilentGhost
stage:  -> patch review
type: enhancement -> behavior
Added file: http://bugs.python.org/file42344/issue26679.diff

___
Python tracker 

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



[issue18844] allow weights in random.choice

2016-04-01 Thread Christian Kleineidam

Christian Kleineidam added the comment:

A user can use map(), filter(), zip() without knowing anything about 
generators. In most cases those function will do their magic and provide a 
finite number of outputs. 

The weighted_choice_generator on the other hand isn't as easy to use. If the 
user wants 5 values from it, they need to know about `take()` from itertools or 
call `next()`.

--

___
Python tracker 

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



[issue26678] Incorrect linking to elements in datetime package

2016-04-01 Thread Andy Maier

Andy Maier added the comment:

Ok. If these methods generate index entries, maybe the problem is on my side by 
not linking them correctly. So let's try with the other two changes.

Unfortunately, I cannot easily build cpython at the moment to verify, I moved 
to Linux and when trying to build cpython, bash rejects the configure script 
because of trailing CR characters. This is a freshly installed hg package on 
Ubuntu 14.04, against a fresh clone of the cpython repo. Any idea what is 
happening there?

--

___
Python tracker 

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



[issue26670] Add a developer mode: -X dev command line option

2016-04-01 Thread SilentGhost

Changes by SilentGhost :


--
resolution: fixed -> rejected
stage:  -> resolved

___
Python tracker 

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



[issue26673] Tkinter error when opening IDLE configuration menu

2016-04-01 Thread SilentGhost

Changes by SilentGhost :


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



[issue26670] Add a developer mode: -X dev command line option

2016-04-01 Thread STINNER Victor

STINNER Victor added the comment:

> Why does this patch execv() the interpreter to set options? I'd expect it to 
> be possible to get the same result by updating the argument parsing code in 
> Py_Main.

It's to set PYTHONMALLOC env var which must be set before Py_Main() is called.

Since I got negative feedback on python-ideas, I close this issue and will 
investigate the documentation option.

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



[issue26673] Tkinter error when opening IDLE configuration menu

2016-04-01 Thread wysaard

wysaard added the comment:

I'm having the problem if I'm running idle with Python 2.7.11 too.

--

___
Python tracker 

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



[issue17436] hashlib: add a method to hash the content of a file

2016-04-01 Thread Christian Heimes

Christian Heimes added the comment:

For readfile() it might make more sense to implement it directly in C and let 
OpenSSL's BIO layer handle IO internally. It's more efficient and you can 
release the GIL around the whole operation.

--
nosy: +christian.heimes

___
Python tracker 

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



[issue17436] hashlib: add a method to hash the content of a file

2016-04-01 Thread STINNER Victor

STINNER Victor added the comment:

> I added a new method to the hash object named fromfile().

Usually, fromxxx() is used to create a new object. In your case, it's more to 
update an existing hash object. So I would prefer the name "readfile".

IMHO you need two methods:

* hashobj.readfile(filename: str)
* hashobj.readfileobj(file) where file is an object with a read() method which 
returns bytes strings

The implementation of the two methods can be very different. In readfile(), you 
know that it's a regular file which exists on the file system. So you can 
directly uses _Py_fstat() to get st_blksize and then loop on _Py_read().

For readfileobj(), the file object doesn't need to exist on disk, fileno() can 
raises an exception or not exist at all.

I suggest to look at copyfile() and copyfileobj() functions of the shutil 
module. For example, copyfileobj() has an optional parameter for the buffer 
size. You should probably uses that to avoid complex heuristic to guess the 
optimal buffer size.

--

___
Python tracker 

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



[issue17436] hashlib: add a method to hash the content of a file

2016-04-01 Thread Aviv Palivoda

Aviv Palivoda added the comment:

While working on issue 26488 I found a real need for this feature.
I added a new method to the hash object named fromfile(). The function update 
the hash object with the content of the file like object it receives.

I only added the feature to hash algorithm provided by OpenSSL. If there will 
be good reviews on this I will do the work of adding this to all hash 
algorithms.

--
keywords: +patch
nosy: +palaviv
versions: +Python 3.6 -Python 3.4
Added file: http://bugs.python.org/file42343/17436.patch

___
Python tracker 

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



[issue26671] Clean up path_converter in posixmodule.c

2016-04-01 Thread STINNER Victor

Changes by STINNER Victor :


--
nosy: +haypo

___
Python tracker 

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



[issue26685] Raise errors from socket.close()

2016-04-01 Thread STINNER Victor

STINNER Victor added the comment:

I like the idea :-)

--
nosy: +haypo

___
Python tracker 

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



[issue26678] Incorrect linking to elements in datetime package

2016-04-01 Thread Martin Panter

Martin Panter added the comment:

I’m happy to make those two minimal changes (:noindex: and tzinfo class), but I 
have a feeling they won’t help your problem linking to 
datetime.tzinfo.utcoffset() and dst(). The markup for those methods already 
generates index entries, see  for 
instance.

--

___
Python tracker 

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



[issue26685] Raise errors from socket.close()

2016-04-01 Thread Martin Panter

Changes by Martin Panter :


--
dependencies: +test_fileno of test_urllibnet intermittently fails

___
Python tracker 

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



[issue26685] Raise errors from socket.close()

2016-04-01 Thread Martin Panter

New submission from Martin Panter:

While looking at a recent failure of test_fileno() in test_urllibnet, I 
discovered that socket.close() ignores the return value of the close() system 
call. It looks like it has always been this way: 
.

On the other hand, both FileIO.close() and os.close() raise an exception if the 
underlying close() call fails. So I propose to make socket.close() also raise 
an exception for any failure indicated by the underlying close() call. The 
benefit is that a programming error causing EBADF would be more easily noticed.

--
components: Extension Modules
files: socket.close.patch
keywords: patch
messages: 262735
nosy: martin.panter
priority: normal
severity: normal
stage: patch review
status: open
title: Raise errors from socket.close()
type: enhancement
versions: Python 3.6
Added file: http://bugs.python.org/file42342/socket.close.patch

___
Python tracker 

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



[issue21069] test_fileno of test_urllibnet intermittently fails

2016-04-01 Thread Mark Lawrence

Changes by Mark Lawrence :


--
nosy:  -BreamoreBoy

___
Python tracker 

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



[issue26671] Clean up path_converter in posixmodule.c

2016-04-01 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Good catch! Here is updated patch. It fixes also hiding exception in dir_fd 
converter.

--
Added file: http://bugs.python.org/file42341/path_converter_cleanup_2.patch

___
Python tracker 

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



[issue21069] test_fileno of test_urllibnet intermittently fails

2016-04-01 Thread Martin Panter

Martin Panter added the comment:

Mark: My understanding is on Windows, winsock file descriptors and C library 
file descriptors are different beasts; see 
. Perhaps 
the test should call socket functions like socket.recv() on the FD rather than 
C library functions via os.fdopen().

Victor: The test in this bug has started failing again, very likely due to your 
revision 7bd4736195ce enabling a timeout on the HTTP request. I guess this 
causes the socket to be in non-blocking mode, and read() to return None. This 
is what Issue 10119 tried to fix. Example:

http://buildbot.python.org/all/builders/AMD64%20Debian%20root%203.x/builds/3404/steps/test/logs/stdio
==
FAIL: test_fileno (test.test_urllibnet.urlopenNetworkTests)
--
Traceback (most recent call last):
  File 
"/root/buildarea/3.x.angelico-debian-amd64/build/Lib/test/test_urllibnet.py", 
line 110, in test_fileno
self.assertTrue(f.read(), "reading from file created using fd "
AssertionError: None is not true : reading from file created using fd returned 
by fileno failed

A less serious and long-standing problem with the test is that it attempts to 
close the socket twice. We are just lucky that socket.close() is called second, 
which does not raise any errors: 
.

Regarding the purpose and use cases of fileno(), I agree with Senthil that 
using it to read the HTTP response behind the HTTPResponse object’s back in 
Python 3 is a bad idea, and I don’t think it is practical to make this work 
without losing the benefits of buffering. But there are probably other valid 
use cases such as calling getsockname() on the socket, or sending and receiving 
non-HTTP data after setting up a CONNECT tunnel.

Proposals:

1. Change the test to do use socket(fileno=...), rather than os.fdopen(...), so 
that it will be usable on Windows.

2. Ensure that the secondary socket object is not closed; use socket.detach()

3. Rewrite the test to test http.client directly, rather than indirectly 
through urlopen(). As far as I can see the purpose is only to test 
HTTPResponse.fileno(), not urlopen().

4. Rewrite the test to test a local server run in a background thread, rather 
than relying external web sites (currently Google, previously IETF, and 
Python). This would eliminate the need for setting a timeout.

5. Rewrite to the test for a more realistic use case that does not depend on 
specific internal HTTPResponse buffering and the HTTP protocol. I suggest 
mocking a CONNECT request, and uploading some non-HTTP data through the proxy.

--
components: +Tests
keywords: +buildbot -patch
nosy: +haypo, martin.panter
stage: test needed -> needs patch
title: test_fileno of test_urllibnet intermittently fails when using 
www.example.com -> test_fileno of test_urllibnet intermittently fails
type:  -> behavior
versions: +Python 3.6 -Python 3.4

___
Python tracker 

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



[issue26682] Ttk Notebook tabs do not show with 1-2 char names

2016-04-01 Thread Terry J. Reedy

Terry J. Reedy added the comment:

I am not surprised, somehow, that details of bug should depend on system.  I 
should have said Win 10, 3.5.1/8.6.4.

--

___
Python tracker 

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



[issue26682] Ttk Notebook tabs do not show with 1-2 char names

2016-04-01 Thread Terry J. Reedy

Terry J. Reedy added the comment:

No, I can't remember where it is and do not have an account on their tracker, 
if one is needed.

--

___
Python tracker 

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



[issue13952] mimetypes doesn't recognize .csv

2016-04-01 Thread Werner Van Geit

Werner Van Geit added the comment:

Will this patch ever make it into the main python version ? I just ran into 
exactly this issue (mimetypes returns None as mimetype of csv file on Windows)

--
nosy: +Werner Van Geit
versions: +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



[issue26676] Add missing XMLPullParser to ElementTree.__all__

2016-04-01 Thread Martin Panter

Changes by Martin Panter :


--
resolution:  -> fixed
stage: commit 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



[issue26678] Incorrect linking to elements in datetime package

2016-04-01 Thread Andy Maier

Andy Maier added the comment:

Hi Martin!

The intersphinx stuff is simply linking from a Sphinx RST documentation to a 
different Sphinx RST documentation, using support from the intersphinx 
extension of Sphinx. I think the name comes from the interwiki links in 
MediaWiki. It only comes into play here because my particular documentation is 
outside of the Python documentation. The same issues would arise when linking 
from other places in the Python documentation.

Your explanation about :noindex: hits the nail on the head, I think. It seems 
to me that a minimal variant for fixing this would be:

* add :noindex: to the class markup for the short descriptions of tzinfo and 
timezone.
* add a class markup for tzinfo at its long description.

I don't know whether that solves the method linking issue, though, but its 
worth a try.

--

___
Python tracker 

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



[issue26606] logging.baseConfig is missing the encoding parameter

2016-04-01 Thread Jānis Šlapiņš

Jānis Šlapiņš added the comment:

Yes, it also works. But then you have also to remember to restore sys.stdout to 
the initial state at the end. In addition, for non-English languages it would 
be more appropriate to use codecs.open() instead of just open() in this case.
The complexity of the code grows and increases a danger of "more code, more 
bugs".

Why to use a "detour" and try always to remember that a part of a module is not 
useful for you due to particual drawbacks if it is possible to implement a 
small addition in it that does not break anything?

--

___
Python tracker 

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



[issue26488] hashlib command line interface

2016-04-01 Thread Aviv Palivoda

Aviv Palivoda added the comment:

I am adding a new patch with changes from Martin CR (Thanks for the review) and 
support in the "check" option.
I also changed to examples in the Documentation to use sha256 instead of md5 as 
Christian asked. I left one example with sha1 so when someone read it he will 
see that other algorithms are supported.
As for the multi-threading feature I checked on my PC and I never reach 100% 
CPU when calculating a single hash so I think leaving this feature out is 
better.

--
Added file: 
http://bugs.python.org/file42340/hashlib-script-mod-md5sum-style-3.patch

___
Python tracker 

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



[issue26680] Incorporating float.is_integer into the numeric tower and Decimal

2016-04-01 Thread Robert Smallshire

Robert Smallshire added the comment:

As for whether the shortcut float.is_integer(x) was needed, it has different 
behavior to x==int(x) when x is either NaN or an infinity.  We must even deal 
with two different exception types OverflowError or ValueError respectively for 
these two values on conversion to int. That float.is_integer() simply returns 
False for these values makes it more straightforward to use robustly. The same 
would go for Decimal, which has the same behavior with respect to NaNs and 
infinities as float.

I agree that is_integral may have been a better name, although is_integer has 
the advantage that it avoids conflating numeric values with either of the types 
'int' or 'Integral'.

The motivation for my patches is to converge the interfaces of the various 
number types so that we can simply, and robustly, check for integer values (as 
opposed to integer types) without needing to be concerned about the concrete 
number type, so long as it is Real.  Indeed, this is largely the point of 
having a numeric tower at all.  I am more motivated by usability and concision 
and correctness than efficiency concerns: I believe that where
possible we should allow one number type to be substituted for another, and in 
particular `int` for any other Real type where purely mathematical - rather 
than representational operations - are in play.

Use of the existing float.is_integer is compromised by the fact that people 
have an entirely reasonably habit of passing integers (particularly literals) 
to functions which accept floats which then fail if they use float.is_integer.

Adding this method would reduce the educational load as the various number 
types would be more similar, not less.

I work in industrial fields where computational geometry, and hence rationals, 
floats, infinities and large integers are a day-to-day occurrence. Ultimately, 
I care more about consistency within the numeric tower types (Real, float, int, 
Rational, Integral, Fraction) than I do about Decimal, which is why I separated 
my changes to Decimal into a separate patch.

--

___
Python tracker 

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



[issue26676] Add missing XMLPullParser to ElementTree.__all__

2016-04-01 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 3d6b67361749 by Martin Panter in branch 'default':
Issue #26676: Add missing XMLPullParser to ElementTree.__all__
https://hg.python.org/cpython/rev/3d6b67361749

--
nosy: +python-dev

___
Python tracker 

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



[issue26680] Incorporating float.is_integer into the numeric tower and Decimal

2016-04-01 Thread Stefan Krah

Stefan Krah added the comment:

is_integer() is very important for writing new functions. libmpdec has
it and it's used a lot inside mpdecimal.c.


In this case though I assume Robert needs it for duck typing.

--

___
Python tracker 

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



[issue26684] pathlib.Path.with_name() and .with_suffix do not allow combining with an empty Path

2016-04-01 Thread Ethan Furman

Ethan Furman added the comment:

Never mind.

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