[issue29383] Reduce temporary unicode object while adding descriptors

2017-01-27 Thread INADA Naoki

Changes by INADA Naoki :


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



[issue29383] Reduce temporary unicode object while adding descriptors

2017-01-27 Thread Roundup Robot

Roundup Robot added the comment:

New changeset d7ec72c1620c by INADA Naoki in branch 'default':
Issue #29383: reduce temporary interned unicode
https://hg.python.org/cpython/rev/d7ec72c1620c

--
nosy: +python-dev

___
Python tracker 

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



[issue29182] Remove the warning in urllib docs that it doesn't do certificate validate by default.

2017-01-27 Thread Senthil Kumaran

Senthil Kumaran added the comment:

Thank you for the review, Julian.
Addressed it and the change is committed at changeset b5125e971fdd

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



[issue21085] Cygwin does not provide siginfo_t.si_band

2017-01-27 Thread Decorater

Decorater added the comment:

In 3.6 and 3.7 The Same Error is back on line 960 with gcc 6.3.0 on cygwin64. 
This issue is not entirely fixed even with the absolute latest commits.

$ make
gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-pro
totypes-std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missin
g-field-initializers   -I. -I./Include-DPy_BUILD_CORE  -c ./Modules/signalmo
dule.c -o Modules/signalmodule.o
In file included from ./Include/Python.h:85:0,
 from ./Modules/signalmodule.c:6:
./Modules/signalmodule.c: In function ‘fill_siginfo’:
./Modules/signalmodule.c:960:60: error: ‘siginfo_t {aka struct }’ has
 no member named ‘si_band’; did you mean ‘si_pid’?
 PyStructSequence_SET_ITEM(result, 6, PyLong_FromLong(si->si_band));
^
./Include/tupleobject.h:62:75: note: in definition of macro ‘PyTuple_SET_ITEM’
 #define PyTuple_SET_ITEM(op, i, v) (((PyTupleObject *)(op))->ob_item[i] = v)
   ^
./Modules/signalmodule.c:960:5: note: in expansion of macro ‘PyStructSequence_SE
T_ITEM’
 PyStructSequence_SET_ITEM(result, 6, PyLong_FromLong(si->si_band));
 ^
make: *** [Makefile:1741: Modules/signalmodule.o] Error 1

--
nosy: +Decorater

___
Python tracker 

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



[issue29383] Reduce temporary unicode object while adding descriptors

2017-01-27 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

descr-remove-getitemstring-2.patch LGTM.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue29383] Reduce temporary unicode object while adding descriptors

2017-01-27 Thread INADA Naoki

Changes by INADA Naoki :


Added file: http://bugs.python.org/file46444/dict-setitemstring.patch

___
Python tracker 

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



[issue29383] Reduce temporary unicode object while adding descriptors

2017-01-27 Thread INADA Naoki

INADA Naoki added the comment:

descr-remove-getitemstring-2.patch is more compact than first patch.
(3 unicode + 2 intern) becomes (2 unicode + 1 intern).

python_startup_no_site: Median +- std dev: 12.5 ms +- 0.1 ms

--
Added file: http://bugs.python.org/file46443/descr-remove-getitemstring-2.patch

___
Python tracker 

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



[issue29383] Reduce temporary unicode object while adding descriptors

2017-01-27 Thread INADA Naoki

INADA Naoki added the comment:

I think I found better way.

Interned string can be get from descripter. Interning can be reduced
without adding private API.
Please don't review the first patch.

--

___
Python tracker 

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



[issue29310] Document typing.NamedTuple default argument syntax

2017-01-27 Thread Jelle Zijlstra

Jelle Zijlstra added the comment:

Thanks! Uploaded a revised patch.

--
Added file: http://bugs.python.org/file46442/issue29310-2.patch

___
Python tracker 

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



[issue29382] IDLE search and replace should use 'hit' tag instead of 'hilite'

2017-01-27 Thread Terry J. Reedy

Terry J. Reedy added the comment:

After the original bug for #18590 was fixed, I left it open for working on the 
tags.  (Currently, Find and the find part of Replace work differently and at 
least one of them double tags found text.)  I decided to close it and use this 
for the tag choice issue.

My replace_find_hit.diff patch on #18590 should be considered transferred to 
this one.

--

___
Python tracker 

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



[issue18590] Found text not always highlighted by Replace dialog on Windows

2017-01-27 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Since the original bug for this issue has been fixed, I am closing it in favor 
of #29392

--
resolution:  -> fixed
stage: test needed -> resolved
status: open -> closed
superseder:  -> IDLE search and replace should use 'hit' tag instead of 'hilite'

___
Python tracker 

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



[issue29382] IDLE search and replace should use 'hit' tag instead of 'hilite'

2017-01-27 Thread Terry J. Reedy

Terry J. Reedy added the comment:

The now-closed issues I remember were about hits not being visibly marked at 
all.  For me, on Win 10 with 3.6, they are being marked.  If you are referring 
to any discussion specifically about which tag to use, please post the issue 
numbers prefixed with '#', as in #29382, to make them become links.

Without a patch and more explanaton, I am not sure what you did and what you 
saw as a result.

I have considered changing the 'hit' tag, but I want to first investigate the 
behave of other editors (and apps with 'find' functions) on the major 
platforms.  When I have a proposed patch, I will solicit opinions on whether it 
is better.

--
components:  -Windows
nosy:  -paul.moore, steve.dower, tim.golden, zach.ware
title: IDLE search/replace/replace+find is (still?) using the 'hilite' tag 
instead of 'hit' -> IDLE search and replace should use 'hit' tag instead of 
'hilite'
type: behavior -> enhancement
versions: +Python 3.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



[issue29383] Reduce temporary unicode object while adding descriptors

2017-01-27 Thread INADA Naoki

New submission from INADA Naoki:

add_methods(), add_members(), and add_getset() creates PyUnicode from C string 
3 times, and calls PyUnicode_InternInplace 2 times.

1. PyDict_GetItemString() at first. (PyUnicode_FromString() is called).
2. In middle, descr_new() calls PyUnicode_InternFromString().
3. PyDict_SetItemString() at last. (creates unicode and intern it).

Skipping (2) is require adding new private APIs to pass PyUnicodeObject.
But I don't think it worth enough. (I'll try it later.)
So this patch only remove last temporary unicode.
(3 PyUnicode_FromString + 2 PyUnicode_InternInplace) becomes (2 
PyUnicode_FromString + 2 PyUnicode_InternInplace).

It seems ~1% startup speedup (without site).

  $ ./python -m performance.benchmarks.bm_python_startup --no-site
  default: python_startup_no_site: Median +- std dev: 12.7 ms +- 0.1 ms
  patched: python_startup_no_site: Median +- std dev: 12.6 ms +- 0.1 ms

While speedup is small, this patch removes time to think "How large this
overhead of GetItemString + SetItemString pair?" while reading code :)

Additionally, this patch removes this comment in PyDict_SetItemString:

  -PyUnicode_InternInPlace(); /* XXX Should we really? */

SetItemString is used to add something to namespace.
Changing this behavior affects too widely.  So we should do it.

--
assignee: inada.naoki
components: Interpreter Core
files: descr-remove-getitemstring.patch
keywords: patch
messages: 286394
nosy: inada.naoki
priority: normal
severity: normal
status: open
title: Reduce temporary unicode object while adding descriptors
versions: Python 3.7
Added file: http://bugs.python.org/file46441/descr-remove-getitemstring.patch

___
Python tracker 

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



[issue29382] IDLE search/replace/replace+find is (still?) using the 'hilite' tag instead of 'hit'

2017-01-27 Thread d s

New submission from d s:

Searching for this issue turned up a bunch of results claiming it's fixed, but 
it isn't, at least not on my windows 10 machine. I tried replacing 'hit' with 
'itdunwork' in colorizer.py, searchbase.py, replace.py, searchengine.py, 
config.py, search.py, configdialog.py, and of course config-highlight.cfg, but 
it didn't work.

--
assignee: terry.reedy
components: IDLE, Windows
messages: 286393
nosy: d s2, paul.moore, steve.dower, terry.reedy, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: IDLE search/replace/replace+find is (still?) using the 'hilite' tag 
instead of 'hit'
type: behavior
versions: Python 3.5, Python 3.6

___
Python tracker 

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



[issue15373] copy.copy() does not properly copy os.environment

2017-01-27 Thread Raymond Hettinger

Raymond Hettinger added the comment:

[Antoine]
> I agree with David that copy(os.environ) is rather ambiguous.
> I think the preferred idiom should be to call dict(os.environ).
> As for __copy__, I don't know what it should do: perhaps
> simply raise an error when copying is attempted?

FWIW, I concur with Antoine on every point.  Also, raising an error when 
copying seems reasonable ("refuse the temptation to guess" at what the user 
intended).

--
nosy: +rhettinger

___
Python tracker 

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



[issue28055] pyhash's siphash24 assumes alignment of the data pointer

2017-01-27 Thread Greg Onufer

Greg Onufer added the comment:

32-bit and 64-bit SPARC ABIs have 64-bit integer data types.

SPARC, like many RISC architectures, also has natural alignment requirements.  
Attempting to dereference a pointer to a 4-byte-sized object requires 4-byte 
alignment, for example.  2-byte-sized objects require 2-byte alignment.  
8-byte-sized objects require 8-byte alignment.

siphash24 is encountering this bug on modern SPARC (32-bit ABI currently, 
haven't tried compiling as 64-bit yet).  The code simply is not portable.

Benjamin's patch gets the failing self-test (test_plistlib) to pass as well as 
the simple test case in msg275493 above.

--
nosy: +gco

___
Python tracker 

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



[issue29237] Create enum for pstats sorting options

2017-01-27 Thread Raymond Hettinger

Raymond Hettinger added the comment:

Mariatta, would you like to prepare a patch for this.  Ethan and I will review 
it.

--
assignee:  -> Mariatta
nosy: +Mariatta, rhettinger

___
Python tracker 

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



[issue1346238] A constant folding optimization pass for the AST

2017-01-27 Thread Raymond Hettinger

Raymond Hettinger added the comment:

I applaud any effort to move constant folding out of the peepholer and into AST.

--

___
Python tracker 

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



[issue29381] Tutorial documentation contains undefined reference to #!

2017-01-27 Thread Raymond Hettinger

Raymond Hettinger added the comment:

Mariatta, could you check this patch and tell us your recommendation about 
whether it should be applied, modified, or rejected?

--
assignee: docs@python -> Mariatta
nosy: +Mariatta, rhettinger

___
Python tracker 

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



[issue29371] Typo in doctest documentation

2017-01-27 Thread Raymond Hettinger

Raymond Hettinger added the comment:

Mariatta, would you like to look into this and opine about whether the docs are 
correct as-is.  If you think a change is warranted, propose a patch.

--

___
Python tracker 

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



[issue3991] urllib.request.urlopen does not handle non-ASCII characters

2017-01-27 Thread Andreas Åkerlund

Andreas Åkerlund added the comment:

Changed the patch after pointers from vadmium.
And quote_uri is changed to quote_iri as martin.panter thought it was more 
appropriate.

--
Added file: http://bugs.python.org/file46440/issue3991_2017-01-27.diff

___
Python tracker 

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



[issue968063] Add fileinput.islastline()

2017-01-27 Thread Saurav Singh

Saurav Singh added the comment:

last patch works fine i have applied and tested the patch.Its documented 
well.Can we please have it reviewed?

--
nosy: +Saurav Singh

___
Python tracker 

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



[issue29371] Typo in doctest documentation

2017-01-27 Thread Raymond Hettinger

Changes by Raymond Hettinger :


--
assignee: docs@python -> Mariatta
nosy: +Mariatta, rhettinger

___
Python tracker 

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



[issue15373] copy.copy() does not properly copy os.environment

2017-01-27 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

If add support for the copy protocol, consider also adding support for 
deepcopying and pickling.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue15373] copy.copy() does not properly copy os.environment

2017-01-27 Thread Gregory P. Smith

Changes by Gregory P. Smith :


--
keywords: +needs review
nosy: +gregory.p.smith
stage:  -> patch review
versions: +Python 3.7 -Python 3.4

___
Python tracker 

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



[issue29377] Add the 'wrapper_descriptor' type to the types module

2017-01-27 Thread Ivan Levkivskyi

Ivan Levkivskyi added the comment:

Manuel, thank you for the new patch now everything works. I have few more 
comments:
1. I have found that there is one more built-in type: type(str.join) gives 
. Maybe it makes sense to add this one too?
2. Taking into account previous point I withdraw my idea of needing tests here. 
Sorry for changing opinion twice, but it looks like there are many built-in 
types that seem to exist just for historical reasons. They might change in 
future.
3. Please take a look at my review on documentation in Rietveld.

--

___
Python tracker 

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



[issue29374] Doc: signal.sig(timed)wait do not work outside the main thread

2017-01-27 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
title: Doc bug: signal.sigwait and signal.sigtimedwait do not work outside the 
Main thread -> Doc: signal.sig(timed)wait do not work outside the main thread

___
Python tracker 

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



[issue29366] os.listdir has inconsistent behavior when run on a non-directory

2017-01-27 Thread Terry J. Reedy

Terry J. Reedy added the comment:

This is a feature-change 'enhancement' issue.  There is no violation of the doc 
at https://docs.python.org/3/library/os.html#os.listdir and as Raylu noted, the 
current behavior is accommodated in tests.

I presume that regardless of what system calls are made, FileNotFoundError and 
anything else could be caught and NotADirectoryError raised instead, with the 
message containing the Windows error message.  This would only break 
Windows-specific code that only catches FileNotFoundError and not 
NotADirectoryError.

I am not sure what our general policy is and whether this should be fixed at 
this point.  I personally like Python smoothing over OS differences when easily 
possible.

--
nosy: +terry.reedy
stage:  -> test needed
type:  -> enhancement
versions: +Python 3.7

___
Python tracker 

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



[issue29264] sparc/ffi.c:440 error: 'asm' undeclared

2017-01-27 Thread Xavier de Gaye

Xavier de Gaye added the comment:

See also msg286365.

--
nosy: +xdegaye
resolution:  -> third party
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue29302] add contextlib.AsyncExitStack

2017-01-27 Thread Alexander Mohr

Alexander Mohr added the comment:

created gist: https://gist.github.com/thehesiod/b8442ed50e27a23524435a22f10c04a0

I've now updated the imple to support both __aenter__/__aexit__ and 
__enter__/__exit__ so I don't need two ExitStacks

--

___
Python tracker 

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



[issue29302] add contextlib.AsyncExitStack

2017-01-27 Thread Alexander Mohr

Changes by Alexander Mohr :


Removed file: http://bugs.python.org/file46322/exit_stack.py

___
Python tracker 

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



[issue29371] Typo in doctest documentation

2017-01-27 Thread Jim Fasarakis-Hilliard

Jim Fasarakis-Hilliard added the comment:

I think it is fine as it is but, agree that it could be clearer. I'm simply not 
experienced enough to know if this change is warranted. 

The docs generally do a great job in being concise (balancing brevity and 
completeness). A core-dev would be best to judge if brevity should be 
sacrificed for more complete and clear wording here. 

I suggest waiting to see if any core-dev replies and, if no replies come in 
after a while, close it.

--

___
Python tracker 

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



[issue29381] Tutorial documentation contains undefined reference to #!

2017-01-27 Thread Jim Fasarakis-Hilliard

Changes by Jim Fasarakis-Hilliard :


--
title: Tutorial documentation contains undefined reference -> Tutorial 
documentation contains undefined reference to #!
Added file: http://bugs.python.org/file46439/interpreter_tut2.7.patch

___
Python tracker 

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



[issue29381] Tutorial documentation contains undefined reference

2017-01-27 Thread Jim Fasarakis-Hilliard

New submission from Jim Fasarakis-Hilliard:

After moving a certain chunk of the 'interpreter.rst' contents to 
'appendix.rst' in issue16827 the reference to #! in the section '2.2.3. Source 
Code Encoding' is currently confusing for new readers.

Attached patches reword the sentence to remove that reference for 3.4+ and 2.7.

--
assignee: docs@python
components: Documentation
files: interpreter_tut.patch
keywords: patch
messages: 286378
nosy: Jim Fasarakis-Hilliard, docs@python
priority: normal
severity: normal
status: open
title: Tutorial documentation contains undefined reference
versions: Python 2.7, Python 3.4, Python 3.5, Python 3.6, Python 3.7
Added file: http://bugs.python.org/file46438/interpreter_tut.patch

___
Python tracker 

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



[issue23163] pdb docs need to contain a statement on threads/multithreaded debugging

2017-01-27 Thread Attila-Mihaly Balazs

Attila-Mihaly Balazs added the comment:

Absolutely this. While it is good that there is at least some documentation (at 
sys.settrace), it is not very explicit nor is it self evident that one should 
look there (for example the PDB docs don't even mention settrace).

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



[issue29100] datetime.fromtimestamp() doesn't check min/max year anymore: regression of Python 3.6

2017-01-27 Thread STINNER Victor

STINNER Victor added the comment:

timestamp_limits-2.patch: catch also OverflowError in unit tests, and uses a 
context manager rather than self.assertRaises(..., func, ...) syntax.

--
Added file: http://bugs.python.org/file46437/timestamp_limits-2.patch

___
Python tracker 

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



[issue29301] decimal: Use FASTCALL and/or Argument Clinic

2017-01-27 Thread Stefan Krah

Stefan Krah added the comment:

> STINNER Victor added the comment:
> > AC will not happen: It makes the module too large and unreadable.
> 
> Ah you dislike the additional [clinic input] sections?

Yes, they tear apart the code.  I stopped reading many C files because
of this.  Brett asked why several people don't review, this is actually
*one* of the reasons for me.

> It's kind of strange when you have to convert existing code, when once
> the code uses AC, I prefer AC to separated documentation variables. It
> helps to keep docstrings more up to date, and it helps to enhance the
> API (ex: allow keywords, rename parameters to better names, etc.). It
> also helps to make the documentation closer to the code, which is IMHO
> a good thing :-)

Apparently it works for several people, but not me.

> IMHO the PyArg_ParseXXX() calls and their "kwlist" static variable are
> "unreadable", and I'm happy to be able to hide them!
> 
> FYI decimal-2.patch replaces PyArg_ParseTupleAndKeywords() with
> _PyArg_ParseStackAndKeywords() with static _PyArg_Parser object. This
> object only decides keyword names once and is more efficient to parse
> arguments. It explains partially the speedup. Only partially because
> bm_telco only calls the .quantize() method, and it only uses
> positional arguments (no keyword arguments) ;-)

Okay, thanks!

--

___
Python tracker 

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



[issue29301] decimal: Use FASTCALL and/or Argument Clinic

2017-01-27 Thread STINNER Victor

STINNER Victor added the comment:

Stefan Krah:
> AC will not happen: It makes the module too large and unreadable.

Ah you dislike the additional [clinic input] sections?

It's kind of strange when you have to convert existing code, when once
the code uses AC, I prefer AC to separated documentation variables. It
helps to keep docstrings more up to date, and it helps to enhance the
API (ex: allow keywords, rename parameters to better names, etc.). It
also helps to make the documentation closer to the code, which is IMHO
a good thing :-)

IMHO the PyArg_ParseXXX() calls and their "kwlist" static variable are
"unreadable", and I'm happy to be able to hide them!

FYI decimal-2.patch replaces PyArg_ParseTupleAndKeywords() with
_PyArg_ParseStackAndKeywords() with static _PyArg_Parser object. This
object only decides keyword names once and is more efficient to parse
arguments. It explains partially the speedup. Only partially because
bm_telco only calls the .quantize() method, and it only uses
positional arguments (no keyword arguments) ;-)

--

___
Python tracker 

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



[issue29300] Modify the _struct module to use FASTCALL and Argument Clinic

2017-01-27 Thread STINNER Victor

STINNER Victor added the comment:

Updated patch, version 6:

* Rename "obj" variable to "iter"
* Fix unpack_from() signature: only the first parameter is positional only

--
Added file: http://bugs.python.org/file46436/struct_fastcall-6.patch

___
Python tracker 

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



[issue29301] decimal: Use FASTCALL and/or Argument Clinic

2017-01-27 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

> What is the status of Argument Clinic? Is it something "public" or not?

No, it is for for internal CPython use only. It lacks some features (support 
of var-positional and var-keyword parameters, optional parameters without 
default value), the syntax of positional-only parameters is not officially 
accepted still, and future optimizations can require incompatible changes.

Only when all CPython builtins and extensions be converted to Argument Clinic,
PEP 457 (or an alternative) be accepted, Argument Clinic issues be resolved, 
we could say it stable enough. For now even Argument Clinic tests are broken.

--

___
Python tracker 

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



[issue29301] decimal: Use FASTCALL and/or Argument Clinic

2017-01-27 Thread Stefan Krah

Stefan Krah added the comment:

I'll take a look when I have the opportunity.

AC will not happen: It makes the module too large and unreadable.

--

___
Python tracker 

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



[issue29378] Invalid example in documentation for PyErr_Fetch

2017-01-27 Thread Kaeptm Blaubaer

Kaeptm Blaubaer added the comment:

I had no outdated documentation, but the documentation of 3.5.

--
resolution: out of date -> 
status: closed -> open
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



[issue29301] decimal: Use FASTCALL and/or Argument Clinic

2017-01-27 Thread STINNER Victor

STINNER Victor added the comment:

Oops, I forgot to attach decimal-2.patch, here you have.


> I would dissuade from direct using of FASTCALL, but Argument Clinic is enough 
> reliable.

I wrote decimal-2.patch in a few minutes, when I was trying to find all 
functions still calling _PyStack_AsTuple() in my tp_fast{new,init,call} fork. I 
just wrote it to identify which parts of CPython can be optimized to make 
bm_telco faster.

I agree that Argument Clinic should be preferred over using directly 
METH_FASTCALL, especially for the _decimal module: Stefan already wrote that he 
wants to have the same code base on Python 3.5, 3.6 and 3.7.


> I would recommend to use Argument Clinic unless Stefan supports external fork 
> of the decimal module and is limited by public API.

What is the status of Argument Clinic? Is it something "public" or not?

The status of _decimal is also unclear to me. Is it part of CPython or not? :-) 
I know that there is also a "backported" module for Python 2:

   https://pypi.python.org/pypi/cdecimal
   http://www.bytereef.org/mpdecimal/index.html

IMHO it's a great tool. Maybe it's time to make it usable outside CPython in 
Python 3.7? Or maybe we should wait until the remaining missing features are 
implemented? Issues #20291 and #29299 for example.

I'm now waiting for Stefan's feedback ;-)

--
Added file: http://bugs.python.org/file46435/decimal-2.patch

___
Python tracker 

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



[issue29301] decimal: Use FASTCALL and/or Argument Clinic

2017-01-27 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I would dissuade from direct using of FASTCALL, but Argument Clinic is enough 
reliable. I would recommend to use Argument Clinic unless Stefan supports 
external fork of the decimal module and is limited by public API.

--

___
Python tracker 

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



[issue29300] Modify the _struct module to use FASTCALL and Argument Clinic

2017-01-27 Thread STINNER Victor

STINNER Victor added the comment:

New patch version 5 without the "format_converter".


Serhiy Storchaka: I said not about the converter that converts format to bytes 
(it is needed only in Struct.__init__),

For me, it makes sense to check format type earlier than Struct.__init__(), but 
since you like the current code, I'm also ok to leave this part of the code 
unchanged :-)


Serhiy: but about the converter that converts format to the Struct object. It 
is used in all module-level functions.

Sorry, but I dislike this change. Even if multiple functions do the same, for 
me creating a Struct object is not something part of the argument parsing. I 
prefer to keep the following 3 lines in each C function *body* to ease 
debugging:

PyObject *s_object = cache_struct(format);
if (s_object == NULL)
return NULL;

IMHO my struct_fastcall-5.patch is already big enough. I prefer incremental 
changes.

I have no strong opinion on cache_struct(), just a matter of taste :-) And 
others may like your change!

Feel free to write your own patch on top of mine, once mine is merged ;-)

--
Added file: http://bugs.python.org/file46434/struct_fastcall-5.patch

___
Python tracker 

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



[issue29378] Invalid example in documentation for PyErr_Fetch

2017-01-27 Thread Kaeptm Blaubaer

Kaeptm Blaubaer added the comment:

I had an outdated version of the documentation.

--
resolution:  -> out of date
status: open -> closed

___
Python tracker 

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



[issue29380] A lot of warning while executing make install

2017-01-27 Thread Zachary Ware

Zachary Ware added the comment:

Building _ctypes with the bundled copy of libffi is deprecated since Python 
3.6, and is not possible in 3.7. If you need the ctypes module, please install 
libffi separately and make sure the Python build process can find it. If you 
build libffi yourself, please report any warnings at github.com/libffi/libffi.

--
nosy: +zach.ware
resolution:  -> third party
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue29300] Modify the _struct module to use FASTCALL and Argument Clinic

2017-01-27 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I said not about the converter that converts format to bytes (it is needed only 
in Struct.__init__), but about the converter that converts format to the Struct 
object. It is used in all module-level functions.

--

___
Python tracker 

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



[issue29326] Blank lines in ._pth file are not ignored

2017-01-27 Thread Alexey Izbyshev

Alexey Izbyshev added the comment:

I've encountered this issue too. (FYI, the official 3.6.0 embeddable zip from 
https://www.python.org/downloads/windows/ does contain a blank line in its 
._pth, so all its users get an invalid entry in sys.path).

The patch is attached. I couldn't fix tests in more straightforward way because 
both of them were broken:
* Both of them generated ._pth with 'import site'
* Both of them checked for zero exit code instead of non-zero one, but both 
passed because predicates in sys.exit() were incorrect

I've strengthened the check in 'nosite' test because it is trivial to fully 
emulate sys.path calculation logic in this case. I've preserved weaker checks 
in the other test because I didn't want to emulate site.py logic.

--
nosy: +izbyshev
Added file: http://bugs.python.org/file46433/underpth_blank_lines.diff

___
Python tracker 

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



[issue29301] decimal: Use FASTCALL and/or Argument Clinic

2017-01-27 Thread STINNER Victor

STINNER Victor added the comment:

Hello, I'm back! :-)

I almost abandonned my the tp_fastcall change (#29259).

print() now uses FASTCALL (#29296), it already made bm_telco faster:
https://speed.python.org/timeline/#/?exe=5=telco=1=50=off=on=on
(see the speedup around January 16 at the right)

For the unpack module, I'm still working on my patch in the issue #29300, but 
it doesn't seem to have a significant impact on bm_telco.

So the remaining question is the usage of FASTCALL or Argument Clinic in the 
_decimal module.


> Since the performance impact is unclear, I prefer to close this issue. I will 
> come back if argument parsing is more clearly identified as a performance 
> bottleneck.

I ran a new benchmark and FASTCALL makes bm_telco benchmark 1.11x faster:

Median +- std dev: [ref] 19.4 ms +- 0.7 ms -> [decimal-2.patch] 17.5 ms +- 0.6 
ms: 1.11x faster (-10%)

So I decided to reopen the issue.

Stefan: what do you think of using Argument Clinic and/or FASTCALL in _decimal? 
Is "bm_telco 1.11x faster" significant enough for you to justify such change?

"The best would be to use Argument Clinic. AC exists since Python 3.5, so it 
should be possible to keep the same code base on Python 3.5-3.7, only generated 
code would be different."

--
resolution: rejected -> 
status: closed -> open

___
Python tracker 

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



[issue29100] datetime.fromtimestamp() doesn't check min/max year anymore: regression of Python 3.6

2017-01-27 Thread STINNER Victor

STINNER Victor added the comment:

timestamp_limits.patch is waiting for your review! This issue is a major 
regression of Python 3.6. I'm going to push the patch in one week if I don't 
get any review.

--

___
Python tracker 

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



[issue29100] datetime.fromtimestamp() doesn't check min/max year anymore: regression of Python 3.6

2017-01-27 Thread STINNER Victor

STINNER Victor added the comment:

The issue #29346 has been marked as a duplicate of this one.

--

___
Python tracker 

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



[issue29100] datetime.fromtimestamp() doesn't check min/max year anymore: regression of Python 3.6

2017-01-27 Thread STINNER Victor

Changes by STINNER Victor :


--
nosy: +Eli Collins, lemburg

___
Python tracker 

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



[issue29346] datetime doesn't check for min/max dates anymore in Python 3.6.0 => crash

2017-01-27 Thread STINNER Victor

STINNER Victor added the comment:

Since it's a duplicate, I close this issue.

--
status: open -> closed
superseder:  -> datetime.fromtimestamp() doesn't check min/max year anymore: 
regression of Python 3.6

___
Python tracker 

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



[issue29346] datetime doesn't check for min/max dates anymore in Python 3.6.0 => crash

2017-01-27 Thread STINNER Victor

Changes by STINNER Victor :


--
title: datetime.utcfromtimestamp() returns strange result for very large values 
-> datetime doesn't check for min/max dates anymore in Python 3.6.0 => crash

___
Python tracker 

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



[issue27435] ctypes library loading and AIX - also for 2.7.X (and later)

2017-01-27 Thread Michael Haubenwallner

Changes by Michael Haubenwallner :


--
nosy: +haubi

___
Python tracker 

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



[issue29300] Modify the _struct module to use FASTCALL and Argument Clinic

2017-01-27 Thread STINNER Victor

STINNER Victor added the comment:

> See also ascii_buffer_converter in Modules/binascii.c for example.

Nice. I didn't know the "def cleanup" feature. I used it in my patch version 4.

--

___
Python tracker 

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



[issue29300] Modify the _struct module to use FASTCALL and Argument Clinic

2017-01-27 Thread STINNER Victor

STINNER Victor added the comment:

Thank you for your reviews Serhiy :-) Here is a new patch to take in account 
your latest comments.

I didn't change the API anymore: Struct.unpack_from() accepts keywords, 
unpack_from() doesn't.

--
Added file: http://bugs.python.org/file46432/struct_fastcall-4.patch

___
Python tracker 

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



[issue29380] A lot of warning while executing make install

2017-01-27 Thread Eric V. Smith

Eric V. Smith added the comment:

Can you give us your platform, platform version, compiler, and compiler 
version? Also, the entire output of "make install" (or whatever make command 
you're running).

Thanks.

--
nosy: +eric.smith

___
Python tracker 

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



[issue29380] A lot of warning while executing make install

2017-01-27 Thread Mirko Tebaldi (Realtebo)

New submission from Mirko Tebaldi (Realtebo):

/usr/src/Python-3.6.0/Modules/_ctypes/libffi/src/x86/ffi64.c: In function 
'classify_argument':
/usr/src/Python-3.6.0/Modules/_ctypes/libffi/src/x86/ffi64.c:195:18: warning: 
suggest braces around empty body in an 'else' statement [-Wempty-body]
FFI_ASSERT (0);
  ^
/usr/src/Python-3.6.0/Modules/_ctypes/libffi/src/x86/ffi64.c:224:16: warning: 
comparison between signed and unsigned integer expressions [-Wsign-compare]
  for (i = 0; i < words; i++)
^
/usr/src/Python-3.6.0/Modules/_ctypes/libffi/src/x86/ffi64.c:245:20: warning: 
comparison between signed and unsigned integer expressions [-Wsign-compare]
  for (i = 0; i < num; i++)
^
/usr/src/Python-3.6.0/Modules/_ctypes/libffi/src/x86/ffi64.c:264:20: warning: 
comparison between signed and unsigned integer expressions [-Wsign-compare]
  for (i = 1; i < words; i++)
^
/usr/src/Python-3.6.0/Modules/_ctypes/libffi/src/x86/ffi64.c:270:16: warning: 
comparison between signed and unsigned integer expressions [-Wsign-compare]
  for (i = 0; i < words; i++)
^
/usr/src/Python-3.6.0/Modules/_ctypes/libffi/src/x86/ffi64.c: In function 
'examine_argument':
/usr/src/Python-3.6.0/Modules/_ctypes/libffi/src/x86/ffi64.c:323:17: warning: 
comparison between signed and unsigned integer expressions [-Wsign-compare]
   for (i = 0; i < n; ++i)
 ^
/usr/src/Python-3.6.0/Modules/_ctypes/libffi/src/x86/ffi64.c: In function 
'ffi_call':
/usr/src/Python-3.6.0/Modules/_ctypes/libffi/src/x86/ffi64.c:484:18: warning: 
comparison between signed and unsigned integer expressions [-Wsign-compare]
for (j = 0; j < n; j++, a += 8, size -= 8)
  ^
/usr/src/Python-3.6.0/Modules/_ctypes/libffi/src/x86/ffi64.c: In function 
'ffi_closure_unix64_inner':
/usr/src/Python-3.6.0/Modules/_ctypes/libffi/src/x86/ffi64.c:659:18: warning: 
comparison between signed and unsigned integer expressions [-Wsign-compare]
for (j = 0; j < n; j++, a += 8)
  ^

--
messages: 286355
nosy: Mirko Tebaldi (Realtebo)
priority: normal
severity: normal
status: open
title: A lot of warning while executing make install
type: compile error
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



[issue25667] Supply dual-stack (IPv4/IPv6) socket bind routine

2017-01-27 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Related though with a different strategy: Tornado's bind_sockets() routine:
https://github.com/tornadoweb/tornado/blob/master/tornado/netutil.py#L114-L138

--

___
Python tracker 

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



[issue25667] Supply dual-stack (IPv4/IPv6) socket bind routine

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



[issue11549] Build-out an AST optimizer, moving some functionality out of the peephole optimizer

2017-01-27 Thread INADA Naoki

Changes by INADA Naoki :


--
nosy: +inada.naoki

___
Python tracker 

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



[issue1346238] A constant folding optimization pass for the AST

2017-01-27 Thread INADA Naoki

Changes by INADA Naoki :


--
nosy: +inada.naoki

___
Python tracker 

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



[issue28784] shlex.shlex punctuation_chars documentation should use posix=True

2017-01-27 Thread Roundup Robot

Roundup Robot added the comment:

New changeset ff3312ce1d14 by Vinay Sajip in branch '3.6':
Fixes #28784: Clarified use of shlex.shlex with punctuation_chars.
https://hg.python.org/cpython/rev/ff3312ce1d14

New changeset 46f8188f8646 by Vinay Sajip in branch 'default':
Closes #28784: Merged update from 3.6.
https://hg.python.org/cpython/rev/46f8188f8646

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



[issue29308] venv should match virtualenv VIRTUAL_ENV_DISABLE_PROMPT config

2017-01-27 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 91b949dc1984 by Vinay Sajip in branch '3.5':
Fixes #29308: Respect VIRTUAL_ENV_DISABLE_PROMPT in Activate.ps1.
https://hg.python.org/cpython/rev/91b949dc1984

New changeset d3890b44159c by Vinay Sajip in branch '3.6':
Fixes #29308: Merged fix from 3.5.
https://hg.python.org/cpython/rev/d3890b44159c

New changeset aef895fef120 by Vinay Sajip in branch 'default':
Closes #29308: Merged fix from 3.6.
https://hg.python.org/cpython/rev/aef895fef120

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



[issue29300] Modify the _struct module to use FASTCALL and Argument Clinic

2017-01-27 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

See also ascii_buffer_converter in Modules/binascii.c for example.

--

___
Python tracker 

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



[issue29300] Modify the _struct module to use FASTCALL and Argument Clinic

2017-01-27 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

static int
cache_struct_converter(PyObject *arg, PyObject **s_object)
{
if (arg == NULL) {
Py_DECREF();
return 1;
}
*s_object = cache_struct(arg); // actually inline this
if (*s_object == NULL)
return 0;
return Py_CLEANUP_SUPPORTED;
}

--

___
Python tracker 

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



[issue29300] Modify the _struct module to use FASTCALL and Argument Clinic

2017-01-27 Thread STINNER Victor

STINNER Victor added the comment:

> The converter for the format parameter already exists. It is cache_struct(). 
> You just need to change its interface.

The code to convert the format string is in s_init(). The code increases the 
reference counter, I don't see how to produce the Py_DECREF() code.

Again, I would prefer to do that later. The change is already big enough :-)


> I think this should be backported to older versions.

Ok, will do once this change is accepted.

--

___
Python tracker 

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



[issue29300] Modify the _struct module to use FASTCALL and Argument Clinic

2017-01-27 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

The converter for the format parameter already exists. It is cache_struct(). 
You just need to change its interface.

> * Fix Struct.__init__() error message: the method accepts also Unicode
> * Document that Struct accepts str encodable to ASCII and bytes

I think this should be backported to older versions. Maybe there is an open 
issue for this.

> I would be nice to use Py_buffer format for the "buffer" argument of 
> iter_unpack(), but Argument Clinic calls PyBuffer_Release(), whereas 
> the buffer should stay alive after the function exit. Is there a way to 
> clone/copy a Py_buffer?

I agreed that the Py_buffer converter is not applicable here. Just object is 
good.

--

___
Python tracker 

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



[issue29182] Remove the warning in urllib docs that it doesn't do certificate validate by default.

2017-01-27 Thread Julian Berman

Julian Berman added the comment:

Cool! If I can nitpick one last time, in the versionchanged block, you have 
`HTTPS URIs` but in the warning you use `HTTPS Urls` -- probably best to use 
consistent casing and URL vs URI.

Other than that, lgtm to merge.

--

___
Python tracker 

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



[issue29300] Modify the _struct module to use FASTCALL and Argument Clinic

2017-01-27 Thread STINNER Victor

STINNER Victor added the comment:

Patch version 3:

* Use also Argument Clinic for Struct.__init__()
* Rename fmt to format: in the code and docstring. By the way, Struct docstring 
was wrong: Struct() accepts a 'format' keyword argument, not 'fmt'
* Use Py_buffer converter for the buffer parameter, except for iter_unpack()
* Document that unpack_from() now accepts keywords and write an unit test
* Fix Struct.__init__() error message: the method accepts also Unicode
* Document that Struct accepts str encodable to ASCII and bytes

I would be nice to use Py_buffer format for the "buffer" argument of 
iter_unpack(), but Argument Clinic calls PyBuffer_Release(), whereas the 
buffer should stay alive after the function exit. Is there a way to clone/copy 
a Py_buffer?

For the fmt/format argument: s_init() uses custom code to accept Unicode 
encodable to ASCII and bytes objects. Using Argument Clinic to check fmt type 
would require to write a converter. I would prefer to not make too many changes 
in a single patch, and I don't know how to write such converter. I suggest to 
do that later and keep the existing code. It seems like all functions getting a 
format ends in s_init() to check the format argument.

--
Added file: http://bugs.python.org/file46431/struct_fastcall-3.patch

___
Python tracker 

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



[issue29182] Remove the warning in urllib docs that it doesn't do certificate validate by default.

2017-01-27 Thread Senthil Kumaran

Senthil Kumaran added the comment:

Hi Julian, here is the patch that addresses you comments. Thanks

--
Added file: http://bugs.python.org/file46430/issue29182-patch3.diff

___
Python tracker 

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



[issue26355] Emit major version based canonical URLs for docs

2017-01-27 Thread Manuel Krebber

Manuel Krebber added the comment:

Sorry, I accidentally replied to the worng issue -.-

--

___
Python tracker 

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



[issue29377] Add the 'wrapper_descriptor' type to the types module

2017-01-27 Thread Manuel Krebber

Manuel Krebber added the comment:

I created the last patch without commiting, so maybe this one will work 
properly with the revision tool.

--
Added file: http://bugs.python.org/file46429/slot-wrapper-types.patch

___
Python tracker 

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



[issue26355] Emit major version based canonical URLs for docs

2017-01-27 Thread Manuel Krebber

Changes by Manuel Krebber :


Removed file: http://bugs.python.org/file46428/slot-wrapper-types.patch

___
Python tracker 

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



[issue26355] Emit major version based canonical URLs for docs

2017-01-27 Thread Manuel Krebber

Manuel Krebber added the comment:

I create the last diff without creating a commit, so maybe this one works 
better.

--
nosy: +Wheerd
Added file: http://bugs.python.org/file46428/slot-wrapper-types.patch

___
Python tracker 

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