[issue34720] Fix test_importlib.test_bad_traverse for AIX

2018-09-18 Thread Michael Felt


Change by Michael Felt :


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

___
Python tracker 

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



[issue34659] Inconsistency between functools.reduce & itertools.accumulate

2018-09-18 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

The first issue, with ignoring initial=None, is complex because Argument Clinic 
and the inspect module don't support optional parameters without default value. 
It could be possible to use optional groups, but currently Argument Clinic 
supports optional groups only when all parameters are positional-only. For now, 
the only way is getting rid from Argument Clinic.

As for pickling/copying, this task is technically difficult, it but I don't see 
principal problems. The code is already complex (see issue25718) and will be 
more complex. Since the reduce protocol doesn't support keyword arguments, we 
will needs to use either partial() for passing the keyword argument, or chain() 
for imitating it by creating an equivalent object. I can write this code.

Taking to the account the complexity of the implementation and arguments 
against this feature (see issue25193 and the discussion on Python-ideas), is it 
worth to add it?

--

___
Python tracker 

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



[issue34663] Support POSIX_SPAWN_USEVFORK flag in posix_spawn

2018-09-18 Thread Ronald Oussoren


Ronald Oussoren  added the comment:

Good question. A comment on 

 says that glibc already uses vfork where appropriate, explicitly using the 
flag may not be necessary. 

Note that I haven't verified if the comment is correct.

--

___
Python tracker 

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



[issue34719] Deprecate set to frozenset conversion in set.__contains__

2018-09-18 Thread Javier Dehesa

New submission from Javier Dehesa :

This comes from this SO question: https://stackoverflow.com/q/52382983/1782792

Currently, this works:

> print({1, 2} in {frozenset({1, 2}))
# True

This is strange because set is unhashable. Apparently, it is a case-specific 
feature implemented back in 2003 
(https://github.com/python/cpython/commit/19c2d77842290af9b5f470c1eea2a71d1f77c9fe),
 by which set objects are converted to frozensets when checking for membership 
in another set. Personally I feel this is a bit surprising and inconsistent, 
but that is not the only issue with it. In the original implementation, this 
conversion was basically free because the created frozenset used the same 
storage as the given one. In the current implementation, however 
(https://github.com/python/cpython/blob/3.7/Objects/setobject.c#L1888-L1906), a 
new frozenset object is created, copied from the previous one. It seems this 
was done for thread-safety. The problem with that is that it is significantly 
more expensive:

s = set(range(10))
sf = frozenset(s)
t = { sf }
%timeit sf in t  # True
>>> 31.6 ns ± 1.04 ns per loop (mean ± std. dev. of 7 runs, 1000 loops 
each)
%timeit s in t  # True
>>> 4.9 ms ± 168 µs per loop (mean ± std. dev. of 7 runs, 100 loops each)

In the above case, using the conversion takes five order of magnitude more time 
than the regular check. I suppose there is a memory impact too.

I think this (as far as I know) undocumented feature does not provide a 
significant usability gain, is inconsistent with the documented behavior of set 
and gives rise to obscurely underperfoming code. Removing it would be a 
breaking change, but again, affected code would be relying on undocumented 
behavior (or even "against-documentation" behavior).

--
components: Interpreter Core
messages: 325631
nosy: Javier Dehesa
priority: normal
severity: normal
status: open
title: Deprecate set to frozenset conversion in set.__contains__
type: behavior
versions: Python 2.7, Python 3.4, Python 3.5, 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



[issue34720] Fix test_importlib.test_bad_traverse for AIX

2018-09-18 Thread Michael Felt


Change by Michael Felt :


--
title: Fix test_importlib for AIX -> Fix test_importlib.test_bad_traverse for 
AIX

___
Python tracker 

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



[issue34719] Deprecate set to frozenset conversion in set.__contains__

2018-09-18 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +xtreak

___
Python tracker 

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



[issue33649] asyncio docs overhaul

2018-09-18 Thread Yury Selivanov


Change by Yury Selivanov :


--
pull_requests: +8813

___
Python tracker 

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



[issue34597] Python needs to check existence of functions at runtime for targeting older macOS platforms

2018-09-18 Thread Ronald Oussoren


Ronald Oussoren  added the comment:

@Zorg: you don't need to sell the usefulness of this functionality. Its just 
that the python developers are volunteers and hence have limited time to work 
on python.

--

___
Python tracker 

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



[issue34663] Support POSIX_SPAWN_USEVFORK flag in posix_spawn

2018-09-18 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

If glibc already uses vfork() if it is safe, I suppose that using vfork() in 
other cases is unsafe, and we shouldn't support this nonstandard option.

--

___
Python tracker 

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



transform a "normal" decorator in one for async functions

2018-09-18 Thread vito . detullio
Hi.

Let's say I have this library that expose a decorator; it's meant to be used 
with normal functions.

but I have to "apply" the decorator to an async function.
>From what I understand I cannot "really" wait for this decorated async 
>function, as it's not really "async", and, from a simple test I made, I see 
>that the order of execution is not really "straight" (I have simplifield the 
>example to the bone)

import asyncio

def deco(fun): # the "classic" decorator
def wrap(*args, **kwargs):
print('wrap begin')
try:
return fun(*args, **kwargs)
finally:
print('wrap end')
return wrap

@deco
async def decorated_async():
print('a')
await asyncio.sleep(1)
print('b')


loop = asyncio.get_event_loop()
loop.run_until_complete(decorated_async())
loop.close()

the output of this script is

wrap begin
wrap end
a
b

while an "async-aware" decorator (with an "async" wrap that "await"s the fun 
call) would print the "wrap end" line at the end.

I can easily rewrite my dumb decorator to handle async functions (I can just 
make an "async def wrap" and "return await fun"), but I cannot rewrite this 
library.

is there a way to "convert" a "normal" decorator in one that can handle async 
functions?

Thanks
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue34597] Python needs to check existence of functions at runtime for targeting older macOS platforms

2018-09-18 Thread Zorg


Zorg  added the comment:

I understand that. I was mainly responding to a question that was asked with 
information I felt was important to provide.

--

___
Python tracker 

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



[issue31635] test_strptime failure on OpenBSD

2018-09-18 Thread Paul Ganssle


Paul Ganssle  added the comment:

Bug reported to BSD here: 
https://marc.info/?l=openbsd-bugs=153728102618747=2

--

___
Python tracker 

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



[issue25825] AIX shared library extension modules installation broken

2018-09-18 Thread Michael Felt


Michael Felt  added the comment:

On 10/08/2016 17:22, David Edelsohn wrote:
> David Edelsohn added the comment:
Hi, Just thought I would mention that I have a branch with all the test
PR fixes I have made in the last two months.

a) would appreciate your testig them with gcc - to be sure all is good
there as well.
b) If all test also pass for you - maybe if you make a bit of noise
python may be a bit quicker to actually merge them.

Hope this helps (AIX :) )

Michael

Links:
https://github.com/python/cpython/pulls?q=is%3Apr+is%3Aopen+AIX+author%3Aaixtools
https://github.com/aixtools/cpython/tree/aix-pr

--
title: AIX shared library extension modules installation broken: wrong dir 
names -> AIX shared library extension modules installation broken

___
Python tracker 

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



[issue32557] allow shutil.disk_usage to take a file path on Windows also

2018-09-18 Thread Joe Pamer


Joe Pamer  added the comment:

Got it - thanks! That sounds good to me, so I'll take a look at how other 
functions are working around MAX_PATH and update the diff to also avoid the 
copy when possible.

--

___
Python tracker 

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



[issue34663] Support POSIX_SPAWN_USEVFORK flag in posix_spawn

2018-09-18 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

The documentation says:

 The child process is created using vfork(2) instead of fork(2) when
   either of the following is true:

   *  the spawn-flags element of the attributes object pointed to by
  attrp contains the GNU-specific flag POSIX_SPAWN_USEVFORK; or

   *  file_actions is NULL and the spawn-flags element of the attributes
  object pointed to by attrp does not contain
  POSIX_SPAWN_SETSIGMASK, POSIX_SPAWN_SETSIGDEF,
  POSIX_SPAWN_SETSCHEDPARAM, POSIX_SPAWN_SETSCHEDULER,
  POSIX_SPAWN_SETPGROUP, or POSIX_SPAWN_RESETIDS.

So using the flag is necessary if you want to force the use of vfork when 
passing any of the flags specified in the second point.

--

___
Python tracker 

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



[issue17239] XML vulnerabilities in Python

2018-09-18 Thread STINNER Victor


STINNER Victor  added the comment:

> Who normally updates the vendored libexpat?

I made the 3 latest libexpat updates, and each of them was painful :-)

My notes on vendored libraries:
https://pythondev.readthedocs.io/cpython.html#vendored-external-libraries

I wrote a tool to get the version of all vendored libraries, and a script to 
updated libexpat.

--

___
Python tracker 

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



[issue34542] [TLS] Update test certs to future proof settings

2018-09-18 Thread Christian Heimes


Change by Christian Heimes :


--
pull_requests: +8820

___
Python tracker 

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



[issue34659] Inconsistency between functools.reduce & itertools.accumulate

2018-09-18 Thread Kristján Valur Jónsson

Kristján Valur Jónsson  added the comment:

I think I'll pass Raymond, its been so long since I've contributed, in the mean 
time there is github and argument clinic and whatnot so I'm out of training.  
I´m lurking around these parts and maybe shall return one day :)

--

___
Python tracker 

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



[issue34663] Support POSIX_SPAWN_USEVFORK flag in posix_spawn

2018-09-18 Thread STINNER Victor


STINNER Victor  added the comment:

Serhiy Storchaka: "If this is an optimization, what is the downside of always 
using vfork()?"

I don't know the vfork() function, but you can find articles like:
"vfork considered dangerous" (old article of 2012)
https://ewontfix.com/7/

But it's unclear to me if vfork() drawbacks also affect posix_spawn(). 
posix_spawn() is well defined: call vfork() and then immediately exec().

Another article:

"First is that vfork pauses the parent thread while the child executes and 
eventually calls an exec family function, this is a huge latency problem for 
applications."

https://developers.redhat.com/blog/2015/08/19/launching-helper-process-under-memory-and-latency-constraints-pthread_create-and-vfork/

--

___
Python tracker 

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



[issue34722] Non-deterministic bytecode generation

2018-09-18 Thread Peter Ebden


New submission from Peter Ebden :

We've found that the following code produces non-deterministic bytecode,
even post PEP-552:

def test(x):
if x in {'ONE', 'TWO', 'THREE'}:
pass

It's not too hard to test it:

$ python3.7 -m compileall --invalidation-mode=unchecked-hash test.py
Compiling 'test.py'...
$ sha1sum __pycache__/test.cpython-37.pyc
61e5682ca95e8707b4ef2a79f6454dafd800  __pycache__/test.cpython-37.pyc
$ rm __pycache__/test.cpython-37.pyc
$ python3.7 -m compileall --invalidation-mode=unchecked-hash test.py
Compiling 'test.py'...
$ sha1sum __pycache__/test.cpython-37.pyc
222a06621b491879e5317b34e9dd715bacd89b7d  __pycache__/test.cpython-37.pyc

It looks like the peephole optimiser is converting the LOAD_CONST instructions
for the set into a single LOAD_CONST for a frozenset which then serialises in
nondeterministic order. One can hence work around it by setting PYTHONHASHSEED
to a known value.

I'm happy to help out with this if needed, although I don't have a lot of
familiarity with the relevant code.

--
components: Interpreter Core
messages: 325644
nosy: Peter Ebden
priority: normal
severity: normal
status: open
title: Non-deterministic bytecode generation
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



[issue34723] lower() on Turkish letter "İ" returns a 2-chars-long string

2018-09-18 Thread Dogan

New submission from Dogan :

Hey there,

I believe I've come across a bug. It occurs when you try to lower() the Turkish 
uppercase letter "İ". Gonna explain it with example code since it's easier:

>>> len("Ş")
1
>>> len("Ş".lower())
1
>>> len("Ğ")
1
>>> len("Ğ".lower())
1
>>> len("Ö")
1
>>> len("Ö".lower())
1
>>> len("Ç")
1
>>> len("Ç".lower())
1
>>> len("İ")
1
>>> len("İ".lower())
2

When you lower() the Turkish uppercase letter “İ”, it returns a 2 chars long 
string with the first character being “i”, and the second being chr(775).

Should it not simply return “i”?

--
components: Unicode
messages: 325646
nosy: ezio.melotti, vstinner, zamsalak
priority: normal
severity: normal
status: open
title: lower() on Turkish letter "İ" returns a 2-chars-long string
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



[issue34663] Support POSIX_SPAWN_USEVFORK flag in posix_spawn

2018-09-18 Thread Ronald Oussoren


Ronald Oussoren  added the comment:

vfork() is more dangerous than fork() because the parent and child processes 
share memory (not copy-on-write, but really the same memory). Whether or not 
this affects posix_spawn depends on its implementation (to give a very vague 
statement).

Glibc already uses vfork() in a number of cases, I'd expect that those are the 
cases where it is safe to use vfork() in the implementation of posix_spawn in 
the context of glibc.  I'd therefore carefully test the use of vfork() in other 
cases to make sure those don't affect the parent process.

--

___
Python tracker 

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



[issue17239] XML vulnerabilities in Python

2018-09-18 Thread Christian Heimes


Christian Heimes  added the comment:

> * only Windows and macOS will get the fix

Modules/expat can be used on all platforms. A downstream patch is only a 
problem for platforms that compile Python with "./configure 
--with-system-expat".

The security fixes for entity expansion blowup and external entity loading are 
backwards incompatible fixes. Technically they also violate XML standards. In 
practice the vast majority of users will never run into the issue, because 
external entities are scarcely used. The expat parser is a non-validating XML 
parser, so DTDs aren't useful at all. I'd rather break a handful of users than 
to keep the majority of users vulnerable.

To fix billion laughs and quadratic blowup once and for all, we also have to 
break backwards compatibility and require expat >= 2.3.0. For now the modules 
still work with old versions of expat. IMO it's fine. Vendors either have to 
update their libraries or use our copy of expat.

Ultimately it's Benjamin's, Larry's, and Ned's decision. They are release 
managers.

--

___
Python tracker 

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



[issue34723] lower() on Turkish letter "İ" returns a 2-chars-long string

2018-09-18 Thread STINNER Victor

STINNER Victor  added the comment:

> Should it not simply return “i”?

Python implements the Unicode standard.

>>> "U+%04x" % ord("İ")
'U+0130'
>>> ["U+%04x" % ord(ch) for ch in "İ".lower()]
['U+0069', 'U+0307']

>>> unicodedata.name("İ")
'LATIN CAPITAL LETTER I WITH DOT ABOVE'
>>> [unicodedata.name(ch) for ch in "İ".lower()]
['LATIN SMALL LETTER I', 'COMBINING DOT ABOVE']

At the C level(), lower_ucs4() calls _PyUnicode_ToLowerFull() which lookup into 
Python internal Unicode database.

U+0130 character enters the EXTENDED_CASE_MASK case: use 
_PyUnicode_ExtendedCase secondary database for "extended case".

Well, at the end, Python uses the following data file from the Unicode standard:

https://www.unicode.org/Public/9.0.0/ucd/SpecialCasing.txt

Extract:
"""
# Preserve canonical equivalence for I with dot. Turkic is handled below.

0130; 0069 0307; 0130; 0130; # LATIN CAPITAL LETTER I WITH DOT ABOVE
"""


If you want to convert strings differently for the special case of Turkish, you 
need to use a different standard than Unicode...

I close the issue as NOT A BUG.

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



[issue34702] urlopen doesn't handle query strings with "file" scheme

2018-09-18 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +xtreak

___
Python tracker 

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



[issue34623] _elementtree.c doesn't call XML_SetHashSalt()

2018-09-18 Thread miss-islington


Change by miss-islington :


--
pull_requests: +8817

___
Python tracker 

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



[issue34623] _elementtree.c doesn't call XML_SetHashSalt()

2018-09-18 Thread miss-islington


Change by miss-islington :


--
pull_requests: +8816

___
Python tracker 

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



[issue34623] _elementtree.c doesn't call XML_SetHashSalt()

2018-09-18 Thread Christian Heimes


Christian Heimes  added the comment:

Since it's a security fix, the change should land in 3.4 and 3.5, too.

--
versions: +Python 2.7, Python 3.4, Python 3.5

___
Python tracker 

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



[issue34623] _elementtree.c doesn't call XML_SetHashSalt()

2018-09-18 Thread Christian Heimes


Change by Christian Heimes :


--
pull_requests: +8818

___
Python tracker 

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



[issue21109] tarfile: Traversal attack vulnerability

2018-09-18 Thread Tal Einat


Tal Einat  added the comment:

I am not a lawyer, but to the best of my understanding, using such tarballs 
would be fine.  Since Jakub's repo only provides code to generate archive files 
but doesn't include actual archive files, and the generation code is licensed 
via the MIT license, we are free to use the code to generate archive files, 
which would then not fall under the copyright of the author of the generation 
code (Jakub).

--

___
Python tracker 

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



[issue34721] json module loads function

2018-09-18 Thread zack


New submission from zack :

the json.loads function think a string variable is a json type, but the 
variable is "123"

--
components: Library (Lib)
files: json_test.py
messages: 325639
nosy: jaihong
priority: normal
severity: normal
status: open
title: json module loads function
type: behavior
versions: Python 3.5
Added file: https://bugs.python.org/file47813/json_test.py

___
Python tracker 

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



[issue34623] _elementtree.c doesn't call XML_SetHashSalt()

2018-09-18 Thread miss-islington


miss-islington  added the comment:


New changeset cb5778f00ce48631c7140f33ba242496aaf7102b by Miss Islington (bot) 
(Christian Heimes) in branch 'master':
bpo-34623: Use XML_SetHashSalt in _elementtree (GH-9146)
https://github.com/python/cpython/commit/cb5778f00ce48631c7140f33ba242496aaf7102b


--
nosy: +miss-islington

___
Python tracker 

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



[issue34623] _elementtree.c doesn't call XML_SetHashSalt()

2018-09-18 Thread miss-islington


miss-islington  added the comment:


New changeset 470a435f3b42c9be5fdb7f7b04f3df5663ba7305 by Miss Islington (bot) 
in branch '3.7':
bpo-34623: Use XML_SetHashSalt in _elementtree (GH-9146)
https://github.com/python/cpython/commit/470a435f3b42c9be5fdb7f7b04f3df5663ba7305


--

___
Python tracker 

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



[issue34623] _elementtree.c doesn't call XML_SetHashSalt()

2018-09-18 Thread miss-islington


miss-islington  added the comment:


New changeset 18b20bad75b4ff0486940fba4ec680e96e70f3a2 by Miss Islington (bot) 
(Christian Heimes) in branch '2.7':
[2.7] bpo-34623: Use XML_SetHashSalt in _elementtree (GH-9146) (GH-9394)
https://github.com/python/cpython/commit/18b20bad75b4ff0486940fba4ec680e96e70f3a2


--

___
Python tracker 

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



[issue34623] _elementtree.c doesn't call XML_SetHashSalt()

2018-09-18 Thread miss-islington


miss-islington  added the comment:


New changeset f7666e828cc3d5873136473ea36ba2013d624fa1 by Miss Islington (bot) 
in branch '3.6':
bpo-34623: Use XML_SetHashSalt in _elementtree (GH-9146)
https://github.com/python/cpython/commit/f7666e828cc3d5873136473ea36ba2013d624fa1


--

___
Python tracker 

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



[issue31635] test_strptime failure on OpenBSD

2018-09-18 Thread Paul Ganssle


Paul Ganssle  added the comment:

I do think this is an active bug in OpenBSD's ISO calculations, here: 
https://github.com/openbsd/src/blob/b66614995ab119f75167daaa7755b34001836821/lib/libc/time/wcsftime.c#L326

I re-created this algorithm in Python and at the beginning of the year it gives 
the wrong answer at the beginning of the year in about 50% of years. I have 
spent some time trying to understand the way the algorithm is *supposed* to 
work, but I don't totally understand what it's doing. I'll report this to 
OpenBSD.

--

___
Python tracker 

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



[issue34721] json module loads function

2018-09-18 Thread Ammar Askar


Ammar Askar  added the comment:

This is intentional, the parsed in JSON doesn't necessarily have to have an 
object at the root. This is also what allows you to do:

>>> json.loads("[]")
[]

This behavior is also consistent with browsers, try this in your browser's dev 
console:

> JSON.parse("123")
123
> JSON.parse('"123"')
"123"
> JSON.parse('[]')
[]

More technically, look at the JSON standard here: https://www.json.org/

As you can see, the root value is an "element", which is of type "value" 
surrounded by some whitespace. Values can be any of these:

value
object
array
string
number
"true"
"false"
"null"

--
nosy: +ammar2
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



[issue34542] [TLS] Update test certs to future proof settings

2018-09-18 Thread Christian Heimes


Change by Christian Heimes :


--
pull_requests: +8819

___
Python tracker 

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



Permutations using a recursive generator

2018-09-18 Thread ast

Hello

I found a smart and very concise code to
generate all permutations of a list.
I put it here if someone is interested to
figure out how it works


def permut(li, prefix=[]):

if len(li)==1:
yield prefix + li
else:
for elt in li:
li2 = li.copy()
li2.remove(elt)
yield from S(li2, prefix+[elt])


exemple of usage

>>> list(permut(['a', 'b', 'c']))
[['a', 'b', 'c'], ['a', 'c', 'b'], ['b', 'a', 'c'], ['b', 'c', 'a'], 
['c', 'a', 'b'], ['c', 'b', 'a']]


>>> list(permut([0,1,2,3]))
[[0, 1, 2, 3], [0, 1, 3, 2], [0, 2, 1, 3], [0, 2, 3, 1], [0, 3, 1, 2], 
[0, 3, 2, 1], [1, 0, 2, 3], [1, 0, 3, 2], [1, 2, 0, 3], [1, 2, 3, 0], 
[1, 3, 0, 2], [1, 3, 2, 0], [2, 0, 1, 3], [2, 0, 3, 1], [2, 1, 0, 3], 
[2, 1, 3, 0], [2, 3, 0, 1], [2, 3, 1, 0], [3, 0, 1, 2], [3, 0, 2, 1], 
[3, 1, 0, 2], [3, 1, 2, 0], [3, 2, 0, 1], [3, 2, 1, 0]]

--
https://mail.python.org/mailman/listinfo/python-list


[issue25825] AIX shared library extension modules installation broken

2018-09-18 Thread Michael Felt


Michael Felt  added the comment:

On 18/09/2018 16:46, Michael Felt wrote:
> Michael Felt  added the comment:

Ignore this. If only I could remove stuff!

Good day all.

--

___
Python tracker 

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



Re: Permutations using a recursive generator

2018-09-18 Thread ast

Le 18/09/2018 à 17:01, ast a écrit :

error: permut instead of S


     yield from permut(li2, prefix+[elt])

--
https://mail.python.org/mailman/listinfo/python-list


<    1   2