[issue32074] Might be a wrong implementation

2017-11-19 Thread Sai Bhargava Ramu

New submission from Sai Bhargava Ramu :

https://docs.python.org/2/library/itertools.html#itertools.combinations

#The behaviour of combinations function in documentation is different and I 
think identation is missing with `else`
#I didn't get the logic right is point out anything further. This might not be 
a real issue

--
assignee: docs@python
components: Documentation
files: combinations.py
messages: 306499
nosy: Sai Bhargava Ramu, docs@python
priority: normal
severity: normal
status: open
title: Might be a wrong implementation
type: behavior
versions: Python 3.5
Added file: https://bugs.python.org/file47273/combinations.py

___
Python tracker 

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



[issue32074] Might be a wrong implementation

2017-11-19 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

The implementation in the documentation is correct. Did you tested your 
implementation?

The indentation of the "else" is correct. See 
https://docs.python.org/3/reference/compound_stmts.html#the-for-statement

--
nosy: +serhiy.storchaka
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue31808] tarfile.extractall fails to overwrite symlinks

2017-11-19 Thread Dong-hee Na

Change by Dong-hee Na :


--
pull_requests:  -4364

___
Python tracker 

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



[issue10761] tarfile.extractall fails to overwrite symlinks

2017-11-19 Thread Chris Albright

Change by Chris Albright :


--
components: +Unicode
nosy: +ezio.melotti, vstinner
type: behavior -> performance
versions: +Python 3.8

___
Python tracker 

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



[issue1102] Add support for _msi.Record.GetString() and _msi.Record.GetInteger()

2017-11-19 Thread Mark Lawrence

Change 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



[issue12202] Check status returns in msilib.SummaryInformation.GetProperty()

2017-11-19 Thread Mark Lawrence

Change 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



[issue31040] mimetypes.add_type should complain when you give it an undotted ext

2017-11-19 Thread Jim Jewett

Jim Jewett  added the comment:

Ideally, use .startswith('.') Instead if find, but this is a clear UI fix. 
First pull request fixes doc, second fixes code. OK to apply both.

--
nosy: +Jim.Jewett
stage:  -> commit review

___
Python tracker 

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



[issue1104] msilib.SummaryInfo.GetProperty() truncates the string by one character

2017-11-19 Thread Eric V. Smith

Eric V. Smith  added the comment:

Despite the fact that as of now (or 6+ years ago!) the only way to trigger the 
malloc() is via VT_LPSTR, I still think the way the free() call is written is 
bad. What if another type is added?

If that were fixed, I still think the basic idea of this patch in isolation of 
the other raised issues is a good idea. If it was converted to a PR, I'd 
support merging it (although I'd like to hear from the Windows folks).

But it is curious that this bug is so old and it hasn't caused more problems.

--

___
Python tracker 

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



[issue32022] Python crashes with mutually recursive code

2017-11-19 Thread Antoine Pitrou

Change by Antoine Pitrou :


--
nosy: +vstinner

___
Python tracker 

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



[issue32042] Option for comparing values instead of reprs in doctest

2017-11-19 Thread Jesse Bakker

Jesse Bakker  added the comment:

I think this would allow for inconsistency in docs (if implemented as 
suggested), as when actually running the code in the docs, one would get 
different results than suggested by the docs.

Maybe there is some other way (with different docs syntax) that would work 
well. Cannot think of anything from the top of my head, but maybe someone more 
creative can?

--
nosy: +Jesse Bakker

___
Python tracker 

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



[issue32042] Option for comparing values instead of reprs in doctest

2017-11-19 Thread Raymond Hettinger

Change by Raymond Hettinger :


--
nosy: +tim.peters

___
Python tracker 

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



[issue10049] Add a "no-op" (null) context manager to contextlib

2017-11-19 Thread Jesse Bakker

Change by Jesse Bakker :


--
versions: +Python 3.8 -Python 3.2

___
Python tracker 

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



[issue32042] Option for comparing values instead of reprs in doctest

2017-11-19 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

I recommend not going down this path.  The intended purpose of doctest is to 
test examples in documentation.  In particular, those examples should match 
what a user would *see* when running the examples.  In essence, the proposal is 
to allow tests to pass even when the examples *don't* match what the user sees.

ISTM, the str_fun() example *should* fail.  It does not show *any* real 
interactive prompt session than can be reproduced by a user or anything that a 
user would ever see.   IMO, that would be a documentation anti-pattern.

--
nosy: +rhettinger

___
Python tracker 

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



[issue32070] Clarify the behavior of the staticmethod builtin

2017-11-19 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

ISTM the current wording is correct and aims to describe how staticmethods 
differ from regular methods.   With a regular methods we have "c.m(*a) -> 
type(c).m(c, *a)" and "C.m(*a) -> C.m(*s)".  With a class method, only the 
first of those changes to "c.m(*a) -> type(c).m(*a)". Expressed in English, 
this change is "the instance is ignored except for its class...".

That said, the staticmethod() docs could use a complete rewrite.  They amble 
all over the place and don't directly speak to what a static method is for 
(attaching regular functions to classes to improve findability) or how they 
work (use descriptor logic to suppress the usual behavior of prepend "self" to 
the argument list when called from an instance) or a concise motivating example.

--
nosy: +rhettinger

___
Python tracker 

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



[issue10049] Add a "no-op" (null) context manager to contextlib

2017-11-19 Thread Jesse Bakker

Change by Jesse Bakker :


--
pull_requests: +4397
stage: needs patch -> patch review

___
Python tracker 

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



[issue10049] Add a "no-op" (null) context manager to contextlib

2017-11-19 Thread Jesse Bakker

Change by Jesse Bakker :


--
nosy: +Jesse Bakker

___
Python tracker 

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



[issue30904] Python 3 logging HTTPHandler sends duplicate Host header

2017-11-19 Thread Vinay Sajip

Change by Vinay Sajip :


--
keywords: +patch
pull_requests: +4398
stage:  -> patch review

___
Python tracker 

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



[issue30989] Sort only when needed in TimedRotatingFileHandler's getFilesToDelete

2017-11-19 Thread Roundup Robot

Change by Roundup Robot :


--
keywords: +patch
pull_requests: +4399
stage:  -> patch review

___
Python tracker 

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



[issue32042] Option for comparing values instead of reprs in doctest

2017-11-19 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

I concur with Raymond. Doctest should test the representation, not value.

But I think it would be nice to support insignificant variations of the 
representation. Tracebacks already are treated specially, and different doctest 
options allow to ignore particular details. Of course ignoring the whole 
content of the dictionary will be not very useful.

   >>> dict_fun() # doctest: +ELLIPSIS
   {...}

But maybe some option should make accepting some permutations in the output. 
E.g.

   >>> dict_fun() # doctest: +PERMUTATION
   {<'foo': 1>, <'bar': 2>}

should accept both "{'foo': 1, 'bar': 2}" and "{'bar': 2, 'foo': 1}".

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue30904] Python 3 logging HTTPHandler sends duplicate Host header

2017-11-19 Thread Vinay Sajip

Vinay Sajip  added the comment:


New changeset e96ba183c43ad6633b5d014b3dc57433e2802faf by Vinay Sajip in branch 
'master':
bpo-30904: Removed duplicated Host: header. (#4465)
https://github.com/python/cpython/commit/e96ba183c43ad6633b5d014b3dc57433e2802faf


--

___
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

2017-11-19 Thread Vinay Sajip

Change by Vinay Sajip :


--
resolution:  -> not a bug
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



[issue30904] Python 3 logging HTTPHandler sends duplicate Host header

2017-11-19 Thread Roundup Robot

Change by Roundup Robot :


--
pull_requests: +4400

___
Python tracker 

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



[issue30989] Sort only when needed in TimedRotatingFileHandler's getFilesToDelete

2017-11-19 Thread Vinay Sajip

Vinay Sajip  added the comment:


New changeset 65dffe58dd062385024eacbe75a0fa59ec12a993 by Vinay Sajip (Miss 
Islington (bot)) in branch '3.6':
bpo-30989: Sort in TimedRotatingFileHandler only when needed. (GH-2812) 
(GH-4466)
https://github.com/python/cpython/commit/65dffe58dd062385024eacbe75a0fa59ec12a993


--

___
Python tracker 

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



[issue32051] Possible issue in multiprocessing doc

2017-11-19 Thread Jason

Change by Jason :


--
keywords: +patch
pull_requests: +4401
stage: needs patch -> patch review

___
Python tracker 

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



[issue32051] Possible issue in multiprocessing doc

2017-11-19 Thread Jason

Jason  added the comment:

Hi Berker, 
   I didn't update "following examples with ``('', 5)`` too." because this 
is different than the previous one, this is client connecting to server, so 
hostname cannot be empty string.

--

___
Python tracker 

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



[issue32042] Option for comparing values instead of reprs in doctest

2017-11-19 Thread Tim Peters

Tim Peters  added the comment:

`doctest` is intended to be anal - there are few things more pointlessly 
confusing for a user than to see docs that don't match what they actually see 
when they run the doc's examples.  "Is it a bug?  Did I do it wrong?  Why can't 
they document what it actually does?! ..."

Things like +ELLIPSIS are intended for cases where the output is _known_ to 
vary across platforms or runs in ways that can't otherwise be easily hidden 
(like output that embeds the `id()` of an object), or where only a relatively 
tiny bit of enormous output is actually interesting.

When someone wants unittest's `assertEqual()`, they should use unittest ;-)  

Although that functionality is already easily handled; for example, here's the 
OP's first example rewritten to be independent of the dict's representation 
ordering:

>>> dict_fun() == {'foo': 1, 'bar': 2}
True

Now it's testing what you want to test:  that the results of the expressions on 
both sides of `==` compare equal.  And this is, to me, clearer on the face of 
it than introducing a new flag.

--

___
Python tracker 

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



[issue30904] Python 3 logging HTTPHandler sends duplicate Host header

2017-11-19 Thread Vinay Sajip

Vinay Sajip  added the comment:


New changeset b071a5e838a0e84c4e8a60448fbd40e8a7e5c882 by Vinay Sajip (Miss 
Islington (bot)) in branch '3.6':
bpo-30904: Removed duplicated Host: header. (GH-4465) (#4468)
https://github.com/python/cpython/commit/b071a5e838a0e84c4e8a60448fbd40e8a7e5c882


--

___
Python tracker 

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



[issue6156] Error compiling valid regex

2017-11-19 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

This issue was fixed in issue9179.

The issue with 65535 repeats was fixed in issue13169.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue32075] Expose ZipImporter Type Object in the include header files.

2017-11-19 Thread Decorater

New submission from Decorater :

I would like to make an C extension module which basically would have the 
ZipImporter type defined in the ``zipimport.c`` which defines most things 
related to ZipImporter to be public so that way one can set it to ``.tp_base`` 
on their C extension.

That should hopefully in the C side of things allow subclassing the zipimporter 
class outside of the Python layer as well. Otherwise I would have to manually 
copy the said definition from zipimport.c and that could be a huge risk if a 
bug or something in the ZipImporter was fixed that it wont automatically be 
fixed in the C version of the subclass. I want precisely this and for it to be 
exposed to other people who might want to subclass the zipimporter class 
outside of the Python layer as well.

--
components: Extension Modules, Interpreter Core, Library (Lib)
messages: 306513
nosy: Decorater
priority: normal
severity: normal
status: open
title: Expose ZipImporter Type Object in the include header files.
versions: Python 3.6, Python 3.7, Python 3.8

___
Python tracker 

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



[issue32076] Expose LockFile on Windows

2017-11-19 Thread Antoine Pitrou

New submission from Antoine Pitrou :

msvcrt.locking() is sometimes practically useless since its so-called 
"non-blocking" mode will still block for 1 second.  Instead, the Windows API 
LockFile() function (and its companion UnlockFile()) allows real non-blocking 
locking.

Right now you have to call LockFile() using ctypes (see 
https://github.com/mwilliamson/locket.py/pull/8/files for an example).  It 
would be nice to expose it somewhere, for example in msvcrt or another module.

--
components: Library (Lib), Windows
messages: 306514
nosy: paul.moore, pitrou, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: Expose LockFile on Windows
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



[issue32042] Option for comparing values instead of reprs in doctest

2017-11-19 Thread Tomáš Petříček

Tomáš Petříček  added the comment:

I find the idea of combining documentation with examples and unit testing 
appealing.
I see that this was not the original purpose of doctest but it seems to me as a 
reasonable use case for doctest.

>>> dict_fun() == {'foo': 1, 'bar': 2}
True
Testing equality with single expression has the drawback that one cannot see 
what was wrong, i.e., what the actual value was.
The result of such a test when it fails is very uninformative.

I am not sure that I know any Python developer who would be confused by 
"string" matching 'string', or {'a': 1, 'b': 2} matching dict(a=1, b=2).
Why True matching 1 is less confusing than "abc" matching 'abc'?

"there are few things more pointlessly confusing for a user than to see docs 
that don't match what they actually see when they run the doc's examples"
This is a bit tricky because what user actually sees very much depends on what 
console is used to run these examples, e.g., it varies between python and 
ipython, python and python3 etc.
So the users will be confused by these variants anyway.
Is it actually defined for basic types like str, dict or set, how the repr 
should look like (besides that it should be possible to "eval" the expression 
to get value)?

--

___
Python tracker 

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



[issue32075] Expose ZipImporter Type Object in the include header files.

2017-11-19 Thread Decorater

Change by Decorater :


--
keywords: +patch
pull_requests: +4402
stage:  -> patch review

___
Python tracker 

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



[issue30904] Python 3 logging HTTPHandler sends duplicate Host header

2017-11-19 Thread Vinay Sajip

Change by Vinay Sajip :


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



[issue30989] Sort only when needed in TimedRotatingFileHandler's getFilesToDelete

2017-11-19 Thread Vinay Sajip

Change by Vinay Sajip :


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



[issue25054] Capturing start of line '^'

2017-11-19 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
keywords: +patch
pull_requests: +4403
stage:  -> patch review

___
Python tracker 

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



[issue3262] re.split doesn't split with zero-width regex

2017-11-19 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
pull_requests: +4406

___
Python tracker 

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



[issue852532] ^$ won't split on empty line

2017-11-19 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
pull_requests: +4405

___
Python tracker 

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



[issue1647489] zero-length match confuses re.finditer()

2017-11-19 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
keywords: +patch
pull_requests: +4404
stage:  -> patch review

___
Python tracker 

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



[issue32075] Expose ZipImporter Type Object in the include header files.

2017-11-19 Thread Decorater

Change by Decorater :


--
type:  -> behavior

___
Python tracker 

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



[issue32077] Documentation: Some Unicode object functions don't indicate whether they return a new reference

2017-11-19 Thread Mathew M.

New submission from Mathew M. :

This is just something I've noticed when browsing the C API documentation for 
Unicode objects.

For example, the documentation entry for PyUnicode_DecodeMBCSStateful lacks the 
"Return value: New reference", etc.

--
assignee: docs@python
components: Documentation
messages: 306516
nosy: Mathew M., docs@python
priority: normal
severity: normal
status: open
title: Documentation: Some Unicode object functions don't indicate whether they 
return a new reference
type: enhancement

___
Python tracker 

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



[issue25054] Capturing start of line '^'

2017-11-19 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

PR 4471 fixes this issue, issue1647489, and a couple of similar issues.

The most visible change is the change in re.split(). This is compatibility 
breaking change, and it affects third-party code. But ValueError or 
FutureWarning were raised for patterns that will change the behavior in this PR 
for two Python releases, since Python 3.5. Developers had enough time for 
fixing them. In most cases this is so trivial as changing `*` to `+` in `\s*`.

Changes in sub(), findall(), and finditer() are less visible. No one existing 
test needs modification for them. Was:

>>> re.split(r"\b|:+", "a::bc")
/usr/lib/python3.6/re.py:212: FutureWarning: split() requires a non-empty 
pattern match.
  return _compile(pattern, flags).split(string, maxsplit)
['a:', 'bc']
>>> re.sub(r"\b|:+", "-", "a::bc")
'-a-:-bc-'
>>> re.findall(r"\b|:+", "a::bc")
['', '', ':', '', '']
>>> list(re.finditer(r"\b|:+", "a::bc"))
[<_sre.SRE_Match object; span=(0, 0), match=''>, <_sre.SRE_Match object; 
span=(1, 1), match=''>, <_sre.SRE_Match object; span=(2, 3), match=':'>, 
<_sre.SRE_Match object; span=(3, 3), match=''>, <_sre.SRE_Match object; 
span=(5, 5), match=''>]

Fixed:

>>> re.split(r"\b|:+", "a::bc")
['', 'a', '', 'bc', '']
>>> re.sub(r"\b|:+", "-", "a::bc")
'-a--bc-'
>>> re.findall(r"\b|:+", "a::bc")
['', '', '::', '', '']
>>> list(re.finditer(r"\b|:+", "a::bc"))
[, , , , ]

The behavior of re.split(), re.findall() and re.finditer() now is the same as 
in the regex module with the V1 flag. But the behavior of re.sub() left closer 
to the previous behavior, otherwise this would break existing tests. It is 
consistent with re.split() rather of re.findall() and re.finditer(). In regex 
with the V1 flag sub() is consistent with findall() and finditer(), but not 
with split().

--

___
Python tracker 

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



[issue32077] Documentation: Some Unicode object functions don't indicate whether they return a new reference

2017-11-19 Thread Mathew M.

Change by Mathew M. :


--
keywords: +patch
pull_requests: +4407
stage:  -> patch review

___
Python tracker 

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



[issue32077] Documentation: Some Unicode object functions don't indicate whether they return a new reference

2017-11-19 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

C API functions return new references by default. It needs to be explicitly 
documented only when the function returns a borrowed reference.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue32077] Documentation: Some Unicode object functions don't indicate whether they return a new reference

2017-11-19 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

Ah, you have changed just refcounts.dat! This is good.

--

___
Python tracker 

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



[issue32042] Option for comparing values instead of reprs in doctest

2017-11-19 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

Tomáš, thank you for the suggestion, but we're going to decline for the reasons 
mentioned elsewhere in this thread.

That said, it would be perfectly reasonable to post your own variant or 
extension on PyPI ( http://pypi.python.org ) to test the waters, to let the 
idea mature, and to see whether there is any uptake by the community.

--
resolution:  -> rejected
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



[issue32078] string result of str(bytes()) in Python3

2017-11-19 Thread Arno-Can Uestuensoez

New submission from Arno-Can Uestuensoez :

Hello,
I am currently writing some dual-version libraries and have
to deal with str/unicode.
The attached code example contains the str/unicode handling.

The Python3.6.2 release behaves as I did not expected for
all of the following the conversions:

  unicode = str  # @ReservedAssignment # it is intentional


  mystring = "abc"
  u0 = unicode(bytes(mystring.encode()))  # == str(mystring)

  mystring = "abc"
  u0 = unicode(bytes(mystring.encode('utf-8')))  # == str(mystring)

  mystring = "abc"
  u0 = unicode(bytes(mystring.encode('ascii')))  # == str(mystring)

  mystring = b"abc"
  u0 = unicode(mystring)  # == str(mystring)

results for Python3 in:

  type: 
  len:  6
  b'abc'

while in Python2:

  type: 
  len:  3
  abc

I am  not sure whether this is the intended behavior because the manual
could eventually be misinterpreted:


  4.8.1. Bytes Objects

  Bytes objects are immutable sequences of single bytes. 
  Since many major binary protocols are based on the ASCII text 
  encoding, bytes objects offer several methods that are only 
  valid when working with ASCII compatible data and are closely
  related to string objects in a variety of other ways.

class bytes([source[, encoding[, errors]]])

  Firstly, the syntax for bytes literals is largely the same as 
  that for string literals, except that a b prefix is added:

I expected the 'b'-prefix to be added to the input only, but I
expect the output without a type-prefix, because it is just an
attribute/property.

The result for Python3 should be similar to Python2:

  type: 
  len:  3
  abc

Regards
Arno

--
components: Unicode
files: source_and_output.tar.gz
messages: 306521
nosy: acue, ezio.melotti, vstinner
priority: normal
severity: normal
status: open
title: string result of str(bytes()) in Python3
type: behavior
versions: Python 3.6
Added file: https://bugs.python.org/file47274/source_and_output.tar.gz

___
Python tracker 

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



[issue32042] Option for comparing values instead of reprs in doctest

2017-11-19 Thread Tim Peters

Tim Peters  added the comment:

Tomáš, of course you can combine testing methods any way you like.  Don't 
oversell this - there's nothing actually magical about comparing objects 
instead of strings ;-)

I'm only -0 on this.  It grates a bit against doctest's original intents, but I 
appreciate it could be quite useful at times.

About the lack of showing the values when "expr1 == expr2" is false, I don't 
care.  I can't recall any case where, e.g., assertEqual() showing both values 
was actually helpful.  To the contrary, it more often filled the screen with 
giant reprs that were worse than useless.  By its very nature, doctest 
comparing against an explicit string encourages tests with brief output.  When 
a test fails, no matter how it's reported non-trivial work to repair it usually 
follows.  By far the most important part is knowing _what_ failed.

"True matching 1" is a case of practicality beats purity:  a wart for sure, but 
standing out precisely because it's the only wart of its kind.  I doubt most 
users are even aware of it, and it's certainly not something most users need to 
know.

About different shells, it _is_ jarring to people at first that formatting 
differs among them.  But since the differences show up on every single line of 
input and output, the differences quickly stop diluting attention.

About how much of repr() output is defined, not really all that much.  The 
purpose of doctest was never to accept any conceivable implementation that met 
the letter of the reference manual, but to capture the output CPython actually 
produced.  That was intentional.  Over time, I count it as a Good Thing that 
"but what about doctests out there?" has acted as a pressure against gratuitous 
changes in repr() outputs, and nudged other implementations to make "who 
cares?" output decisions that matched CPython's.  Every silly difference incurs 
various costs, and doctest did aim to make the existence of those costs visible 
at once.  It's a fact of life that relatively few users read the reference 
manual, let alone understand it - and I don't hate them for that ;-)

--

___
Python tracker 

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



[issue32075] Expose ZipImporter Type Object in the include header files.

2017-11-19 Thread Decorater

Decorater  added the comment:

Seems that now this is detected as an smelly symbol:

./python Tools/scripts/smelly.py
+ nm -p libpython3.7dm.a
Ignored symbol types: b, d, r, t
Smelly symbol: ZipImporter_Type (type: D)
ERROR: Found 1 smelly symbols!
make: *** [smelly] Error 1

I think I need to find a fix to this now.

--

___
Python tracker 

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



[issue32075] Expose ZipImporter Type Object in the include header files.

2017-11-19 Thread Decorater

Change by Decorater :


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



[issue32075] Expose ZipImporter Type Object in the include header files.

2017-11-19 Thread Decorater

Decorater  added the comment:

After looking in the smelly tool it seems that now I got to rename the _Type to 
ZipImporter to have the ``Py`` prefix. Since this will be a probable breaking 
change this might not be a good idea on backporting to 3.6.

--

___
Python tracker 

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



[issue32075] Expose ZipImporter Type Object in the include header files.

2017-11-19 Thread Decorater

Change by Decorater :


--
assignee:  -> docs@python
components: +Build, Documentation
nosy: +docs@python

___
Python tracker 

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



[issue31630] math.tan has poor accuracy near pi/2 on OpenBSD and NetBSD

2017-11-19 Thread Tim Peters

Tim Peters  added the comment:

Best I can tell, the fdlibm 5.3 on netlib was released in 2002, and essentially 
stopped existing as a maintained project then.  Everyone else copied the source 
code, and made their own changes independently ever since :-(  At least the 
folks behind the Julia language have made some effort to resurrect it as its 
own project:

http://openlibm.org/

Mark noted that GCC does use a different math library for tan() calls it can 
evaluate at compile-time.  That appears to have started in gcc 4.3:

https://gcc.gnu.org/gcc-4.3/changes.html#mpfropts

In any case ... are there are any test failures here on a _current_ 
OS/platform?  If it's only on out-of-date platforms, I'd be content to just 
suppress the failures on those.  Unless the number of affected systems is so 
large that their identifiers won't fit in a file ;-)

--

___
Python tracker 

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



[issue32079] version install 3.6.3 hangs in test_socket

2017-11-19 Thread Raúl Alvarez

New submission from Raúl Alvarez :

I'm trying to install python 3.6.3 from sources in Fedora 
3.19.8-100.fc20.x86_64+debug x86_64 GNU/Linux, I did ./configure, then run make 
as normal user and then as root, in these two cases the installation hangs over 
more than 6 hours with no progress in step 298/405: 

0:14:02 load avg: 1.32 [298/405] test_socket

I can interrupt the process pressing CTRL-C, then the screen shows me: 

test_subprocess test_sunau test_sundry test_super test_symbol
test_symtable test_syntax test_sys test_sys_setprofile
test_sys_settrace test_sysconfig test_syslog test_tarfile test_tcl
test_telnetlib test_tempfile test_textwrap test_thread
test_threaded_import test_threadedtempfile test_threading
test_threading_local test_threadsignals test_time test_timeit
test_timeout test_tix test_tk test_tokenize test_tools test_trace
test_traceback test_tracemalloc test_ttk_guionly test_ttk_textonly
test_tuple test_turtle test_typechecks test_typing test_ucn
test_unary test_unicode test_unicode_file
test_unicode_file_functions test_unicode_identifiers
test_unicodedata test_univnewlines test_unpack test_unpack_ex
test_urllib test_urllib2 test_urllib2_localnet test_urllib2net
test_urllib_response test_urllibnet test_urlparse test_userdict
test_userlist test_userstring test_utf8source test_uu test_uuid
test_venv test_wait3 test_wait4 test_warnings test_wave
test_weakref test_weakset test_webbrowser test_winconsoleio
test_winreg test_winsound test_with test_wsgiref test_xdrlib
test_xml_dom_minicompat test_xml_etree test_xml_etree_c
test_xmlrpc test_xmlrpc_net test_yield_from test_zipapp
test_zipfile test_zipfile64 test_zipimport test_zipimport_support
test_zlib

Total duration: 449 min 55 sec
Tests result: FAILURE
make: *** [profile-opt] Interrupción

--
components: Installation
messages: 306526
nosy: Raúl Alvarez
priority: normal
severity: normal
status: open
title: version install 3.6.3 hangs in test_socket
type: crash
versions: Python 3.6

___
Python tracker 

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



[issue32078] string result of str(bytes()) in Python3

2017-11-19 Thread Arno-Can Uestuensoez

Arno-Can Uestuensoez  added the comment:

Hello,
the following reduced example probably shows the issue a
little better.

I have currently not yet the 3.7+ environment, but guess
the same behavior.


Regards
Arno

--
versions: +Python 3.7, Python 3.8
Added file: https://bugs.python.org/file47275/howto_bytes_005.py

___
Python tracker 

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



[issue32078] string result of str(bytes()) in Python3

2017-11-19 Thread Arno-Can Uestuensoez

Arno-Can Uestuensoez  added the comment:

Sorry for the typo.

--
Added file: https://bugs.python.org/file47276/howto_bytes_005typo.py

___
Python tracker 

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



[issue32080] Error Installing Python 3.6.3 on ubuntu 16.04

2017-11-19 Thread Sachin Pathave

New submission from Sachin Pathave :

test failed when I run command $make test
FAILED (failures=1, skipped=1)
test test_re failed
2 tests failed again:
test_re test_venv

--
components: 2to3 (2.x to 3.x conversion tool)
files: test.Screenshot from 2017-11-20 11-12-41.png
messages: 306529
nosy: sachin
priority: normal
severity: normal
status: open
title: Error Installing Python 3.6.3 on ubuntu 16.04
type: resource usage
versions: Python 3.6
Added file: https://bugs.python.org/file47277/test.Screenshot from 2017-11-20 
11-12-41.png

___
Python tracker 

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



[issue31834] BLAKE2: the (pure) SSE2 impl forced on x86_64 is slower than reference

2017-11-19 Thread Christian Heimes

Change by Christian Heimes :


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



[issue32042] Option for comparing values instead of reprs in doctest

2017-11-19 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

> Although that functionality is already easily handled; for example, here's 
the OP's first example rewritten to be independent of the dict's representation 
ordering:
> >>> dict_fun() == {'foo': 1, 'bar': 2}
> 
> True

Oh, right. I remember the headache caused by dict order randomization, but 
forgot about this option. Currently doctests are rarely used in CPython tests.

--

___
Python tracker 

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



[issue31630] math.tan has poor accuracy near pi/2 on OpenBSD and NetBSD

2017-11-19 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

Do you consider the recent stable releases of  OpenBSD 6.1 (April 11, 2017) and 
NetBSD 7.1 (March 11, 2017) out-of-date platforms? The develop version of 
NetBSD 8 has the same failure.

--

___
Python tracker 

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