[issue27466] [Copy from github user macartur] time2netscape missing comma

2016-07-07 Thread Senthil Kumaran

Senthil Kumaran added the comment:

Here is the patch that fixes this issue. Patch includes unittests and NEWS 
entry.

--
assignee:  -> orsenthil
keywords: +patch
stage:  -> patch review
Added file: http://bugs.python.org/file43659/issue27466.patch

___
Python tracker 

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



[issue27380] IDLE: add base Query dialog with ttk widgets

2016-07-07 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Patch posted had code that belongs to #27465 and was deleted before pushing.

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



[issue27380] IDLE: add base Query dialog with ttk widgets

2016-07-07 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 66fe8d9eae6c by Terry Jan Reedy in branch 'default':
Issue #27380: IDLE: add query.HelpSource class and tests.
https://hg.python.org/cpython/rev/66fe8d9eae6c

--

___
Python tracker 

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



[issue27466] [Copy from github user macartur] time2netscape missing comma

2016-07-07 Thread Senthil Kumaran

Senthil Kumaran added the comment:

Evelyn,

Thanks for digging in.

The code for time2netscape has been in the current form since it was originally 
introduced in 2004. If this is a bug, then it has been present since the 
introduction of the module.  If anyone is using this module, they are probably 
relying the existing behavior.

The spec you pointed out says that this is a bug. The bug fix can go in 2.7, 
3.5 and 3.6 releases.

--
nosy: +orsenthil
versions:  -Python 3.2, Python 3.3, Python 3.4

___
Python tracker 

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



[issue27467] distutils.config API different between <=3.5.1 and 3.5.2

2016-07-07 Thread Joe

New submission from Joe:

In Python 3k releases leading up to 3.5.2, distutils.config imported 
"ConfigParser", but now imports "RawConfigParser" in the latest release.

The documentation indicates "RawConfigParser" is considered legacy and 
"ConfigParser" should be used in its place. Was this change intentional, and if 
not, will it be reverted to the previous behavior for the next patch release?

Thanks,
Joe

--
components: Distutils
messages: 269970
nosy: dstufft, eric.araujo, jhunkeler
priority: normal
severity: normal
status: open
title: distutils.config API different between <=3.5.1 and 3.5.2
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



[issue27466] [Copy from github user macartur] time2netscape missing comma

2016-07-07 Thread Evelyn Mitchell

Evelyn Mitchell added the comment:

http://web.archive.org/web/19990128171928/http://www51.netscape.com/newsref/std/cookie_spec.html
 says:
The date string is formatted as:

Wdy, DD-Mon- HH:MM:SS GMT

so the comma should be there.

--
nosy: +efm

___
Python tracker 

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



[issue27466] [Copy from github user macartur] time2netscape missing comma

2016-07-07 Thread Robby Daigle

New submission from Robby Daigle:

For the time2netscape function.
expected: Wed, DD-Mon- HH:MM:SS GMT
got: Wed DD-Mon- HH:MM:SS GMT

In Lib/http/cookiejar.py, line 116 suggests that the format should include a 
comma while line 123 does not include the comma in the formatted string.

Wondering if 116 or 123 is wrong.

--
components: Library (Lib)
hgrepos: 347
messages: 269968
nosy: Robby Daigle
priority: normal
severity: normal
status: open
title: [Copy from github user macartur] time2netscape missing comma
versions: Python 2.7, Python 3.2, Python 3.3, Python 3.4, Python 3.5, Python 3.6

___
Python tracker 

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



[issue27380] IDLE: add base Query dialog with ttk widgets

2016-07-07 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Serhiy, thank you for the review.  I intend to follow PEP 8 as best as possible 
in the code I touch.  I also fixed some of the comments.

I did a bit of refactoring that make it trivial to check for reuse of help 
source names.  See new issue #27465.  All that is needed is for configdialog to 
pass a used_names argument. I already changed the HelpSource htest to do so.

I have tested the configdialog changes by running it with live IDLE.  I intend 
to push after a final check.

--
Added file: http://bugs.python.org/file43658/query-helpsource2.diff

___
Python tracker 

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



[issue27465] IDLE:Make help source menu entries unique and sorted.

2016-07-07 Thread Terry J. Reedy

Terry J. Reedy added the comment:

The IDLE doc currently says "Additional help sources may be added here with the 
Configure IDLE dialog under the General tab."  Revise to something like

Additional help sources
   Menu items for display here are added on the General tap of Options => 
Configure IDLE.  Menu entries should be unique (new in 3.6) and will be sorted. 
Documents can be located either on the current machine or on the internet.  The 
allowed file types may depend on the system.  Local file paths are checked when 
submitted; internet addresses are not.

--
dependencies: +IDLE: add base Query dialog with ttk widgets

___
Python tracker 

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



[issue27465] IDLE:Make help source menu entries unique and sorted.

2016-07-07 Thread Terry J. Reedy

New submission from Terry J. Reedy:

The 'General' tab of the IDLE configuration menu allows a user to add entries 
to the Help menu that display a text when clicked.  A user might want more than 
one text available for a given 'topic', such as a doc and how-to for a package. 
 However, there is no need to have duplicate entries, as up to 30 chars are 
allowed.  "Package - doc" and "Package - how" would be clearer than "Package" 
and "Package".  Issue 27380 makes checking for unique entries easy as that is 
already done for user configuration file section names and the same base class 
is now used for help source names.

Currently, names are displayed in the order added.  I believe sorting would be 
better, especially when one adds more than 2 entries.  That should also be easy.

Existing duplicates would not be a problem for IDLE as the check would only 
apply when adding or editing an item.  Python's stable list.sort would keep 
existing duplicates in the same relative order.  I will *not* use the doc path 
to break ties.

--
assignee: terry.reedy
messages: 269965
nosy: terry.reedy
priority: normal
severity: normal
stage: test needed
status: open
title: IDLE:Make help source menu entries unique and sorted.
type: behavior
versions: Python 3.6

___
Python tracker 

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



[issue27464] Document that SplitResult & friends are namedtuples

2016-07-07 Thread Mikhail Korobov

New submission from Mikhail Korobov:

Docs currently say that urllib.parse.SplitResult is a subclass of tuple, 
without saying that it is namedtuple. What do you think about documenting it as 
a namedtuple? It has an useful _replace method which allows to change some part 
of URL before passing it to urlunsplit.

It may also require updating typeshed - I noticed this issue because mypy shows 
an error when SplitResult._replace is used.

--
messages: 269964
nosy: kmike
priority: normal
severity: normal
status: open
title: Document that SplitResult & friends are namedtuples

___
Python tracker 

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



[issue27442] expose the Android API level in sysconfig.get_config_vars()

2016-07-07 Thread Xavier de Gaye

Xavier de Gaye added the comment:

@Berker
This does not work for me.

I found an old discussion [1] on the git format problem with Rietveld. The 
thread diverges rapidly toward another subject, "submitting a branch instead of 
a patch to the issue tracker" but comes back to the original subject at the 
end. It seems that "not including the base changeset id in the --git diff is an 
oversight" of mercurial that has never been fixed.

[1] http://grokbase.com/t/python/python-dev/1135q4xxa8/hg-diff

--

___
Python tracker 

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



[issue27220] Add a pure Python version of 'collections.defaultdict'

2016-07-07 Thread Emanuel Barry

Emanuel Barry added the comment:

(Also, if this is going to be rejected still, I think that fixing __all__ to 
only conditionally add 'deque' and 'defaultdict' should be considered)

--

___
Python tracker 

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



[issue27220] Add a pure Python version of 'collections.defaultdict'

2016-07-07 Thread Emanuel Barry

Emanuel Barry added the comment:

I agree that CPython itself gains nothing from having this, as this is so that 
alternate implementations have it as well. I get what you mean about the minor 
differences, however I think it's a good thing, as it helps to make sure the 
tests are precise enough so that there can't be any differences (but that's 
probably just me).

--

___
Python tracker 

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



[issue27220] Add a pure Python version of 'collections.defaultdict'

2016-07-07 Thread Raymond Hettinger

Raymond Hettinger added the comment:

I don't think there is any advantage to adding a pure python version of 
defaultdict (or we would have done it a long time ago).   Each time we do this, 
it creates a host of downstream issues where people notice minor implementation 
differences between the two.

--
priority: normal -> low
resolution:  -> rejected
status: open -> closed

___
Python tracker 

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



[issue27442] expose the Android API level in sysconfig.get_config_vars()

2016-07-07 Thread STINNER Victor

STINNER Victor added the comment:

+@unittest.skipIf(sysconfig.get_config_var('ANDROID_API_LEVEL') == 0,
+ "not an android platform")
+def test_is_android(self):
+# Use an heuristic, the shell on Android is at /system/bin/sh.
+proc = subprocess.run(['/system/bin/sh', '-c', 'echo OK'],
+  stdout=subprocess.PIPE)
+self.assertIn(b'OK', proc.stdout)

I dislike such functional test, it might fail and might need maintaince.

I suggest to push the change without the unit test.

--

___
Python tracker 

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



[issue25507] IDLE: user code 'import tkinter; tkinter.font' should fail

2016-07-07 Thread Terry J. Reedy

Terry J. Reedy added the comment:

According to 
https://stackoverflow.com/questions/38249755/tkinter-not-working-in-cmd-working-in-idle,
 this code

from tkinter import filedialog
root = Tk()

ran in 3.4.3.  After the patch for 3.5.1 (and 3.4.4, 2.7.11) it raises 
NameError in 3.5.2.

--

___
Python tracker 

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



[issue23710] C API doc for PyObject_HEAD is outdated

2016-07-07 Thread R. David Murray

R. David Murray added the comment:

Looks good to me.

--

___
Python tracker 

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



[issue23710] C API doc for PyObject_HEAD is outdated

2016-07-07 Thread Ammar Askar

Ammar Askar added the comment:

>The current text is what we want as far as that goes.

Roger that, I've reverted the change to make that a warning in the newest diff.

--
Added file: http://bugs.python.org/file43657/capidocs.diff-2

___
Python tracker 

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



[issue27442] expose the Android API level in sysconfig.get_config_vars()

2016-07-07 Thread Berker Peksag

Berker Peksag added the comment:

> I am using 'hg diff' with ~/.hgrc set to 'git = on' and this time, naively 
> removed the '--git' from the output of 'hg diff' instead of commenting out 
> 'git = on' in the config file :(

You don't need to do that. I've been using the same setting [1] for 5 years 
without having a single problem. If you have a fresh clone of 
https://hg.python.org/cpython/ and using the 'default' branch, you're good.

[1]

[diff]
git = True
showfunc = True
unified = 8

--
nosy: +berker.peksag

___
Python tracker 

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



[issue27377] Add smarter socket.fromfd()

2016-07-07 Thread Neil Schemenauer

Neil Schemenauer added the comment:

Adding yet another revised patch.  I think this is ready to commit, if someone 
would like to do it.  The documentation for constants can be added as a 
separate commit, if Martin wants.  I think the generic SO_* style documentation 
is okay.

Changes in this version:
- fix documentation wording
- add tests for different protocol types

It would be really good(TM) if someone could test this on other platforms.  I 
only tested on vanilla Debian Linux 3.16.0.

--
Added file: http://bugs.python.org/file43656/fromfd2_v4.txt

___
Python tracker 

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



[issue7769] SimpleXMLRPCServer.SimpleXMLRPCServer.register_function as decorator

2016-07-07 Thread Xiang Zhang

Xiang Zhang added the comment:

>From the old comments from Brian it seems he's willing to accept such a 
>feature. But unfortunately Brian seems not interested in this now. IMHO, this 
>is good feature especially to people familiar with Bottle and Flask. Writing 
>in a decorator way seems more elegant to me. Nevertheless, add more doc.

--
Added file: http://bugs.python.org/file43655/issue7769_with_more_doc.patch

___
Python tracker 

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



[issue27139] Increased test coverage for statistics.median_grouped

2016-07-07 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 4c4f8b0c5b30 by Steven D'Aprano in branch 'default':
Issue27139 patch by Julio C Cardoza.
https://hg.python.org/cpython/rev/4c4f8b0c5b30

--
nosy: +python-dev

___
Python tracker 

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



[issue27463] Floor division is not the same as the floor of division

2016-07-07 Thread R. David Murray

R. David Murray added the comment:

That's good enough for me.  Closing.

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



[issue27463] Floor division is not the same as the floor of division

2016-07-07 Thread Tim Peters

Tim Peters added the comment:

Note that the same is true in Python 2.

I don't want to document it, though.  In `math.floor(44/4.4)`, the 
subexpression `44/4.4` by itself wholly rules out that "[as if] with infinite 
precision [throughout the larger expression]" may be in play.  `44/4.4` rounds 
to 10.0 regardless of the context it appears in.

It's just a universal fact about how float arithmetic works, and no more 
surprising than that, e.g., float addition isn't always associative.  Which may 
mean "very surprising" to many brand new to float arithmetic, but it's not the 
job of the Python docs to give basic tutorials.

--
nosy: +tim.peters

___
Python tracker 

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



[issue27463] Floor division is not the same as the floor of division

2016-07-07 Thread R. David Murray

R. David Murray added the comment:

I see Steven beat me to posting, but I'll post this anyway since it addresses 
the existing documentation.

Those are already documented as being two different operations.  // is "floor" 
in the sense (as documented in 
https://docs.python.org/3/reference/expressions.html#binary-arithmetic-operations):

x == (x//y) + (x%y)

or, more clearly,

divmod(x, y) = (x//y, x%y)

math.floor(x/y), on the other hand, is doing the floating point division first, 
and then taking the floor.  Different operations, and thus, given floating 
point realities, different results are not surprising (at least to me...maybe 
I'm naive? :)

Is this worth an additional documentation note of some sort?  I'm not sure, 
I'll defer to Mark.

--
nosy: +mark.dickinson, r.david.murray

___
Python tracker 

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



[issue27463] Floor division is not the same as the floor of division

2016-07-07 Thread Steven D'Aprano

Steven D'Aprano added the comment:

The behaviour of both are correct: the binary float nearest to 4.4 is just a 
smidgen *bigger* than the exact decimal 4.4, so 44//4.4 truncates to 9.0. But 
floor(44/4.4) evaluates 44/4.4 first, and that rounds rather than truncating, 
giving 10.0, which then floors to 10.

If you want to propose a documentation patch, that will be considered, but keep 
in mind that the Python docs cannot and should not be the place to document all 
the hairy corners of floating point arithmetic.

--
nosy: +steven.daprano

___
Python tracker 

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



[issue27462] NULL Pointer deref in binary_iop1 function

2016-07-07 Thread Emin Ghuliev

Changes by Emin Ghuliev :


--
resolution: not a bug -> wont fix
status: pending -> closed

___
Python tracker 

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



[issue27462] NULL Pointer deref in binary_iop1 function

2016-07-07 Thread R. David Murray

R. David Murray added the comment:

Well, unless you can find a way to reproduce it with python code, it isn't 
interesting to us.

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

___
Python tracker 

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



[issue27463] Floor division is not the same as the floor of division

2016-07-07 Thread Izaak Weiss

New submission from Izaak Weiss:

The floor division operator in Python 3 `x//y` acts differently than the floor 
of the division operator `math.floor(x/y)` in some edge cases due to floating 
point errors.

Consider `44//4.4` and `math.floor(44/4.4)`. These two expressions should, with 
infinite precision, evaluate to the same number. However, in practice `44//4.4` 
evaluates to `9.0`, but `math.floor(44/4.4)` evaluates to `10.0`.

This should either be changed, or made clear in the documentation that the two 
may not be equal due to floating point errors.

--
messages: 269945
nosy: izaakweiss
priority: normal
severity: normal
status: open
title: Floor division is not the same as the floor of division
type: behavior
versions: Python 3.2, Python 3.3, Python 3.4, Python 3.5, Python 3.6

___
Python tracker 

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



[issue27434] cross-building python 3.6 with an older interpreter fails

2016-07-07 Thread Xavier de Gaye

Changes by Xavier de Gaye :


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



[issue27462] NULL Pointer deref in binary_iop1 function

2016-07-07 Thread Emin Ghuliev

Emin Ghuliev added the comment:

Nope, invalid bytecode file generated by fuzzer for the purpose of bug 
researching. Just python doesn't determine whether a variable is empty or valid.

--

___
Python tracker 

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



[issue27434] cross-building python 3.6 with an older interpreter fails

2016-07-07 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 62802d373e9f by Xavier de Gaye in branch 'default':
Issue #27434: Version of interpreter running a cross-build and source version 
must be the same.
https://hg.python.org/cpython/rev/62802d373e9f

--
nosy: +python-dev

___
Python tracker 

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



[issue27462] NULL Pointer deref in binary_iop1 function

2016-07-07 Thread R. David Murray

R. David Murray added the comment:

Are you saying python generated an invalid bytecode file?

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



[issue7769] SimpleXMLRPCServer.SimpleXMLRPCServer.register_function as decorator

2016-07-07 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I don't have an opinion about needing this feature. But for accepting it needs 
more documenting. The signature should be updated, the new feature should be 
documented in the main text, not only in the versionchanged note. Needed 
examples of using egister_function as decorator.

--

___
Python tracker 

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



[issue27462] NULL Pointer deref in binary_iop1 function

2016-07-07 Thread Emin Ghuliev

New submission from Emin Ghuliev:

Python VM parses "0x3b" opcode (INPLACE_MODULO) in the bytecode file. 
Subsequently VM parses left and right arguments of the opcode (0x3b). If left 
and right arguments doesn't exists in the bytecode file that causes a 
segmentation fault. Which triggered by the binary_iop1 function.


PyEval_EvalFrameEx() at Python/ceval.c:1749

TARGET(INPLACE_MODULO) {
PyObject *right = POP();
PyObject *left = TOP();
PyObject *mod = PyNumber_InPlaceRemainder(left, right); < left = 0, 
right = 0;

Then INPLACE_MODULO opcode is passed two arguments into 
PyNumber_InPlaceRemainder. However, in order to call the binary_iop:

PyNumber_InPlaceRemainder at Objects/abstract.c:1102

PyNumber_InPlaceRemainder(PyObject *v, PyObject *w)
{
return binary_iop(v, w, NB_SLOT(nb_inplace_remainder),
NB_SLOT(nb_remainder), "%=");
}

Subsequently the binary_iop function is passed "v" argument into the 
binary_iop1:

binary_iop at Objects/abstract.c:1005

static PyObject *
binary_iop(PyObject *v, PyObject *w, const int iop_slot, const int op_slot,
const char *op_name)
{
PyObject *result = binary_iop1(v, w, iop_slot, op_slot); # v = 0 and call 
the binary_iop1 function
if (result == Py_NotImplemented) {
Py_DECREF(result);
return binop_type_error(v, w, op_name);
}
return result;
}

binary_iop1 at Objects/abstract.c:988

static PyObject *
binary_iop1(PyObject *v, PyObject *w, const int iop_slot, const int op_slot)
{
PyNumberMethods *mv = v->ob_type->tp_as_number; // dereference object < -- 
> v = 0x0
if (mv != NULL) {
binaryfunc slot = NB_BINOP(mv, iop_slot);
if (slot) {
PyObject *x = (slot)(v, w);
if (x != Py_NotImplemented) {
return x;
}
Py_DECREF(x);
}
}
return binary_op1(v, w, op_slot);
}

The binary_iop1 function doesn't check "v" field and dereference it.

  movrsi,QWORD PTR [rdi+0x8] = 0x8 byte -> 
ob_type 

$rdi register = 0x0


Program received signal SIGSEGV, Segmentation fault.

--
components: Interpreter Core
files: repro
messages: 269940
nosy: Emin Ghuliev
priority: normal
severity: normal
status: open
title: NULL Pointer deref in binary_iop1 function
versions: Python 3.6
Added file: http://bugs.python.org/file43654/repro

___
Python tracker 

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



[issue22198] Odd floor-division corner case

2016-07-07 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
resolution:  -> wont fix
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



[issue27332] Clinic: first parameter for module-level functions should be PyObject*, not PyModuleDef*

2016-07-07 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


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



[issue27332] Clinic: first parameter for module-level functions should be PyObject*, not PyModuleDef*

2016-07-07 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 870e02f86e08 by Serhiy Storchaka in branch '3.5':
Issue #27332: Fixed the type of the first argument of module-level functions
https://hg.python.org/cpython/rev/870e02f86e08

New changeset c80054ccbbd8 by Serhiy Storchaka in branch 'default':
- Issue #27332: Fixed the type of the first argument of module-level functions
https://hg.python.org/cpython/rev/c80054ccbbd8

--
nosy: +python-dev

___
Python tracker 

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



[issue27442] expose the Android API level in sysconfig.get_config_vars()

2016-07-07 Thread Xavier de Gaye

Xavier de Gaye added the comment:

In sysconfig.parse_config_h(), the variables in pyconfig.h that have a 
commented-out '#undef' line are set to 0.  Fortunately, there is no Android API 
level 0.

Checking '== 0' ensures that autoreconf has been run to add '#undef 
ANDROID_API_LEVEL' to pyconfig.h.in. If this autoreconf step were to be missed, 
the test would (correctly) fail on the buildbots that are not Android as 
get_config_var() would return None then and the test would not be skipped and 
fail.

Most of the tests in the Python test suite do check 'not 
sysconfig.get_config_var()' instead, except:
Lib/test/test_cmath.py|543 col 22| 
@unittest.skipIf(sysconfig.get_config_var('TANH_PRESERVES_ZERO_SIGN') == 0, 
"system tanh() function doesn't copy the sign")
Lib/test/test_math.py|978 col 22| 
@unittest.skipIf(sysconfig.get_config_var('TANH_PRESERVES_ZERO_SIGN') == 0, 
"system tanh() function doesn't copy the sign")

--

___
Python tracker 

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



[issue23710] C API doc for PyObject_HEAD is outdated

2016-07-07 Thread R. David Murray

R. David Murray added the comment:

Warnings are big red boxes, and we try to only use those for really critical 
info.  The current text is what we want as far as that goes.

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



[issue27332] Clinic: first parameter for module-level functions should be PyObject*, not PyModuleDef*

2016-07-07 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

LGTM. Thank you for your contribution Petr.

--
assignee:  -> serhiy.storchaka
nosy: +serhiy.storchaka
stage:  -> commit review
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



[issue27332] Clinic: first parameter for module-level functions should be PyObject*, not PyModuleDef*

2016-07-07 Thread Petr Viktorin

Petr Viktorin added the comment:

Hello,
Is there anything I can do to help get this issue resolved?

--

___
Python tracker 

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



[issue27456] TCP_NODELAY

2016-07-07 Thread Jim Fulton

Jim Fulton added the comment:

I missed the point that you can get a transport's socket using get_extra_info. 
IMO, this provides an adequate escape from the default and qualifies as a 
"proper way to set it".

I still think the default should be to enable TCP_NODELAY.

--

___
Python tracker 

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



[issue27461] Optimize PNGs

2016-07-07 Thread Ville Skyttä

Ville Skyttä added the comment:

Sure, I plan to suggest this to sphinx as well.

One corresponding tool for JPEGs is jpegoptim and its --strip-all option, but 
there is only ./Mac/BuildScript/resources/background.jpg in the cpython source 
tree (which despite of the .jpg extension appears to be a PNG file so I don't 
want to touch that stuff), plus ./Lib/test/imghdrdata/python.jpg which isn't 
worth a patch alone :)

--

___
Python tracker 

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



[issue27461] Optimize PNGs

2016-07-07 Thread STINNER Victor

STINNER Victor added the comment:

> there is only ./Mac/BuildScript/resources/background.jpg in the cpython 
> source tree (which despite of the .jpg extension appears to be a PNG file so 
> I don't want to touch that stuff)

Oh funny, you're right: it's a PNG file :-)

--

___
Python tracker 

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



[issue27461] Optimize PNGs

2016-07-07 Thread STINNER Victor

STINNER Victor added the comment:

Hi, The idea is interesting, but IMO it would be more efficient to contribute 
to Sphinx, so all documentations will benefit of smallest pictures. There is a 
similar tool for JPEG. Victor

--
nosy: +haypo

___
Python tracker 

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



[issue27461] Optimize PNGs

2016-07-07 Thread Ville Skyttä

New submission from Ville Skyttä:

Running PNGs through zopflipng makes them smaller, with no drawbacks. This 
patch was done with zopflipng version 1.0.1 with the -m option, and decreases 
the in-tree total size size of all *.png by almost 100KiB.

$ find -name "*.png" | xargs du -bc | tail -n 1  # before
291101  total

$ find -name "*.png" | xargs du -bc | tail -n 1  # after
194639  total

--
assignee: docs@python
components: Documentation
files: pngs.patch
keywords: patch
messages: 269929
nosy: docs@python, scop
priority: normal
severity: normal
status: open
title: Optimize PNGs
type: enhancement
Added file: http://bugs.python.org/file43653/pngs.patch

___
Python tracker 

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



[issue17711] Persistent id in pickle with protocol version 0

2016-07-07 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
nosy:  -pitrou

___
Python tracker 

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



[issue21496] pyvenv activate_this.py

2016-07-07 Thread Attila-Mihaly Balazs

Attila-Mihaly Balazs added the comment:

Hello,

A scenario where this would be needed (and where you can't just "execute the 
script with the python from inside the pyvenv" to get it automatically 
activate) is when running under mod_wsgi. There sometimes it is needed to 
activate the virtualenv "on the fly" from inside the application.wsgi.

Just taking activate_this.py from virtualenv and dropping it into env/bin seems 
to work nicely, so perhaps that could become the official solution?

--
nosy: +Attila-Mihaly Balazs

___
Python tracker 

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



[issue27369] [PATCH] Tests break with --with-system-expat and Expat 2.2.0

2016-07-07 Thread Chi Hsuan Yen

Chi Hsuan Yen added the comment:

Added a patch.

--
nosy: +Chi Hsuan Yen

___
Python tracker 

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



[issue27369] [PATCH] Tests break with --with-system-expat and Expat 2.2.0

2016-07-07 Thread Chi Hsuan Yen

Changes by Chi Hsuan Yen :


Added file: http://bugs.python.org/file43652/issue27369.patch

___
Python tracker 

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



[issue26662] configure/Makefile doesn't check if "python" command works, needed to build Objects/typeslots.inc

2016-07-07 Thread Chi Hsuan Yen

Chi Hsuan Yen added the comment:

Hit by missing `python` command from Python/makeopcodetargets.py, too. Is `make 
touch` the correct way?

--
nosy: +Chi Hsuan Yen

___
Python tracker 

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



[issue27434] cross-building python 3.6 with an older interpreter fails

2016-07-07 Thread Xavier de Gaye

Xavier de Gaye added the comment:

I think the way the  condition was written previously is more expressive, so 
the patch does not change that. The 'not' here expresses the fact that in the 
shell syntax, the condition is true when the test returns 0 [1], but we still 
want to express the fact that the 'break' is taken when the interpreter version 
matches $PACKAGE_VERSION.

[1] 
https://www.gnu.org/software/bash/manual/html_node/Conditional-Constructs.html#Conditional-Constructs

--

___
Python tracker 

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



[issue24557] Refactor LibreSSL / EGD detection

2016-07-07 Thread koobs

koobs added the comment:

Thank you Benjamin :)

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



[issue24557] Refactor LibreSSL / EGD detection

2016-07-07 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 7c0432cf1f2e by Benjamin Peterson in branch '3.5':
assume egd unless OPENSSL_NO_EGD is defined—remove configure check (closes 
#24557)
https://hg.python.org/cpython/rev/7c0432cf1f2e

New changeset fe168c2b5e95 by Benjamin Peterson in branch 'default':
merge 3.5 (#24557)
https://hg.python.org/cpython/rev/fe168c2b5e95

New changeset 676486e1a94f by Benjamin Peterson in branch '2.7':
assume egd unless OPENSSL_NO_EGD is defined—remove configure check (closes 
#24557)
https://hg.python.org/cpython/rev/676486e1a94f

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



[issue27019] Reduce marshal stack depth for 2.7 on Windows debug build

2016-07-07 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 6230ead06f65 by Benjamin Peterson in branch '2.7':
reduce marshal stack size in debug mode on windows (closes #27019)
https://hg.python.org/cpython/rev/6230ead06f65

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



[issue27248] Possible refleaks in PyType_Ready in error condition

2016-07-07 Thread Roundup Robot

Roundup Robot added the comment:

New changeset f1fcf60863f8 by Benjamin Peterson in branch '3.5':
fix refleaks in PyDict_SetItem error cases (closes #27248)
https://hg.python.org/cpython/rev/f1fcf60863f8

New changeset 370b2985d462 by Benjamin Peterson in branch '2.7':
fix refleaks in PyDict_SetItem error cases (closes #27248)
https://hg.python.org/cpython/rev/370b2985d462

New changeset f7c180dbc070 by Benjamin Peterson in branch 'default':
merge 3.5 (#27248)
https://hg.python.org/cpython/rev/f7c180dbc070

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