[issue31544] gettext.Catalog title is not flagged as a class

2018-03-23 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
Removed message: https://bugs.python.org/msg314357

___
Python tracker 

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



[issue31455] ElementTree.XMLParser() mishandles exceptions

2018-03-23 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


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



[issue31544] gettext.Catalog title is not flagged as a class

2018-03-23 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:


New changeset 0694b6a651ba2a53f6323ffb3b23358f43885815 by Serhiy Storchaka 
(scoder) in branch '2.7':
bpo-31544: Avoid calling "PyObject_GetAttrString()" (and potentially executing 
user code) with a live exception set. (GH-3992)
https://github.com/python/cpython/commit/0694b6a651ba2a53f6323ffb3b23358f43885815


--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue33006] docstring of filter function is incorrect

2018-03-23 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
nosy: +ncoghlan, rhettinger

___
Python tracker 

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



[issue33130] functools.reduce signature/docstring discordance

2018-03-23 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
nosy: +ncoghlan, rhettinger
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



[issue33096] ttk.Treeview.insert() does not allow to insert item with "False" iid

2018-03-23 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

I have tested -- omitting the option and passing an empty string are treated 
different in Tk. Passing a duplicate iid is error. Thus the fix should be just 
`iid is not None`. But needed tests.

--
keywords: +easy
stage:  -> needs patch

___
Python tracker 

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



Re: Since when builtin dict preserve key order?

2018-03-23 Thread Chris Angelico
On Sat, Mar 24, 2018 at 3:34 PM, Arkadiusz Bulski  wrote:
> I already asked on PYPY and they confirmed that any version of pypy,
> including 2.7, has dict preserving insertion order. I am familiar with
> ordered **kw which was introduced in 3.6 but I also heard that builtin dict
> preserves order since 3.5. Is that true?
>

I don't think 3.5 had it. According to the tracker, it landed in 3.6:

https://bugs.python.org/issue27350

But yes, current versions of CPython preserve insertion order.

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


Since when builtin dict preserve key order?

2018-03-23 Thread Arkadiusz Bulski
I already asked on PYPY and they confirmed that any version of pypy,
including 2.7, has dict preserving insertion order. I am familiar with
ordered **kw which was introduced in 3.6 but I also heard that builtin dict
preserves order since 3.5. Is that true?

-- 
~ Arkadiusz Bulski
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue33119] python sys.argv argument parsing not clear

2018-03-23 Thread Nick Coghlan

Nick Coghlan  added the comment:

This is deliberate, and is covered in the documentation at 
https://docs.python.org/3/using/cmdline.html#cmdoption-m where it says 'If this 
option is given, the first element of sys.argv will be the full path to the 
module file (while the module file is being located, the first element will be 
set to "-m").'

The part in parentheses is the bit that's applicable here.

We've not going to change that, as the interpreter startup relies on checking 
sys.argv[0] for "-m" and "-c" in order to work out how it's expected to handle 
sys.path initialization.

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



[issue22257] PEP 432: Redesign the interpreter startup sequence

2018-03-23 Thread Nick Coghlan

Nick Coghlan  added the comment:

Aye, this is the issue for making the API public, so it will stay open until 
PEP 432 is actually accepted.

We switched to the pre-implement-changes-as-an-internal-CPython-refactoring 
approach after we/I realised there was no feasible way to develop and maintain 
these an out of tree feature branch (with the early pay-off from the change in 
approach being the feasibility of implementing 3.7 changes like UTF-8 mode).

--
versions: +Python 3.8 -Python 3.7

___
Python tracker 

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



[issue32968] Fraction modulo infinity should behave consistently with other numbers

2018-03-23 Thread Elias Zamaria

Elias Zamaria  added the comment:

Mark, you have some good points. I didn't fully think about the implications of 
my change. I undid the change to _operator_fallbacks.

I updated the tests to expect 1.0 // 1/10 to equal 9.0 and 1.0 % 1/10 to equal 
0.09995. That latter number seems a bit awkward though. Can I 
expect the result to always come out like that, or could it depend on the 
hardware the test is run on? If we can't depend on that result, do you have any 
suggestions?

--

___
Python tracker 

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



[issue33121] recv returning 0 on closed connection not documented

2018-03-23 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

Please make a specific suggestion for a change in a specific location in the 
current online version of a particular doc -- the one you wish had been there 
already.

--
nosy: +terry.reedy

___
Python tracker 

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



[issue33120] infinite loop in inspect.unwrap(unittest.mock.call)

2018-03-23 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

Peter, please include x.y.z version with reports (and upgrade first if possible 
;-).  This was apparently fixed in #25532 last year for current versions.  With 
3.6.4 and 3.7.0b2 I get
Traceback (most recent call last):
  File "F:\Python\a\tem2.py", line 3, in 
print(inspect.unwrap(unittest.mock.call))
  File "C:\Programs\Python37\lib\inspect.py", line 515, in unwrap
raise ValueError('wrapper loop when unwrapping {!r}'.format(f))
ValueError: wrapper loop when unwrapping call

--
nosy: +terry.reedy
resolution:  -> out of date
stage:  -> resolved
status: open -> closed
superseder:  -> infinite loop when running inspect.unwrap over 
unittest.mock.call

___
Python tracker 

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



[issue33119] python sys.argv argument parsing not clear

2018-03-23 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

Two of your 3 suggested alternatives could lead to bugs. To use your example:
 python -m mainmodule.submodule.foobar -o -b
is a convenient alternative and abbreviation for
 python .../somedir/mainmodule/submodule/foobar.py -o -b
The two invocations should give equivalent results and to the extent possible 
the same result.

[What might be different is the form of argv[0].  In the first case, argv[0] 
will be the "preferred" form of the path to the python file while in the 
second, it will be whatever is given.  On Windows, the difference might look 
like 'F:\\Python\\a\\tem2.py' versus 'f:/python/a/tem2.py']

Unless __init__.py does some evil monkeypatching, it cannot affect the main 
module unless imported directly or indirectly.  So its behavior should be the 
same whether imported before or after execution of the main module.  This means 
that argv must be the same either way (except for argv[0]).  So argv[0:2] must 
be condensed to one arg before executing __init__.  I don't see that '' is an 
improvement over '-m'.

Command line arguments are intended for the invoked command.  An __init__.py 
file is never the command unless invoked by its full path: "python 
somepath/__init__.py".  In such a case, sys.argv access should be within a 
"__name__ == '__main__':" clause or a function called therein.

--
nosy: +terry.reedy
versions:  -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



[issue22257] PEP 432: Redesign the interpreter startup sequence

2018-03-23 Thread Ned Deily

Ned Deily  added the comment:

See Issue33128: PathFinder is twice on sys.meta_path.

Also, is this issue supposed to remain open across releases?

--
nosy: +ned.deily

___
Python tracker 

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



[issue33128] PathFinder is twice on sys.meta_path

2018-03-23 Thread Ned Deily

Ned Deily  added the comment:

Thanks for the report.  git bisect result:

1abcf6700b4da6207fe859de40c6c1bada6b4fec is the first bad commit
commit 1abcf6700b4da6207fe859de40c6c1bada6b4fec
Author: Eric Snow 
Date:   Tue May 23 21:46:51 2017 -0700

bpo-22257: Private C-API for core runtime initialization (PEP 432). (#1772)

(patch by Nick Coghlan)

--
nosy: +eric.snow, ncoghlan, ned.deily
stage:  -> needs patch
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



[issue33023] Unable to copy ssl.SSLContext

2018-03-23 Thread Vitaly Kruglikov

Vitaly Kruglikov  added the comment:

It would be very helpful to make a statement in SSLContext's documentation to 
the effect that it's not copyable. This is frankly the first time I run into a 
non-copyable object.I spend quite a bit of time researching this after 
implementing a copying strategy that failed. It would have saved me (and 
others...) so much time is there was a warning in SSLContext documentation 
about not being able to serialize/copy/deepcopy by design!

Also, making that exception message more generic (ha, I wasn't pickling 
anything?!) as Serhiy Storchaka suggested would be a welcome addition, but not 
replacement for documentation.

--

___
Python tracker 

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



[issue33129] Add kwarg-only option to dataclass

2018-03-23 Thread Eric V. Smith

Eric V. Smith  added the comment:

Changing this to 3.8: there's not enough time to add this to 3.7.

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



[issue33129] Add kwarg-only option to dataclass

2018-03-23 Thread Eric V. Smith

Change by Eric V. Smith :


--
assignee:  -> eric.smith

___
Python tracker 

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



Re: Putting Unicode characters in JSON

2018-03-23 Thread Chris Angelico
On Sat, Mar 24, 2018 at 11:11 AM, Steven D'Aprano
 wrote:
> On Fri, 23 Mar 2018 07:46:16 -0700, Tobiah wrote:
>
>> If I changed my database tables to all be UTF-8 would this work cleanly
>> without any decoding?
>
> Not reliably or safely. It will appear to work so long as you have only
> pure ASCII strings from the database, and then crash when you don't:
>
> py> text_from_database = u"hello wörld".encode('latin1')
> py> print text_from_database
> hello w�rld
> py> json.dumps(text_from_database)
> Traceback (most recent call last):
>   File "", line 1, in 
>   File "/usr/local/lib/python2.7/json/__init__.py", line 231, in dumps
> return _default_encoder.encode(obj)
>   File "/usr/local/lib/python2.7/json/encoder.py", line 195, in encode
> return encode_basestring_ascii(o)
> UnicodeDecodeError: 'utf8' codec can't decode byte 0xf6 in position 7:
> invalid start byte
>

If the database has been configured to use UTF-8 (as mentioned, that's
"utf8mb4" in MySQL), you won't get that byte sequence back. You'll get
back valid UTF-8. At least, if ever you don't, that's a MySQL bug, and
not your fault. So yes, it WILL work cleanly. Reliably and safely.

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


Re: Putting Unicode characters in JSON

2018-03-23 Thread Steven D'Aprano
On Fri, 23 Mar 2018 07:46:16 -0700, Tobiah wrote:

> If I changed my database tables to all be UTF-8 would this work cleanly
> without any decoding?

Not reliably or safely. It will appear to work so long as you have only 
pure ASCII strings from the database, and then crash when you don't:

py> text_from_database = u"hello wörld".encode('latin1')
py> print text_from_database
hello w�rld
py> json.dumps(text_from_database)
Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/local/lib/python2.7/json/__init__.py", line 231, in dumps
return _default_encoder.encode(obj)
  File "/usr/local/lib/python2.7/json/encoder.py", line 195, in encode
return encode_basestring_ascii(o)
UnicodeDecodeError: 'utf8' codec can't decode byte 0xf6 in position 7: 
invalid start byte


> Whatever people are doing to get these characters
> in, whether it's foreign keyboards, or fancy escape sequences in the web
> forms, would their intended characters still go into the UTF-8 database
> as the proper characters? Or now do I have to do a conversion on the way
> in to the database?

There is no way to answer that, because it depends on how you are getting 
the characters, what you are doing to them, and how you put them in the 
database.

In the best possible scenario, your process is:

- user input comes in as UTF-8;
- you store it in the database;
- which converts it to Latin-1 (sometimes losing data: see below)

in which case, changing the database field to utf8mb4 (NOT plain utf8, 
thanks to a ludicrously idiotic design flaw in MySQL utf8 is not actually 
utf8) should work nicely.

I mentioned losing data: if your user enters, let's say the Greek letters 
'αβγ' (or emojis, or any of about a million other characters) then Latin1 
cannot represent them. Presumably your database is throwing them away:


py> s = 'αβγ'  # what the user wanted
py> db = s.encode('latin-1', errors='replace')  # what the database 
recorded
py> json.dumps(db.decode('latin-1'))  # what you end up with
'"???"'


Or, worse, you're getting moji-bake:

py> s = 'αβγ'  # what the user wanted
py> json.dumps(s.encode('utf-8').decode('latin-1'))
'"\\u00ce\\u00b1\\u00ce\\u00b2\\u00ce\\u00b3"'



> We also get import data that often comes in .xlsx format.  What encoding
> do I get when I dump a .csv from that?  Do I have to ask the sender?  I
> already know that they don't know.

They never do :-(

In Python 2, I believe the CSV module will assume ASCII-plus-random-crap, 
and it will work fine so long as it actually is ASCII. Otherwise you'll 
get random-crap: possibly an exception, possibly moji-bake.

The sad truth is that as soon as you leave the nice, clean world of pure 
Unicode, and start dealing with legacy encodings, everything turns to 
quicksand.

If you haven't already done so, you really should start by reading Joel 
Spolsky's introduction to Unicode:

http://global.joelonsoftware.com/English/Articles/Unicode.html

and Ned Batchelder's post on dealing with Unicode and Python:

https://nedbatchelder.com/text/unipain.html



-- 
Steve

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


[issue33117] asyncio example uses non-existing/documented method

2018-03-23 Thread Terry J. Reedy

Change by Terry J. Reedy :


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



[issue33115] Asyncio loop blocks with a lot of parallel tasks

2018-03-23 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

If the unforeseeable future arrives, someone can reopen or open a new issue.

--
nosy: +terry.reedy
resolution:  -> wont fix
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue33130] functools.reduce signature/docstring discordance

2018-03-23 Thread Vince Reuter

New submission from Vince Reuter :

The signature for functools.reduce correctly refers to the collection parameter 
as an iterable, but the docstring refers to it as "sequence," which the input 
need not be and does not match the parameter name despite being italicized.

--
assignee: docs@python
components: Documentation
messages: 314344
nosy: docs@python, vreuter
priority: normal
pull_requests: 5951
severity: normal
status: open
title: functools.reduce signature/docstring discordance
type: enhancement
versions: 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



[issue33129] Add kwarg-only option to dataclass

2018-03-23 Thread Alan Du

Alan  Du  added the comment:

Err... the right link would actually be 
https://github.com/alanhdu/cpython/tree/bpo-33129.

--

___
Python tracker 

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



[issue33129] Add kwarg-only option to dataclass

2018-03-23 Thread Alan Du

Alan  Du  added the comment:

If this would be accepted, I'd be happy to contribute a patch adding a 
`kwarg_only` option to `dataclass` (although it might take me a while since I'm 
not super familiar with the Python development workflow). I believe I already 
have the code change necessary at 
https://github.com/alanhdu/cpython/commit/fa35b39e5204845690ff774812f882f40b0e5f90
 (although it still needs tests and documentation).

--

___
Python tracker 

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



[issue33129] Add kwarg-only option to dataclass

2018-03-23 Thread Alan Du

New submission from Alan  Du :

I'd like to request a new option to the `dataclasses.dataclass` decorator to 
make the `__init__` keyword-only.

The two use-cases I have in mind are:

(1) Using as a dataclass big-bag-of-config. In this scenario, forcing the user 
to specify the keywords is a lot nicer than passing in a dozen positional 
parameters.

(2) Having kwarg-only parameters means that inheritance and default parameters 
play nicely with each other again instead of raising a TypeError.

--
components: Library (Lib)
messages: 314341
nosy: alan_du, eric.smith
priority: normal
severity: normal
status: open
title: Add kwarg-only option to dataclass
type: enhancement
versions: 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



[issue33128] PathFinder is twice on sys.meta_path

2018-03-23 Thread Hartmut Goebel

New submission from Hartmut Goebel :

As of Python 3.7.0b2 _frozen_importlib_external.PathFinder exists twice on 
sys.meta_path, and it is the same object:

$ python -S
Python 3.7.0b2 (default, Mar 22 2018, 20:09:00) 
[GCC 5.5.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> print(sys.meta_path)
[,
,
,
]
>>> print([id(p) for p in sys.meta_path])
[24427944, 24430216, 24517416, 24517416]
>>>

--
components: Interpreter Core
messages: 314340
nosy: htgoebel
priority: normal
severity: normal
status: open
title: PathFinder is twice on sys.meta_path
type: behavior
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



[issue33111] Merely importing tkinter breaks parallel code (multiprocessing, sharedmem)

2018-03-23 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

The examples in the multiprocessing doc all put all multiprocessing calls 
within a "if __name__ == '__main__':" statement.  I know that this is necessary 
on Windows, but don't know if or when it helps on other OSes.

--
nosy: +terry.reedy

___
Python tracker 

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



[issue33096] ttk.Treeview.insert() does not allow to insert item with "False" iid

2018-03-23 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

This was initially reported in pydev thread "ttk.Treeview.insert() does not 
allow to insert item with iid=0" on 2018/3/16.  Igor, you should have mentioned 
on the thread that you had opened a tracker issue in response.  It was only 
happenstance that I did not open a duplicate.

I suggested there that 'if iid:' be replaced by 'if iid is not None:' but 
wondered if passing '"-id" ""' in the tk.call would be a problem.  If so, that 
would be a reason for the expanded check and suggest 'if iid in (None, ''):" as 
the replacement.

MRAB responded that '' is the id of the root of the tree.  But that does not 
tell me if passing a duplicate iid or that particular duplicate is a problem or 
not.

--
nosy: +terry.reedy

___
Python tracker 

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



[issue27428] Document WindowsRegistryFinder inherits from MetaPathFinder

2018-03-23 Thread Brett Cannon

Change by Brett Cannon :


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



[issue27428] Document WindowsRegistryFinder inherits from MetaPathFinder

2018-03-23 Thread miss-islington

miss-islington  added the comment:


New changeset 643a781188539de038745d23d0e8e5a03b781209 by Miss Islington (bot) 
in branch '3.6':
bpo-27428: Fix WindowsRegistryFinder documentation to list appropriate ABC 
(GH-6061)
https://github.com/python/cpython/commit/643a781188539de038745d23d0e8e5a03b781209


--

___
Python tracker 

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



[issue33061] NoReturn missing from __all__ in typing.py

2018-03-23 Thread Ivan Levkivskyi

Ivan Levkivskyi  added the comment:

The typing repo PR is not merged yet, but I am closing this here, the remainder 
is tracked in typing repo.

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



[issue33061] NoReturn missing from __all__ in typing.py

2018-03-23 Thread Ivan Levkivskyi

Ivan Levkivskyi  added the comment:


New changeset ac5602746ed39ca6591e98e062e587121ac71371 by Ivan Levkivskyi in 
branch '3.7':
bpo-33061: Add missing 'NoReturn' to __all__ in typing.py (GH-6127) (#6162)
https://github.com/python/cpython/commit/ac5602746ed39ca6591e98e062e587121ac71371


--

___
Python tracker 

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



[issue32387] Disallow untagged C extension import on major platforms

2018-03-23 Thread Ned Deily

Ned Deily  added the comment:

As far as I know, it has not been discussed elsewhere and I think the potential 
for breaking third-party distributions is too high to risk making this change 
this late in the release cycle, independent of Steve's concerns in msg308878.  
Unless someone can dispel those concerns prior to the imminent 3.7.0b3 ABI 
freeze, I think this should be deferred to 3.8.

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



[issue27428] Document WindowsRegistryFinder inherits from MetaPathFinder

2018-03-23 Thread miss-islington

miss-islington  added the comment:


New changeset 45738ede5ac8507b88b35fb0d6e2806a7b2e2efc by Miss Islington (bot) 
in branch '3.7':
bpo-27428: Fix WindowsRegistryFinder documentation to list appropriate ABC 
(GH-6061)
https://github.com/python/cpython/commit/45738ede5ac8507b88b35fb0d6e2806a7b2e2efc


--
nosy: +miss-islington

___
Python tracker 

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



[issue27428] Document WindowsRegistryFinder inherits from MetaPathFinder

2018-03-23 Thread miss-islington

Change by miss-islington :


--
pull_requests: +5950

___
Python tracker 

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



[issue27428] Document WindowsRegistryFinder inherits from MetaPathFinder

2018-03-23 Thread miss-islington

Change by miss-islington :


--
pull_requests: +5949

___
Python tracker 

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



[issue32362] multiprocessing.connection.Connection misdocumented as multiprocessing.Connection

2018-03-23 Thread Berker Peksag

Change by Berker Peksag :


--
keywords: +easy
stage:  -> needs patch
type:  -> behavior
versions:  -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



[issue32358] json.dump: fp must be a text file object

2018-03-23 Thread Berker Peksag

Berker Peksag  added the comment:

This is already documented in the json.dump() documentation:

The json module always produces str objects, not bytes objects.
Therefore, fp.write() must support str input.

Note that the traceback you've posted doesn't have anything to do with the json 
module and it's expected:

>>> f = open('/tmp/t.json', 'wb')
>>> f.write('foo')
Traceback (most recent call last):
  File "", line 1, in 
TypeError: a bytes-like object is required, not 'str'

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



[issue27428] Document WindowsRegistryFinder inherits from MetaPathFinder

2018-03-23 Thread Brett Cannon

Brett Cannon  added the comment:


New changeset 5cbb84106efefd200933aa31e22abf39267d2557 by Brett Cannon 
(Himanshu Lakhara) in branch 'master':
bpo-27428: Fix WindowsRegistryFinder documentation to list appropriate ABC 
(GH-6061)
https://github.com/python/cpython/commit/5cbb84106efefd200933aa31e22abf39267d2557


--

___
Python tracker 

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



[issue33114] random.sample() behavior is unexpected/unclear from docs

2018-03-23 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

> Something along the lines of: "For a fixed seed, random.sample(population, k)
> is not guaranteed to return the same samples for different values of k."

In a way, the proposed wording succinctly directly addresses the problem you 
had.  So, it would seem like a reasonable suggestion.  On the other hand, it 
would be easy for others who haven't had this problem to have a hard time 
figuring out what it means (when should they be worried, what should be 
avoided, why is it a concern at all, what to do about it).

In general, the docs are worded in an affirmative manner (here's what something 
does, here's what it is for, and here is how to use it correctly).  In this 
case, the docs already indicate the intended way to address this use case: "the 
resulting list is in selection order so that all sub-slices will also be valid 
random samples.  This allows raffle winners (the sample) to be partitioned into 
grand prize and second place winners (the subslices)."

Perhaps there could be an algorithmic note, "internally, sample() shifts 
selection algorithms depending on the proportion of the population being 
sampled".  However, this would be unusual -- we don't usually document 
implementation details.  Numpy[1] and R[2] make no mention of the internals.  
Julia[3] does discuss the algorithms but primarily from an efficiency 
point-of-view rather than as a usage note.

Perhaps it may be best to leave this alone rather than adding a note that may 
itself create confusion and worry.  AFAICT, this hasn't come up before in the 
15 year history of random.sample(), not even a StackOverflow question.

[1] 
https://docs.scipy.org/doc/numpy-1.14.0/reference/generated/numpy.random.choice.html
[2] https://www.rdocumentation.org/packages/base/versions/3.4.3/topics/sample
[3] http://juliastats.github.io/StatsBase.jl/stable/sampling.html#Sampling-API-1

--

___
Python tracker 

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



[issue31793] Allow to specialize smart quotes in documentation translations

2018-03-23 Thread Julien Palard

Julien Palard  added the comment:

Reopening as smart quotes is still a source of bugs in Japanese translation, 
see: 
https://github.com/python/docsbuild-scripts/issues/32#issuecomment-375801129

--
status: closed -> open

___
Python tracker 

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



[issue32387] Disallow untagged C extension import on major platforms

2018-03-23 Thread Brett Cannon

Brett Cannon  added the comment:

Not sure if this has missed the 3.7 train, but bumping this to check if the 
discussion on distutils-sig ever occurred and what the  result of it was. 
(Otherwise the PR just needs a news entry and it should be ready.)

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



[issue33122] ftplib: FTP_TLS seems to have problems with sites that close the encrypted channel themselfes

2018-03-23 Thread Giampaolo Rodola'

Giampaolo Rodola'  added the comment:

Please paste your code and traceback message. Also what's the remote FTP server 
you're connected to? You should be able to see it in the welcome message (you 
can set FTP_TLS.debugging to True).

--

___
Python tracker 

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



[issue33127] Python 2.7.14 won't build ssl module with Libressl 2.7.0

2018-03-23 Thread Christian Heimes

Christian Heimes  added the comment:

The homepage is correct. The last stable release is 2.6.4. I know this first 
hand from a LibreSSL developer.

--

___
Python tracker 

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



[issue33122] ftplib: FTP_TLS seems to have problems with sites that close the encrypted channel themselfes

2018-03-23 Thread Ned Deily

Change by Ned Deily :


--
nosy: +giampaolo.rodola

___
Python tracker 

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



[issue31639] http.server and SimpleHTTPServer hang after a few requests

2018-03-23 Thread miss-islington

miss-islington  added the comment:


New changeset f8d2c3cf5f62f0c259b2bf35c631353d22cf1d08 by Miss Islington (bot) 
in branch '3.7':
bpo-31639: Use threads in http.server module. (GH-5018)
https://github.com/python/cpython/commit/f8d2c3cf5f62f0c259b2bf35c631353d22cf1d08


--
nosy: +miss-islington

___
Python tracker 

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



[issue33093] Fatal error on SSL transport

2018-03-23 Thread Ned Deily

Ned Deily  added the comment:

Thanks for the report and for the analysis!  Closing as duplicate.

--
nosy: +ned.deily
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> Skip sending/receiving after SSL transport closing

___
Python tracker 

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



[issue33127] Python 2.7.14 won't build ssl module with Libressl 2.7.0

2018-03-23 Thread Charles

Charles  added the comment:

I'm not sure it's a beta release.  I think they just forgot to update on their 
homepage what the latest stable is.

Nothing on the releases page or the release notes says it's a beta.

--

___
Python tracker 

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



[issue33023] Unable to copy ssl.SSLContext

2018-03-23 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

PR 6099 changes error message "can't pickle SSLContext objects" to "cannot 
serialize SSLContext object", right? Wouldn't be better to change the standard 
error message instead?

--
nosy: +serhiy.storchaka

___
Python tracker 

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



ANN: Wing Python IDEs version 6.0.11 released

2018-03-23 Thread Wingware

Hi,

We've just released Wing 6.0.11 , 
which implements auto-save and restore for remote files, adds a Russian 
translation of the UI (thanks to Alexandr Dragukin), improves remote 
development error reporting and recovery after network breaks, correctly 
terminates SSH tunnels when switching projects or quitting, fixes severe 
network slowdown seen on High Sierra, auto-reactivates expired annual 
licenses without restarting Wing, and makes about 20 other 
improvements.  For details, see 
https://wingware.com/pub/wingide/6.0.11/CHANGELOG.txt


Download Now 

About Wing

Wing is a family of cross-platform 
 Python IDEs with 
powerful integrated editing, debugging, unit testing, and project 
management features. Wing runs on Windows, Linux, and OS X, and can be 
used to develop any kind of Python code for web, desktop, embedded 
scripting, and other applications.


Wing 101  and Wing Personal 
 omit some features and 
are free to download and use without a license. Wing Pro 
 requires purchasing 
 or upgrading 
 a license, or obtaining a 30-day 
trial at startup.


Version 6 introduces many new features, including improved 
multi-selection, much easier remote development 
, debugging from the Python 
Shell, recursive debugging, PEP 484 and 526 type hinting, support for 
Python 3.6 and 3.7, Vagrant , 
Jupyter , and Django 
 1.10+, easier Raspberry Pi 
 development, optimized 
debugger, OS X full screen mode, One Dark color palette, Russian 
localization (thanks to Alexandr Dragukin), expanded free product line, 
and much more. For details, see What's New in Wing Version 6 
.


Wing 6 works with Python versions 2.5 through 2.7 and 3.2 through 3.7, 
including also Anaconda, ActivePython, EPD, Stackless, and others 
derived from the CPython implementation.


For more product information, please visit wingware.com 



Upgrading

You can try Wing 6 without removing older versions. Wing 6 will read and 
convert your old preferences, settings, and projects. Projects should be 
saved to a new name since previous versions of Wing cannot read Wing 6 
projects.


See also Migrating from Older Versions 
 and Upgrading 
.


Links

Release notice: https://wingware.com/news/2018-03-21
Downloads and Free Trial: https://wingware.com/downloads
Buy: https://wingware.com/store/purchase
Upgrade: https://wingware.com/store/upgrade

Questions?  Don't hesitate to email us at supp...@wingware.com.

Thanks,

--

Stephan Deibel
Wingware | Python IDE

The Intelligent Development Environment for Python Programmers

wingware.com

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


[issue32287] Import of _pyio module failed on cygwin

2018-03-23 Thread Berker Peksag

Change by Berker Peksag :


--
superseder:  -> _pyio module broken on Cygwin / setmode not usable

___
Python tracker 

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



[issue33127] Python 2.7.14 won't build ssl module with Libressl 2.7.0

2018-03-23 Thread Christian Heimes

Christian Heimes  added the comment:

Thanks for the report. LibreSSL 2.7 introduced OpenSSL 1.1 API methods. I 
already know about the issue and have a pending fix for it on my disk. I'll 
push it as soon as 2.7.1 is out.

2.7.0 is a beta release. The latest stable is 2.6.4.

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



[issue33127] Python 2.7.14 won't build ssl module with Libressl 2.7.0

2018-03-23 Thread Charles

New submission from Charles <chd...@gmail.com>:

On macOS I could build python 2.7.14 with libressl 2.6.4 without any problems.

If I try to build that same version of python with libressl 2.7.0, I get the 
failure pasted in below.

/Users/chdiza/.tmp/tmpdir/python27-20180323-74284-f2auy2/Python-2.7.14/Modules/_ssl.c:141:12:
 error: static declaration of 'X509_NAME_ENTRY_set' follows non-static 
declaration
static int X509_NAME_ENTRY_set(const X509_NAME_ENTRY *ne)
   ^
/usr/local/ssl/include/openssl/x509.h:1139:6: note: previous declaration is here
int X509_NAME_ENTRY_set(const X509_NAME_ENTRY *ne);
^
/Users/chdiza/.tmp/tmpdir/python27-20180323-74284-f2auy2/Python-2.7.14/Modules/_ssl.c:153:25:
 error: static declaration of 'SSL_CTX_get_default_passwd_cb' follows 
non-static declaration
static pem_password_cb *SSL_CTX_get_default_passwd_cb(SSL_CTX *ctx)
^
/usr/local/ssl/include/openssl/ssl.h:1368:18: note: previous declaration is here
pem_password_cb *SSL_CTX_get_default_passwd_cb(SSL_CTX *ctx);
 ^
/Users/chdiza/.tmp/tmpdir/python27-20180323-74284-f2auy2/Python-2.7.14/Modules/_ssl.c:158:14:
 error: static declaration of 'SSL_CTX_get_default_passwd_cb_userdata' follows 
non-static declaration
static void *SSL_CTX_get_default_passwd_cb_userdata(SSL_CTX *ctx)
 ^
/usr/local/ssl/include/openssl/ssl.h:1370:7: note: previous declaration is here
void *SSL_CTX_get_default_passwd_cb_userdata(SSL_CTX *ctx);
  ^
/Users/chdiza/.tmp/tmpdir/python27-20180323-74284-f2auy2/Python-2.7.14/Modules/_ssl.c:163:12:
 error: static declaration of 'X509_OBJECT_get_type' follows non-static 
declaration
static int X509_OBJECT_get_type(X509_OBJECT *x)
   ^
/usr/local/ssl/include/openssl/x509_vfy.h:428:5: note: previous declaration is 
here
int X509_OBJECT_get_type(const X509_OBJECT *a);
^
/Users/chdiza/.tmp/tmpdir/python27-20180323-74284-f2auy2/Python-2.7.14/Modules/_ssl.c:168:14:
 error: static declaration of 'X509_OBJECT_get0_X509' follows non-static 
declaration
static X509 *X509_OBJECT_get0_X509(X509_OBJECT *x)
 ^
/usr/local/ssl/include/openssl/x509_vfy.h:430:7: note: previous declaration is 
here
X509 *X509_OBJECT_get0_X509(const X509_OBJECT *xo);
  ^
/Users/chdiza/.tmp/tmpdir/python27-20180323-74284-f2auy2/Python-2.7.14/Modules/_ssl.c:173:31:
 error: static declaration of 'X509_STORE_get0_objects' follows non-static 
declaration
static STACK_OF(X509_OBJECT) *X509_STORE_get0_objects(X509_STORE *store) {
  ^
/usr/local/ssl/include/openssl/x509_vfy.h:438:24: note: previous declaration is 
here
STACK_OF(X509_OBJECT) *X509_STORE_get0_objects(X509_STORE *xs);
   ^
/Users/chdiza/.tmp/tmpdir/python27-20180323-74284-f2auy2/Python-2.7.14/Modules/_ssl.c:177:27:
 error: static declaration of 'X509_STORE_get0_param' follows non-static 
declaration
static X509_VERIFY_PARAM *X509_STORE_get0_param(X509_STORE *store)
  ^
/usr/local/ssl/include/openssl/x509_vfy.h:450:20: note: previous declaration is 
here
X509_VERIFY_PARAM *X509_STORE_get0_param(X509_STORE *ctx);
   ^
7 errors generated.

--
assignee: christian.heimes
components: SSL
messages: 314320
nosy: chdiza, christian.heimes
priority: normal
severity: normal
status: open
title: Python 2.7.14 won't build ssl module with Libressl 2.7.0
type: compile error
versions: Python 2.7

___
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue33127>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



Re: Best practice for managing secrets (passwords, private keys) used by Python scripts running as daemons

2018-03-23 Thread Dan Stromberg
I'd put them in a file with access to the daemon..

Putting credentials in an environment variable is insecure on Linux,
because ps auxwwe lists environment variables.

On Fri, Mar 23, 2018 at 9:37 AM, Malcolm Greene  wrote:
> Looking for your suggestions on best practice techniques for managing
> secrets used by Python daemon scripts. Use case is Windows scripts
> running as NT Services, but interested in Linux options as well.
> Here's what we're considering
>
> 1. Storing secrets in environment vars
> 2. Storing secrets in config file only in subfolder with access limited
>to daemon account only3. Using a 3rd party vault product
>
> Thanks
> --
> https://mail.python.org/mailman/listinfo/python-list
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue32234] Add context management to mailbox.Mailbox

2018-03-23 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

Is closing a mailbox in __exit__ the most desirable operation?

In the last example on https://docs.python.org/3/library/mailbox.html#examples 
inbox is locked and unlocked multiple times. The with statement couldn't be 
used here.

On https://pymotw.com/3/mailbox/ some examples use the idiom

mbox = ...
mbox.lock()
try:
...
finally:
mbox.unlock()

and others use the idiom

mbox = ...
mbox.lock()
try:
...
finally:
mbox.flush()
mbox.close()

--

___
Python tracker 

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



Re: Python 3.6: How to expand f-string literals read from a file vs inline statement

2018-03-23 Thread Steven D'Aprano
On Fri, 23 Mar 2018 10:39:05 -0600, Malcolm Greene wrote:

>> Perhaps it doesn't need to be said, but just to be sure: don't use eval
>>  if you don't trust the people writing the configuration file. They can
>> do nearly unlimited damage to your environment.  They are writing code
>> that you are running.
> 
> Of course! Script and config file are running in a private subnet 


Okay. So only users who have access to the private subnet can inject code 
into your application. That covers a *lot* of ground:

"The private subnet is used by me and my wife, and we both have root on 
the system and trust each other implicitly."

"The private subnet is used by five thousand really smart and technically 
savvy but emotionally immature teens who are constantly trying to 
escalate privileges and take over the system."

I always find it amusing when techies imagine that hackers on the 
internet are the only security threat.

http://www.zdnet.com/article/the-top-five-internal-security-threats/

https://blog.trendmicro.com/most-data-security-threats-are-internal-
forrester-says/




> and both are maintained by a single developer.

And this is relevant to the security risk in what way?



-- 
Steve

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


[issue32234] Add context management to mailbox.Mailbox

2018-03-23 Thread Stéphane Blondon

Stéphane Blondon  added the comment:

I don't know about something blocking the merge. I sent a message to Barry
on Github the 3th january but perhaps it was a wrong timing (too soon after
new year).

--

___
Python tracker 

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



Re: PyQt4 QWebView cant load google maps markers

2018-03-23 Thread Xristos Xristoou
tell some solution ?yes you are correct for some seconds show me the mark but 
only for some seconds.can i update my pyqt4 to show me the mark ?
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue33092] The bytecode for f-string formatting is inefficient.

2018-03-23 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

I wouldn't say this more efficient. Instead one instruction you would need to 
execute two instructions.

If I implemented f-string formatting I would add four simple opcodes for str(), 
repr(), ascii() and format(). But Eric merged them all in the single opcode 
with complex argument. While this looks more complicated and less extensible, 
it is more efficient.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



Re: Python 3.6: How to expand f-string literals read from a file vs inline statement

2018-03-23 Thread Ned Batchelder

On 3/23/18 12:39 PM, Malcolm Greene wrote:

Perhaps it doesn't need to be said, but just to be sure: don't use eval  if you 
don't trust the people writing the configuration file. They can do nearly 
unlimited damage to your environment.  They are writing code that you are 
running.

Of course! Script and config file are running in a private subnet and both are 
maintained by a single developer.


Then why make your life difficult?  Put the "configuration" in a .py file.

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


[issue33081] multiprocessing Queue leaks a file descriptor associated with the pipe writer

2018-03-23 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Thanks for reporting this.  I agree this is a real issue, but it doesn't exist 
on Python 3 anymore:

>>> q = multiprocessing.Queue()
>>> q.put(1)
>>> q.get()
1
>>> threading.enumerate()
[<_MainThread(MainThread, started 139978753529600)>, ]
>>> q.close()
>>> threading.enumerate()
[<_MainThread(MainThread, started 139978753529600)>]
>>> os.getpid()
17318

And in another terminal:

$ ls -la /proc/17318/fd
total 0
dr-x-- 2 antoine antoine  0 mars  23 17:51 .
dr-xr-xr-x 9 antoine antoine  0 mars  23 17:51 ..
lrwx-- 1 antoine antoine 64 mars  23 17:52 0 -> /dev/pts/8
lrwx-- 1 antoine antoine 64 mars  23 17:52 1 -> /dev/pts/8
lrwx-- 1 antoine antoine 64 mars  23 17:51 2 -> /dev/pts/8


I'm uninterested in fixing this on Python 2, so I'm closing.

--
resolution:  -> wont fix
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue31639] http.server and SimpleHTTPServer hang after a few requests

2018-03-23 Thread Julien Palard

Change by Julien Palard :


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



[issue31639] http.server and SimpleHTTPServer hang after a few requests

2018-03-23 Thread miss-islington

Change by miss-islington :


--
pull_requests: +5948

___
Python tracker 

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



[issue31639] http.server and SimpleHTTPServer hang after a few requests

2018-03-23 Thread miss-islington

Change by miss-islington :


--
pull_requests: +5947

___
Python tracker 

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



[issue33126] Some C buffer protocol APIs not documented

2018-03-23 Thread Antoine Pitrou

New submission from Antoine Pitrou :

The following C functions are available for C code but not documented:
- PyBuffer_ToContiguous()
- PyBuffer_FromContiguous()
- PyObject_CopyData()

I am not sure how to describe those functions myself.

--
assignee: docs@python
components: Documentation
messages: 314315
nosy: docs@python, pitrou, skrah
priority: normal
severity: normal
stage: needs patch
status: open
title: Some C buffer protocol APIs not documented
type: behavior
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



Re: Python 3.6: How to expand f-string literals read from a file vs inline statement

2018-03-23 Thread Malcolm Greene
> Perhaps it doesn't need to be said, but just to be sure: don't use eval  if 
> you don't trust the people writing the configuration file. They can do nearly 
> unlimited damage to your environment.  They are writing code that you are 
> running.

Of course! Script and config file are running in a private subnet and both are 
maintained by a single developer.
-- 
https://mail.python.org/mailman/listinfo/python-list


Best practice for managing secrets (passwords, private keys) used by Python scripts running as daemons

2018-03-23 Thread Malcolm Greene
Looking for your suggestions on best practice techniques for managing
secrets used by Python daemon scripts. Use case is Windows scripts
running as NT Services, but interested in Linux options as well.
Here's what we're considering

1. Storing secrets in environment vars
2. Storing secrets in config file only in subfolder with access limited
   to daemon account only3. Using a 3rd party vault product

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


[issue31639] http.server and SimpleHTTPServer hang after a few requests

2018-03-23 Thread Julien Palard

Julien Palard  added the comment:


New changeset 8bcfa02e4b1b65634e526e197588bc600674c80b by Julien Palard in 
branch 'master':
bpo-31639: Use threads in http.server module. (GH-5018)
https://github.com/python/cpython/commit/8bcfa02e4b1b65634e526e197588bc600674c80b


--

___
Python tracker 

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



[issue33097] concurrent futures Executors accept tasks after interpreter shutdown

2018-03-23 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Thanks for spotting this.  I will take a look soon, unless someone beats me to 
it.

--
nosy: +pitrou

___
Python tracker 

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



[issue33097] concurrent futures Executors accept tasks after interpreter shutdown

2018-03-23 Thread Antoine Pitrou

Change by Antoine Pitrou :


--
nosy: +tomMoral
versions: +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



[issue33092] The bytecode for f-string formatting is inefficient.

2018-03-23 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

>  I would suggest that a simper interpreter with smaller, simpler bytecodes is 
> a worthy goal in itself.

+1 from me.  Though I'm curious about performance changes as well :-)

--
nosy: +pitrou

___
Python tracker 

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



[issue33125] Windows 10 ARM64 platform support

2018-03-23 Thread Steven Downum

Change by Steven Downum :


--
nosy: +steven.downum

___
Python tracker 

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



[issue33125] Windows 10 ARM64 platform support

2018-03-23 Thread Zachary Ware

Zachary Ware  added the comment:

Ideally, all of the changes necessary in OpenSSL, libffi, and Tcl/Tk will 
happen upstream and we'll just update to new versions of them.  We have PR 3806 
in progress to extract libffi from our repo and treat it just as any other 
external dependency on Windows, but neither Steve nor I have had a chance to 
work on it in quite a long time.  That will probably be a prerequisite for 
properly supporting ARM64 Windows.

--

___
Python tracker 

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



Re: Putting Unicode characters in JSON

2018-03-23 Thread Chris Angelico
On Sat, Mar 24, 2018 at 1:46 AM, Tobiah  wrote:
> On 03/22/2018 12:46 PM, Tobiah wrote:
>>
>> I have some mailing information in a Mysql database that has
>> characters from various other countries.  The table says that
>> it's using latin-1 encoding.  I want to send this data out
>> as JSON.
>>
>> So I'm just taking each datum and doing 'name'.decode('latin-1')
>> and adding the resulting Unicode value right into my JSON structure
>> before doing .dumps() on it.  This seems to work, and I can consume
>> the JSON with another program and when I print values, they look nice
>> with the special characters and all.
>>
>> I was reading though, that JSON files must be encoded with UTF-8.  So
>> should I be doing string.decode('latin-1').encode('utf-8')?  Or does
>> the json module do that for me when I give it a unicode object?
>
>
>
> Thanks for all the discussion.  A little more about our setup:
> We have used a LAMP stack system for almost 20 years to deploy
> hundreds of websites.  The database tables are latin-1 only because
> at the time we didn't know how or care to change it.
>
> More and more, 'special' characters caused a problem.  They would
> not come out correctly in a .csv file or wouldn't print correctly.
> Lately, I noticed that a JSON file I was sending out was delivering
> unreadable characters.  That's when I started to look into Unicode
> a bit more.  From the discussion, and my own guesses, it looks
> as though all have to do is string.decode('latin-1'), and stuff
> that Unicode object right into my structure that gets handed to
> json.dumps().

Yep, this is sounding more and more like you need to go UTF-8 everywhere.

> If I changed my database tables to all be UTF-8 would this
> work cleanly without any decoding?  Whatever people are doing
> to get these characters in, whether it's foreign keyboards,
> or fancy escape sequences in the web forms, would their intended
> characters still go into the UTF-8 database as the proper characters?
> Or now do I have to do a conversion on the way in to the database?

The best way to do things is to let your Python-MySQL bridge do the
decoding for you; you'll simply store and get back Unicode strings.
That's how things happen by default in Python 3 (I believe; been a
while since I used MySQL, but it's like that with PostgreSQL). My
recommendation is to give it a try; most likely, things will just
work.

> We also get import data that often comes in .xlsx format.  What
> encoding do I get when I dump a .csv from that?  Do I have to
> ask the sender?  I already know that they don't know.

Ah, now, that's a potential problem. A CSV file can't tell you what
encoding it's in. Fortunately, UTF-8 is designed to be fairly
dependable: if you attempt to decode something as UTF-8 and it works,
you can be confident that it really is UTF-8. But ultimately, you have
to just ask the person who exports it: "please export it in UTF-8".

Generally, things should "just work" as long as you're consistent with
encodings, and the easiest way to be consistent is to use UTF-8
everywhere. It's a simple rule that everyone can follow. (Hopefully.
:) )

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


Re: Putting Unicode characters in JSON

2018-03-23 Thread Grant Edwards
On 2018-03-23, Richard Damon  wrote:

> One comment on this whole argument, the original poster asked how to get 
> data from a database that WAS using Latin-1 encoding into JSON (which 
> wants UTF-8 encoding) and was asking if something needed to be done 
> beyond using .decode('Latin-1'), and in particular if they need to use a 
> .encode('UTF-8'). The answer should be a simple Yes or No.
>
> Instead, someone took the opportunity to advocate that a wholesale 
> change to the database was the only reasonable course of action.

Well, this is (somewhat) Usenet, where the most common answer to "How
do I do X?"  is usually "X is stupid. You don't want to do X. You
should do Y."  This is generally followed by somebody proposing Z
instead of Y and a long debate about the relative merits of Y and Z.

One learns to either justify X or just ingore the subthreads about Y
and Z.  Except sometimes the answer _is_ that you really don't want to
do X, and probably should do Y or Z.

-- 
Grant Edwards   grant.b.edwardsYow! Oh my GOD -- the
  at   SUN just fell into YANKEE
  gmail.comSTADIUM!!

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


Re: Putting Unicode characters in JSON

2018-03-23 Thread Grant Edwards
On 2018-03-23, Chris Angelico  wrote:
> On Fri, Mar 23, 2018 at 10:47 AM, Steven D'Aprano
> wrote:
>> On Fri, 23 Mar 2018 07:09:50 +1100, Chris Angelico wrote:
>>
 I was reading though, that JSON files must be encoded with UTF-8.  So
 should I be doing string.decode('latin-1').encode('utf-8')?  Or does
 the json module do that for me when I give it a unicode object?
>>>
>>> Reconfigure your MySQL database to use UTF-8. There is no reason to use
>>> Latin-1 in the database.
>>
>> You don't know that. You don't know what technical, compatibility, policy
>> or historical constraints are on the database.
>
> Okay. Give me a good reason for the database itself to be locked to
> Latin-1.

Because the DB administrator wont change things without orders from
his boss, who won't order changes without because there's no budget
for that.

OK, perhaps it's not a _good_ reason by your metrics, but reasons like
that are what you find in the real world.

-- 
Grant Edwards   grant.b.edwardsYow! ... My pants just went
  at   on a wild rampage through a
  gmail.comLong Island Bowling Alley!!

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


Re: Putting Unicode characters in JSON

2018-03-23 Thread Tobiah

On 03/22/2018 12:46 PM, Tobiah wrote:

I have some mailing information in a Mysql database that has
characters from various other countries.  The table says that
it's using latin-1 encoding.  I want to send this data out
as JSON.

So I'm just taking each datum and doing 'name'.decode('latin-1')
and adding the resulting Unicode value right into my JSON structure
before doing .dumps() on it.  This seems to work, and I can consume
the JSON with another program and when I print values, they look nice
with the special characters and all.

I was reading though, that JSON files must be encoded with UTF-8.  So
should I be doing string.decode('latin-1').encode('utf-8')?  Or does
the json module do that for me when I give it a unicode object?



Thanks for all the discussion.  A little more about our setup:
We have used a LAMP stack system for almost 20 years to deploy
hundreds of websites.  The database tables are latin-1 only because
at the time we didn't know how or care to change it.

More and more, 'special' characters caused a problem.  They would
not come out correctly in a .csv file or wouldn't print correctly.
Lately, I noticed that a JSON file I was sending out was delivering
unreadable characters.  That's when I started to look into Unicode
a bit more.  From the discussion, and my own guesses, it looks
as though all have to do is string.decode('latin-1'), and stuff
that Unicode object right into my structure that gets handed to
json.dumps().

If I changed my database tables to all be UTF-8 would this
work cleanly without any decoding?  Whatever people are doing
to get these characters in, whether it's foreign keyboards,
or fancy escape sequences in the web forms, would their intended
characters still go into the UTF-8 database as the proper characters?
Or now do I have to do a conversion on the way in to the database?

We also get import data that often comes in .xlsx format.  What
encoding do I get when I dump a .csv from that?  Do I have to
ask the sender?  I already know that they don't know.


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


Re: PyQt4 QWebView cant load google maps markers

2018-03-23 Thread Anssi Saari
Xristos Xristoou  writes:

> I want to create a simple python app using pyqt,QWebView and google maps with 
> markers.
>
> The problem is that,the markers does not load inside the QWebView, as
> you can see they load just fine in the browser.

Well, since you got a javascript error, maybe Qt4 doesn't support the
version of javascript Google uses today? Qt4 was released over a decade
ago.

I tried with PyQt5 and the page loads and a marker shows up. It then
disappears as Google puts up a couple of popups. There's a complaint
about browser capabilities and also a privacy note from Google.

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


Re: Python 3.6: How to expand f-string literals read from a file vs inline statement

2018-03-23 Thread Ned Batchelder

On 3/23/18 4:30 AM, Malcolm Greene wrote:

Looking for advice on how to expand f-string literal strings whose
values I'm reading from a configuration file vs hard coding into
my script as statements. I'm using f-strings as a very simple
template language.
I'm currently using the following technique to expand these f-strings.
Is there a better way?
Bonus if anyone has suggestions on how my expand() function can access
the locals() value of the caller so this parameter doesn't have to be
passed in explicitly.
*def *expand(expression, values):

"""Expand expression using passed in locals()"""

triple_quote = *"'" ** 3
expression = dedent(expression)

*return *eval(*f'f{triple_quote}{expression}{triple_quote}'*,
*None*, values)

product_name = 'Bike ABC'

product_sku = '123456'

product_price = 299.95

discount = 0.85



# read in product description template

# product_description_template might look like: {product_sku} :
# {product_name}: ${product_price * discount}product_description_template = 
config('product_description_template')



# expand the {expressions} in product_description_template using my
# locals()product_description = expand(product_description_template, locals())




Perhaps it doesn't need to be said, but just to be sure: don't use eval 
if you don't trust the people writing the configuration file. They can 
do nearly unlimited damage to your environment.  They are writing code 
that you are running.


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


Re: Entering a very large number

2018-03-23 Thread Thomas Jollans
On 2018-03-23 14:01, ast wrote:
> Le 23/03/2018 à 13:43, Rustom Mody a écrit :
>> On Friday, March 23, 2018 at 5:46:56 PM UTC+5:30, ast wrote:
>>> Hi
>>>
>>> I found this way to put a large number in
>>> a variable.
>>
>> What stops you from entering the number on one single (v long) line?
> 
> 
> It is not beautiful and not very readable. It is better to
> have a fixed number of digits per line (eg 50)
> 
> import this
> 
> Beautiful is better than ugly.
> Readability counts.

I would tend to read this as a reason not to have extremely large
numbers in your code in the first place if you can avoid it.

> 
> 
>>
>> In case there is a religious commitment to PEP 8 dicta, the recommended
>> meditation is this line (also from PEP8):
>>
>> "However, know when to be inconsistent -- sometimes style guide
>> recommendations just aren't applicable"
>>
> 
> Yes I am using pylint which flags too long lines (80 characters)

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


Re: Putting Unicode characters in JSON

2018-03-23 Thread Richard Damon

On 3/23/18 6:35 AM, Chris Angelico wrote:

On Fri, Mar 23, 2018 at 9:29 PM, Steven D'Aprano
 wrote:

On Fri, 23 Mar 2018 18:35:20 +1100, Chris Angelico wrote:


That doesn't seem to be a strictly-correct Latin-1 decoder, then. There
are a number of unassigned byte values in ISO-8859-1.

That's incorrect, but I don't blame you for getting it wrong. Who thought
that it was a good idea to distinguish between "ISO 8859-1" and
"ISO-8859-1" as two related but distinct encodings?

https://en.wikipedia.org/wiki/ISO/IEC_8859-1

The old ISO 8859-1 standard, the one with undefined values, is mostly of
historical interest. For the last twenty years or so, anyone talking
about either Latin-1 or ISO-8859-1 (with or without dashes) is almost
meaning the 1992 IANA superset version which defines all 256 characters:

 "In 1992, the IANA registered the character map ISO_8859-1:1987,
 more commonly known by its preferred MIME name of ISO-8859-1
 (note the extra hyphen over ISO 8859-1), a superset of ISO
 8859-1, for use on the Internet. This map assigns the C0 and C1
 control characters to the unassigned code values thus provides
 for 256 characters via every possible 8-bit value."


Either that, or they actually mean Windows-1252, but let's not go there.


Wait, whaaa...

Though in my own defense, MySQL itself seems to have a bit of a
problem with encoding names. Its "utf8" is actually "UTF-8 with a
maximum of three bytes per character", in contrast to "utf8mb4" which
is, well, UTF-8.

In any case, abusing "Latin-1" to store binary data is still wrong.
That's what BLOB is for.

ChrisA


One comment on this whole argument, the original poster asked how to get 
data from a database that WAS using Latin-1 encoding into JSON (which 
wants UTF-8 encoding) and was asking if something needed to be done 
beyond using .decode('Latin-1'), and in particular if they need to use a 
.encode('UTF-8'). The answer should be a simple Yes or No.


Instead, someone took the opportunity to advocate that a wholesale 
change to the database was the only reasonable course of action.


First comment, when someone is proposing a change, it is generally put 
on them the burden of proof that the change is warranted. This is 
especially true when they are telling someone else they need to make 
such a change.


Absolute statements are very hard to prove (but the difficulty of proof 
doesn't relieve the need to provide it), and in fact are fairly easy to 
disprove (one counter example disproves an absolute statement). Counter 
examples to the absolute statement have been provided.


When dealing with a code base, backwards compatibility IS important, and 
casually changing something that fundamental isn't the first thing that 
someone should be thinking about, We weren't given any details about the 
overall system this was part of, and they easily could be other code 
using the database that such a change would break. One easy Python 
example is to look back at the change from Python 2 to Python 3, how 
many years has that gone on, and how many more will people continue to 
deal with it? This was over a similar issue, that at least for today, 
Unicode is the best solution for storing arbitrary text, and forcing 
that change down to the fundamental level.


--
Richard Damon

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


Re: Entering a very large number

2018-03-23 Thread Richard Damon

On 3/23/18 9:35 AM, ast wrote:

Le 23/03/2018 à 14:16, Antoon Pardon a écrit :

On 23-03-18 14:01, ast wrote:

Le 23/03/2018 à 13:43, Rustom Mody a écrit :

On Friday, March 23, 2018 at 5:46:56 PM UTC+5:30, ast wrote:




What meaningful information from number can you easily retrieve from
representing the number in some kind of table form that you can't from
just writing the number on one line?



digit n° 103 is 1
digit n° 150 is 7
...

If the value of the specific digits is meaningful, they you likely don't 
really have a number, but a digital representation, for which a string 
is probably the better way to define it, and take the cost of the 
conversion as part of the cost to be pretty.


--
Richard Damon

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


Re: Entering a very large number

2018-03-23 Thread Antoon Pardon
On 23-03-18 14:35, ast wrote:
> Le 23/03/2018 à 14:16, Antoon Pardon a écrit :
>> On 23-03-18 14:01, ast wrote:
>>> Le 23/03/2018 à 13:43, Rustom Mody a écrit :
 On Friday, March 23, 2018 at 5:46:56 PM UTC+5:30, ast wrote:
>
>
>> What meaningful information from number can you easily retrieve from
>> representing the number in some kind of table form that you can't from
>> just writing the number on one line?
>>
>
> digit n° 103 is 1
> digit n° 150 is 7
> ...
>
In what way is that meaningful information? How will that information
help you in any way with writing your program?

-- 
Antoon.

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


[issue33041] Issues with "async for"

2018-03-23 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


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



[issue33041] Issues with "async for"

2018-03-23 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:


New changeset 18d7edf32e6832a818621cb8cb3d144928eca232 by Serhiy Storchaka in 
branch '3.6':
[3.6] bpo-33041: Fixed jumping if the function contains an "async for" loop. 
(GH-6154). (GH-6199)
https://github.com/python/cpython/commit/18d7edf32e6832a818621cb8cb3d144928eca232


--

___
Python tracker 

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



Re: Entering a very large number

2018-03-23 Thread ast

Le 23/03/2018 à 14:16, Antoon Pardon a écrit :

On 23-03-18 14:01, ast wrote:

Le 23/03/2018 à 13:43, Rustom Mody a écrit :

On Friday, March 23, 2018 at 5:46:56 PM UTC+5:30, ast wrote:




What meaningful information from number can you easily retrieve from
representing the number in some kind of table form that you can't from
just writing the number on one line?



digit n° 103 is 1
digit n° 150 is 7
...

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


[issue33125] Windows 10 ARM64 platform support

2018-03-23 Thread Steven Noonan

Steven Noonan  added the comment:

I originally tagged this issue against 3.6 just because that's what I was 
attempting to build. But I'm not super concerned about what release these 
changes actually land in, I can always backport it to my own builds (and at my 
own risk).

Even though I'm super interested in seeing these changes done, I'm not sure I'm 
the right person to do the heavy lifting on this. I don't know if the seemingly 
undocumented (?) Windows ARM64 ABI matches the well-documented Linux AArch64 
ABI, for example. If it does match, that would make porting the asm bits pretty 
straightforward (mostly just translating GNU assembler AT syntax to MASM, I 
suppose). I could do that. But if it doesn't match then I'd probably need to 
dig into ARM architecture manuals. Someone else could likely do it in their 
sleep.

--

___
Python tracker 

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



Re: Entering a very large number

2018-03-23 Thread ast

Le 23/03/2018 à 13:55, Wolfgang Maier a écrit :

On 03/23/2018 01:30 PM, Wolfgang Maier wrote:

On 03/23/2018 01:16 PM, ast wrote:




n = int(
     ''.join("""
37107287533902102798797998220837590246510135740250
46376937677490009712648124896970078050417018260538
74324986199524741059474233309513058123726617309629

...


45876576172410976447339110607218265236877223636045
17423706905851860660448207621209813287860733969412
""".split())
)



yes, good idea

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


Re: Entering a very large number

2018-03-23 Thread Antoon Pardon
On 23-03-18 14:01, ast wrote:
> Le 23/03/2018 à 13:43, Rustom Mody a écrit :
>> On Friday, March 23, 2018 at 5:46:56 PM UTC+5:30, ast wrote:
>>> Hi
>>>
>>> I found this way to put a large number in
>>> a variable.
>>
>> What stops you from entering the number on one single (v long) line?
>
>
> It is not beautiful and not very readable. It is better to
> have a fixed number of digits per line (eg 50)

Numbers that large are not readable, no matter how you put then in your
code. Such a blob of digits just doesn't carry much meaning to humans.

What meaningful information from number can you easily retrieve from
representing the number in some kind of table form that you can't from
just writing the number on one line?

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


Re: Entering a very large number

2018-03-23 Thread Johannes Bauer
On 23.03.2018 14:01, ast wrote:

> It is not beautiful and not very readable. It is better to
> have a fixed number of digits per line (eg 50)

Oh yes, because clearly a 400-digit number becomes VERY beautiful and
readable once you add line breaks to it.

Cheers,
Joe

-- 
>> Wo hattest Du das Beben nochmal GENAU vorhergesagt?
> Zumindest nicht öffentlich!
Ah, der neueste und bis heute genialste Streich unsere großen
Kosmologen: Die Geheim-Vorhersage.
 - Karl Kaos über Rüdiger Thomas in dsa 
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Entering a very large number

2018-03-23 Thread ast

Le 23/03/2018 à 13:30, Wolfgang Maier a écrit :

On 03/23/2018 01:16 PM, ast wrote:




A very simple improvement would be to use a single
triple-quoted string. Assuming you are copy/pasting
the number from somewhere that will save a lot of your
time.


no, it seems that sone \n are inserted inside the number

>>> C = int("""
1234
5678""")

Traceback (most recent call last):
  File "", line 3, in 
5678""")
ValueError: invalid literal for int() with base 10: '\n1234\n5678'


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


[issue33125] Windows 10 ARM64 platform support

2018-03-23 Thread Steve Dower

Steve Dower  added the comment:

I'd like to see this as well, but just to set expectations, it can't be any 
earlier than 3.8 at this stage (for upstream support), and we need access to 
some real hardware to regularly run tests on.

That said, most of the changes you describe are on my list of things to do 
anyway. If you've done them and would like to submit a pull request (against 
master) then we'll happily take them now and include them in 3.7. But you'll 
still need to build the ARM versions yourself.

--
versions: +Python 3.8 -Python 3.6

___
Python tracker 

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



Re: Entering a very large number

2018-03-23 Thread ast

Le 23/03/2018 à 13:43, Rustom Mody a écrit :

On Friday, March 23, 2018 at 5:46:56 PM UTC+5:30, ast wrote:

Hi

I found this way to put a large number in
a variable.


What stops you from entering the number on one single (v long) line?



It is not beautiful and not very readable. It is better to
have a fixed number of digits per line (eg 50)

import this

Beautiful is better than ugly.
Readability counts.




In case there is a religious commitment to PEP 8 dicta, the recommended
meditation is this line (also from PEP8):

"However, know when to be inconsistent -- sometimes style guide recommendations just 
aren't applicable"



Yes I am using pylint which flags too long lines (80 characters)
--
https://mail.python.org/mailman/listinfo/python-list


Re: Entering a very large number

2018-03-23 Thread Wolfgang Maier

On 03/23/2018 01:30 PM, Wolfgang Maier wrote:

On 03/23/2018 01:16 PM, ast wrote:

Hi

I found this way to put a large number in
a variable.

C = int(
"28871482380507712126714295971303939919776094592797"
"22700926516024197432303799152733116328983144639225"
"94197780311092934965557841894944174093380561511397"
"4215424169339729054237110027510420801349667317"
"5515285922696291677532547505856101949404200039"
"90443211677661994962953925045269871932907037356403"
"22737012784538991261203092448414947289768854060249"
"76768122077071687938121709811322297802059565867")



A very simple improvement would be to use a single
triple-quoted string. Assuming you are copy/pasting
the number from somewhere that will save a lot of your
time.


Like this, for example:

n = int(
''.join("""
37107287533902102798797998220837590246510135740250
46376937677490009712648124896970078050417018260538
74324986199524741059474233309513058123726617309629
91942213363574161572522430563301811072406154908250
23067588207539346171171980310421047513778063246676
89261670696623633820136378418383684178734361726757
28112879812849979408065481931592621691275889832738
44274228917432520321923589422876796487670272189318
47451445736001306439091167216856844588711603153276
70386486105843025439939619828917593665686757934951
62176457141856560629502157223196586755079324193331
64906352462741904929101432445813822663347944758178
92575867718337217661963751590579239728245598838407
58203565325359399008402633568948830189458628227828
80181199384826282014278194139940567587151170094390
35398664372827112653829987240784473053190104293586
86515506006295864861532075273371959191420517255829
71693888707715466499115593487603532921714970056938
54370070576826684624621495650076471787294438377604
53282654108756828443191190634694037855217779295145
36123272525000296071075082563815656710885258350721
45876576172410976447339110607218265236877223636045
17423706905851860660448207621209813287860733969412
""".split())
)

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


[issue33041] Issues with "async for"

2018-03-23 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
pull_requests: +5946

___
Python tracker 

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



Re: Entering a very large number

2018-03-23 Thread Rustom Mody
On Friday, March 23, 2018 at 5:46:56 PM UTC+5:30, ast wrote:
> Hi
> 
> I found this way to put a large number in
> a variable.

What stops you from entering the number on one single (v long) line?

In case there is a religious commitment to PEP 8 dicta, the recommended 
meditation is this line (also from PEP8):

"However, know when to be inconsistent -- sometimes style guide recommendations 
just aren't applicable"
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue30953] Fatal python error when jumping into except clause

2018-03-23 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:


New changeset 397466dfd905b5132f1c831cd9dff3ecc40b3218 by Serhiy Storchaka in 
branch 'master':
bpo-30953: Improve error messages and add tests for jumping (GH-6196)
https://github.com/python/cpython/commit/397466dfd905b5132f1c831cd9dff3ecc40b3218


--

___
Python tracker 

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



[issue33041] Issues with "async for"

2018-03-23 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:


New changeset b9744e924ca07ba7db977e5958b91cd8db565632 by Serhiy Storchaka in 
branch '3.7':
bpo-33041: Fixed jumping if the function contains an "async for" loop. (GH-6154)
https://github.com/python/cpython/commit/b9744e924ca07ba7db977e5958b91cd8db565632


--

___
Python tracker 

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



  1   2   >