[issue25872] multithreading traceback KeyError when modifying file

2018-08-06 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

It seems there was a major refactor in traceback module with 
6bc2c1e7ebf359224e5e547f58ffc2c42cb36a39 where this was fixed in Python 3. 
Ignoring the KeyError seems reasonable to me.

Thanks

--
nosy: +xtreak

___
Python tracker 

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



[issue34296] Speed up python startup by pre-warming the vm

2018-08-06 Thread INADA Naoki


Change by INADA Naoki :


--
nosy: +inada.naoki
versions:  -Python 3.6, Python 3.7

___
Python tracker 

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



[issue34341] Appending to ZIP archive blows up existing Central Directory entries

2018-08-06 Thread Serhiy Storchaka


New submission from Serhiy Storchaka :

When the ZIP archive is opened for appending, it reads the Central Directory at 
opening and writes existing entries back at closing. The Zip64 Extra Field is 
appended to existing Extra Fields if necessary. This leads to increasing the 
size of the Extra Fields data every time when append to the ZIP archive. Since 
the total size of Extra Fields is limited by 0x bytes, this can cause the 
failure.

The proposed PR removes the Zip64 Extra Field before adding a new Zip64 Extra 
Field.

--
assignee: serhiy.storchaka
components: Library (Lib)
messages: 323181
nosy: alanmcintyre, serhiy.storchaka, twouters
priority: normal
severity: normal
status: open
title: Appending to ZIP archive blows up existing Central Directory entries
type: behavior
versions: Python 2.7, 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



[issue34342] Fix the broken links in CPythonVmInternals wiki page

2018-08-06 Thread Shahriyar Rzayev


New submission from Shahriyar Rzayev :

Please see:
https://wiki.python.org/moin/CPythonVmInternals

There are some links under "Particularly useful pieces of documentation: " 
which are broken and should be updated respectively as follows:

[Execution Model] -> https://docs.python.org/3/reference/executionmodel.html

[GIL] -> 
https://docs.python.org/3/c-api/init.html#thread-state-and-the-global-interpreter-lock
 or this one https://wiki.python.org/moin/GlobalInterpreterLock

[Bytecodes] -> Which is now can be found in 
https://docs.python.org/3/library/dis.html

[Disassembler] -> same here https://docs.python.org/3/library/dis.html

--
assignee: docs@python
components: Documentation
messages: 323182
nosy: docs@python, shako
priority: normal
severity: normal
status: open
title: Fix the broken links in CPythonVmInternals wiki page
type: enhancement

___
Python tracker 

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



[issue34296] Speed up python startup by pre-warming the vm

2018-08-06 Thread INADA Naoki


INADA Naoki  added the comment:

> i did 2 implementations in both python and pure bash, python takes about 
> 500ms to run while bash is more than 10 times faster.

VM startup + `import site` are done in 10~20ms on common Linux machine.
It won't take 500ms.

While Python VM startup is not lightning fast, library import time is much 
slower than VM startup in many cases.  And since "importing library" may have 
many important side effects, we can't "pre warm" it.

Have you tried `PYTHONPROFILEIMPORTTIME=1` environment variable added by Python 
3.7?
https://dev.to/methane/how-to-speed-up-python-application-startup-time-nkf

--

___
Python tracker 

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



[issue34341] Appending to ZIP archive blows up existing Central Directory entries

2018-08-06 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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

___
Python tracker 

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



[issue19891] Exiting Python REPL prompt with user without home directory throws error in atexit._run_exitfuncs

2018-08-06 Thread miss-islington


Change by miss-islington :


--
pull_requests: +8180

___
Python tracker 

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



[issue19891] Exiting Python REPL prompt with user without home directory throws error in atexit._run_exitfuncs

2018-08-06 Thread miss-islington


Change by miss-islington :


--
pull_requests: +8179

___
Python tracker 

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



[issue19891] Exiting Python REPL prompt with user without home directory throws error in atexit._run_exitfuncs

2018-08-06 Thread INADA Naoki


INADA Naoki  added the comment:


New changeset b2499669ef2e6dc9a2cdb49b4dc498e078167e26 by INADA Naoki (Anthony 
Sottile) in branch 'master':
bpo-19891: Ignore error while writing history file (GH-8483)
https://github.com/python/cpython/commit/b2499669ef2e6dc9a2cdb49b4dc498e078167e26


--
nosy: +inada.naoki

___
Python tracker 

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



[issue34342] Fix the broken links in CPythonVmInternals wiki page

2018-08-06 Thread Berker Peksag


Berker Peksag  added the comment:

Thanks for the report. wiki.python.org is maintained by the Python community, 
not by Python core developers. You can fix those broken links by creating an 
account and requesting edit access by emailing to pydotorg-...@python.org. See 
https://wiki.python.org/moin/FrontPage#Editing_pages for details.

--
nosy: +berker.peksag
resolution:  -> third party
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue19891] Exiting Python REPL prompt with user without home directory throws error in atexit._run_exitfuncs

2018-08-06 Thread miss-islington


miss-islington  added the comment:


New changeset 416f3435c536c5197f5c6a23504955cf717df200 by Miss Islington (bot) 
in branch '3.7':
bpo-19891: Ignore error while writing history file (GH-8483)
https://github.com/python/cpython/commit/416f3435c536c5197f5c6a23504955cf717df200


--
nosy: +miss-islington

___
Python tracker 

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



[issue19891] Exiting Python REPL prompt with user without home directory throws error in atexit._run_exitfuncs

2018-08-06 Thread miss-islington


miss-islington  added the comment:


New changeset e20d31cdb33bdfee68bce059f9a9c7ce71b035fe by Miss Islington (bot) 
in branch '3.6':
bpo-19891: Ignore error while writing history file (GH-8483)
https://github.com/python/cpython/commit/e20d31cdb33bdfee68bce059f9a9c7ce71b035fe


--

___
Python tracker 

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



[issue34343] Why is turtle still present in python embedded for Windows?

2018-08-06 Thread Vlad Tudorache


New submission from Vlad Tudorache :

I've just started using the embedded Python 3.6 for Windows and I find 
turtle.py in the archive, knowing that tkinter isn't present. There's no large 
space loss because of it, but it's presence may be confusing.

--
components: Library (Lib), Windows
messages: 323188
nosy: paul.moore, steve.dower, tim.golden, vtudorache, zach.ware
priority: normal
severity: normal
status: open
title: Why is turtle still present in python embedded for Windows?
type: resource usage
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



[issue19891] Exiting Python REPL prompt with user without home directory throws error in atexit._run_exitfuncs

2018-08-06 Thread INADA Naoki


Change by INADA Naoki :


--
components: +Library (Lib) -Extension Modules
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
versions: +Python 3.7, Python 3.8 -Python 3.3, Python 3.4

___
Python tracker 

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



[issue34296] Speed up python startup by pre-warming the vm

2018-08-06 Thread Cyker Way


Cyker Way  added the comment:

>   VM startup + `import site` are done in 10~20ms on common Linux machine.

>   While Python VM startup is not lightning fast, library import time is much 
> slower than VM startup in many cases.

In my tests, a helloworld python script generally takes about 30-40 ms, while a 
similar helloworld bash script takes about 3-4 ms. Adding some common library 
imports (`os`, `sys`, etc.), then the python script's running time goes up to 
60-70ms. I'm not sure how to compare this against bash because there are no 
library imports in bash. The 500ms (python) vs 50ms (bash) comparison is based 
on minimal implementations of the same simple job and meant to reflect the 
minimal amount of time needed for such a job in different languages. While it 
doesn't cover everything and may not even be fair enough, the result does match 
that of the helloworld test (10 times faster/slower). Plus, in your linked 
post, it shows importing pipenv takes about 700ms. Therefore I believe some 
hundreds of milliseconds are necessary for such scripts that do a simple but 
meaningful job.

I understand many things can happen while importing a library. But for a 
specific program, its imports are usually fixed and very much likely the same 
between runs. That's why I believe a zygote/fork/snapshot feature would still 
be helpful to help avoid the startup delay.

Finally, for simple and quick user scrips, the 30-40 ms startup time without 
any import statements may not be a huge problem, but it's still tangible and 
makes the program feel not that sleek.

--

___
Python tracker 

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



[issue34344] Fix the docstring for AbstractEventLoopPolicy.get_event_loop

2018-08-06 Thread Vlad Starostin


New submission from Vlad Starostin :

The docstring says "This may be None or an instance of EventLoop". But docs 
explicitly state that get_event_loop "must never return None". The same 
docstring is also in the example in docs: 
https://docs.python.org/3.6/library/asyncio-eventloops.html#customizing-the-event-loop-policy

I propose changing it to:

def get_event_loop(self):
"""Get the event loop.

Returns an instance of EventLoop or raises an exception.
"""

If the wording is ok, I'll make a PR.

--
assignee: docs@python
components: Documentation, asyncio
messages: 323190
nosy: asvetlov, docs@python, drtyrsa, yselivanov
priority: normal
severity: normal
status: open
title: Fix the docstring for AbstractEventLoopPolicy.get_event_loop
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



[issue34296] Speed up python startup by pre-warming the vm

2018-08-06 Thread INADA Naoki


INADA Naoki  added the comment:

> In my tests, a helloworld python script generally takes about 30-40 ms.
[snip]
> Finally, for simple and quick user scrips, the 30-40 ms startup time without 
> any import statements may not be a huge problem, but it's still tangible and 
> makes the program feel not that sleek.

What is your environment?
I optimized startup on Python 3.7, especially on macOS (it was very slow before 
3.7).

And some legacy features (e.g. legacy "namespace package" system from 
setuptools) will make startup much slower, because they import some heavy 
libraries silently even when you just run "hello world".

PYTHONPROFILEIMPORTTIME will help to find them too.  And venv allow to split 
out such legacy tools from your main Python environment.

> The 500ms (python) vs 50ms (bash) comparison is based on minimal 
> implementations of the same simple job and meant to reflect the minimal 
> amount of time needed for such a job in different languages. 

Would you give us some example script?

> Plus, in your linked post, it shows importing pipenv takes about 700ms. 
> Therefore I believe some hundreds of milliseconds are necessary for such 
> scripts that do a simple but meaningful job.

FYI, it compiles many regular expressions at startup time.
I want to add lazy compilation API to re module in 3.8.  (I'm waiting bpo-21145 
is implemented)

--

___
Python tracker 

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



[issue32797] Tracebacks from Cython modules no longer work

2018-08-06 Thread Erik Bray


Erik Bray  added the comment:

Brett:
> As Nick said, we have no generalized concept of source maps and I think
coming up with that is what will be required to solve this as i personally
don't view Loader.get_source() is not meant to be a generalized concept of
some form of source code but Python source code.

I see what you're saying here, but given that Loader can return Python modules 
that are ostensibly not actually generated from Python source code, then it's 
not *obvious* that Loader.get_source() must return Python source.  At the very 
least the documentation [1] should clarify this.  But it's also a bit 
arbitrarily limiting, especially given the demonstrable possibility of 
providing tracebacks and code inspection for *non-Python* code (as in the case 
of Cython) that compiles to Python modules.


Nick:
> 1. Enhance PathFinder to allow specification of which path importer cache and 
> path_hooks entries to use

This would be good.  Perhaps veering off-topic, but in an earlier attempt to 
fix this issue I actually tried to implement a sys.path_hooks hook for 
importing Cython modules such that I could provide an appropriate Loader for 
them with a get_source that actually works.  This turned out to be very 
difficult in large part due to the difficulty of customizing the relationship 
between the default PathFinder on sys.meta_path and the sys.path_hooks entries. 
 I made a post about this to python-ideas [2] but it never gained much 
traction, probably in large part due to the specialized nature of the problem 
and the complexity of my solution :)


[1] 
https://docs.python.org/3/library/importlib.html#importlib.abc.InspectLoader.get_source
[2] https://mail.python.org/pipermail/python-ideas/2018-February/048905.html

--

___
Python tracker 

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



[issue32797] Tracebacks from Cython modules no longer work

2018-08-06 Thread Erik Bray


Erik Bray  added the comment:

To add, while an enhancement just to linecache would make sense in its own 
right, I don't see the problem with also extending the Loader.get_source() API 
to be more useful as well.  Its current behavior is to just return a string (or 
None), but it seems to me one could keep that basic behavior, but also extend 
it to optionally return a more sophisticated source map data structure (that 
could involve multiple source files as well).

This could even be useful for built-in modules.  I would love, for example, to 
be able to get stack traces within extension modules integrated into Python 
tracebacks if they are compiled with some appropriate debug flags.  The case of 
Cython demonstrates that something like this is perfectly doable.

--

___
Python tracker 

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



[issue34296] Speed up python startup by pre-warming the vm

2018-08-06 Thread INADA Naoki


INADA Naoki  added the comment:

> I understand many things can happen while importing a library. But for a 
> specific program, its imports are usually fixed and very much likely the same 
> between runs. That's why I believe a zygote/fork/snapshot feature would still 
> be helpful to help avoid the startup delay.

I agree it can be useful.  It's different from your first post.  (Snapshot 
whole application, rather than just Python VM).
And this idea is discussed on Python-dev ML several times.

But I think it can be implemented as 3rd party tool at first.  It is better 
because (1) we can battle test the idea before adding it to stdlib, and (2) we 
can use the tool even for Python 3.7.

--

___
Python tracker 

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



[issue34296] Speed up python startup by pre-warming the vm

2018-08-06 Thread Cyker Way


Cyker Way  added the comment:

It was tested on a x86_64 Linux system. The machine is not quite new but is OK 
for building and running python. The test script is actually a management tool 
for a larger project that is not released in public so I don't have right to 
disclose it here. When tested on python 3.7 it did run faster than python 3.6 
so there were indeed great improvements.

While optimizing standard libraries definitely makes the program start up 
faster, we should also note that each user program also has its own specific 
initialization procedure. This is in general out of control of language 
platform developers, but forking a user-initialized vm or using a snapshot 
chosen by the user still helps.

--

___
Python tracker 

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



[issue32797] Tracebacks from Cython modules no longer work

2018-08-06 Thread Erik Bray


Erik Bray  added the comment:

> To do that, I believe it can be made to work in much the same way it did in 
> Python 2 if SageMath were to do the following:
>
> 1. Define a subclass of ExtensionModuleLoader [1] that overrides get_source() 
> to also look for a ".pyx" file adjacent to the extension module. This would 
> also look for any of the file suffixes in SOURCE_SUFFIXES if a .pyx file 
> isn't found.
> 2. Create an instance of FileFinder [3] that uses the custom loader subclass 
> for any of the file suffixes in EXTENSION_SUFFIXES [4]
> 3. Replace the regular file finding hook in sys.path_hooks with  the 
> path_hook method from that new FileFinder instance (by default, there's only 
> one FileFinder hook installed, and it can currently be identified as 
> "obj.__name__ == 'path_hook_for_FileFinder')
> 4. Invalidate importlib's caches, so any future extension module imports will 
> use the custom extension module loader, rather than the default one

This is pretty edifying, because Nick's idea is almost exactly what I did six 
months ago :)  
https://git.sagemath.org/sage.git/diff/?id2=0a674fd488dcd7cb779101d263c10a874a13cf77&id=8b63abe731c510f0de9ef0e3ab9a0bda3669dce1

Turned out to be very non-trivial of course, and I believe it should not have 
been as complicated as it was.

It also still doesn't solve the problem that Loader.get_source does not support 
multiple source files, which Cython code may have (a .pyx and a .pxd being a 
common case).  I'm glad Paul Moore seems to also agree (now that I've actually 
read the rest of the thread) that the ExtensionLoader.get_source, at the very 
least, could be made more useful.  Whatever form that takes would be worth 
extending to other loaders that implement get_source as well...

--

___
Python tracker 

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



[issue32797] Tracebacks from Cython modules no longer work

2018-08-06 Thread Stefan Behnel


Stefan Behnel  added the comment:

Or, define a new "get_sourcemap()" method that could return additional 
metadata, e.g. a line number mapping.

--

___
Python tracker 

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



[issue32797] Tracebacks from Cython modules no longer work

2018-08-06 Thread Jeroen Demeyer


Jeroen Demeyer  added the comment:

> I would love, for example, to be able to get stack traces within extension 
> modules integrated into Python tracebacks if they are compiled with some 
> appropriate debug flags.

Awesome idea, I want to work on that :-)

This should be possible using the backtrace() and backtrace_symbols() 
functions, which exist at least in GNU libc and on OSX.

--

___
Python tracker 

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



[issue34345] Add tests for PEP 468 and PEP 520

2018-08-06 Thread Serhiy Storchaka


New submission from Serhiy Storchaka :

AFAIK there no purposed tests for PEP 468 and PEP 520. If making dict not 
preserving order, noting related to these PEPs is failed.

I think we need explicit tests for PEP 468 and PEP 520. At least in 3.6 the 
dict order is not guaranteed. And even in 3.7+ preserving the dict order 
doesn't guarantee implementing PEP 468 and PEP 520. The order can be broken in 
a meanwhile (for example by iterating a list of keys in the reversed order).

--
components: Tests
messages: 323199
nosy: eric.snow, serhiy.storchaka
priority: normal
severity: normal
status: open
title: Add tests for PEP 468 and PEP 520
type: enhancement
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



[issue34320] Creating dict from OrderedDict doesn't preserve order

2018-08-06 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
dependencies: +Add tests for PEP 468 and PEP 520

___
Python tracker 

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



[issue32797] Tracebacks from Cython modules no longer work

2018-08-06 Thread Jeroen Demeyer


Jeroen Demeyer  added the comment:

> Or, define a new "get_sourcemap()" method that could return additional 
> metadata, e.g. a line number mapping.

What's your use case for that? I am asking because it might make more sense for 
get_source() (or whatever its replacement is) to return the already-mapped 
sources.

--

___
Python tracker 

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



[issue34273] %f is confusingly associated with fixed point format

2018-08-06 Thread Terry J. Reedy


Terry J. Reedy  added the comment:


New changeset 28c7f8c8ce34a0cb848822a252a9d0a761fb42d5 by Terry Jan Reedy in 
branch 'master':
bpo-34273: Change 'Fixed point' to 'Fixed-point notation'. (#8673)
https://github.com/python/cpython/commit/28c7f8c8ce34a0cb848822a252a9d0a761fb42d5


--

___
Python tracker 

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



[issue34273] %f is confusingly associated with fixed point format

2018-08-06 Thread miss-islington


Change by miss-islington :


--
pull_requests: +8182

___
Python tracker 

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



[issue34273] %f is confusingly associated with fixed point format

2018-08-06 Thread miss-islington


Change by miss-islington :


--
pull_requests: +8181

___
Python tracker 

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



[issue34273] %f is confusingly associated with fixed point format

2018-08-06 Thread miss-islington


miss-islington  added the comment:


New changeset e39fb207f26f8007e95fcf120f5ff1cb7372791a by Miss Islington (bot) 
in branch '3.7':
bpo-34273: Change 'Fixed point' to 'Fixed-point notation'. (GH-8673)
https://github.com/python/cpython/commit/e39fb207f26f8007e95fcf120f5ff1cb7372791a


--
nosy: +miss-islington

___
Python tracker 

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



[issue34273] %f is confusingly associated with fixed point format

2018-08-06 Thread miss-islington


miss-islington  added the comment:


New changeset ed8dd598ae7e0d944974af0fd73c2fbb6105fd5c by Miss Islington (bot) 
in branch '3.6':
bpo-34273: Change 'Fixed point' to 'Fixed-point notation'. (GH-8673)
https://github.com/python/cpython/commit/ed8dd598ae7e0d944974af0fd73c2fbb6105fd5c


--

___
Python tracker 

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



[issue34273] %f is confusingly associated with fixed point format

2018-08-06 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
pull_requests: +8183

___
Python tracker 

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



[issue34273] %f is confusingly associated with fixed point format

2018-08-06 Thread Terry J. Reedy


Terry J. Reedy  added the comment:


New changeset 9027502e99cba700cadb675b3b2db03c311d1c4d by Terry Jan Reedy in 
branch '2.7':
[2.7] bpo-34273: Change 'Fixed point' to 'Fixed-point notation'. (GH-8673)
https://github.com/python/cpython/commit/9027502e99cba700cadb675b3b2db03c311d1c4d


--

___
Python tracker 

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



[issue34273] %f is confusingly associated with fixed point format

2018-08-06 Thread Terry J. Reedy


Change by Terry J. Reedy :


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



[issue34236] Test6012 in test_capi is not run as part of make test

2018-08-06 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 7e4ff9796cb2c5b64307a2bd928e35930e3f1b2a by Serhiy Storchaka 
(Zackery Spytz) in branch '2.7':
[2.7] bpo-34236: Remove mistakenly backported Test6012 in test_capi.py. 
(GH-8681)
https://github.com/python/cpython/commit/7e4ff9796cb2c5b64307a2bd928e35930e3f1b2a


--

___
Python tracker 

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



[issue34236] Test6012 in test_capi is not run as part of make test

2018-08-06 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Thanks Karthikeyan and Zackery!

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



[issue34272] Reorganize C API tests

2018-08-06 Thread miss-islington


Change by miss-islington :


--
pull_requests: +8184

___
Python tracker 

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



[issue34272] Reorganize C API tests

2018-08-06 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 8f7bb100d0fa7fb2714f3953b5b627878277c7c6 by Serhiy Storchaka in 
branch 'master':
bpo-34272: Move argument parsing tests from test_capi to test_getargs2. 
(GH-8567)
https://github.com/python/cpython/commit/8f7bb100d0fa7fb2714f3953b5b627878277c7c6


--

___
Python tracker 

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



[issue34346] dir() hangs interpreter

2018-08-06 Thread Chris Fuller


New submission from Chris Fuller :

It's a little obscure. Nothing to get alarmed about, probably. It involves 
recursion and __getattr__() during object creation.

Only present with 2.7 new-style classes. Old-style 2.7 did not exhibit this 
behavior nor did 3.x. Checked on Linux/Cygwin/Windows.

--
files: splat.py
messages: 323208
nosy: sfaleron
priority: normal
severity: normal
status: open
title: dir() hangs interpreter
type: crash
versions: Python 2.7
Added file: https://bugs.python.org/file47731/splat.py

___
Python tracker 

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



[issue34272] Reorganize C API tests

2018-08-06 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
pull_requests: +8185

___
Python tracker 

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



[issue34272] Reorganize C API tests

2018-08-06 Thread miss-islington


miss-islington  added the comment:


New changeset a1ff5f9031dc81b2c368def037fc0e88f5bc48b7 by Miss Islington (bot) 
in branch '3.7':
bpo-34272: Move argument parsing tests from test_capi to test_getargs2. 
(GH-8567)
https://github.com/python/cpython/commit/a1ff5f9031dc81b2c368def037fc0e88f5bc48b7


--
nosy: +miss-islington

___
Python tracker 

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



[issue34272] Reorganize C API tests

2018-08-06 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 278d975ce158608f6be491c561247d4701c842be by Serhiy Storchaka in 
branch '3.6':
[3.6] bpo-34272: Move argument parsing tests from test_capi to test_getargs2. 
(GH-8567). (GH-8690)
https://github.com/python/cpython/commit/278d975ce158608f6be491c561247d4701c842be


--

___
Python tracker 

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



[issue34272] Reorganize C API tests

2018-08-06 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
pull_requests: +8186

___
Python tracker 

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



[issue34272] Reorganize C API tests

2018-08-06 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset d1c5e278a1a2458bc5efcdc300c17f9e39a59b6c by Serhiy Storchaka in 
branch '2.7':
[2.7] bpo-34272: Move argument parsing tests from test_capi to test_getargs2. 
(GH-8567). (GH-8691)
https://github.com/python/cpython/commit/d1c5e278a1a2458bc5efcdc300c17f9e39a59b6c


--

___
Python tracker 

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



[issue34346] dir() hangs interpreter

2018-08-06 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

I don't think the description you give is very accurate. The description in the 
file splat.py says:

"Hangs/core dumps Python2 when instantiated"

(which is it? hang or core dump?)

but I can't replicate that. Instantiating A() is fine for me. (Tested in Python 
2.7 on Linux.)

The whole business about "splat" is amusing but irrelevant. I can replicate the 
hang (no core dump) using this simpler example:

class B:
def __getattr__(self, name):
return name in dir(self)


Instantiating the class is fine, but calling dir() on it locks up:

>>> b = B()
>>> dir(b)

[1]+  Stopped python2.7 -E

(after typing Ctrl-Z in the xterm). Notice that B is an old-style class in this 
example. The same behaviour also occurs when inheriting from object.

--
nosy: +steven.daprano

___
Python tracker 

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



[issue33802] Regression in logging configuration

2018-08-06 Thread Steap


Steap  added the comment:

It seems like this regression has not completely been fixed: there are still 
issues with "None":

$ python3.6 -c 'import configparser; configparser.ConfigParser(defaults={"a": 
None})'

$ python3.7 -c 'import configparser; configparser.ConfigParser(defaults={"a": 
1})'

$ python3.7 -c 'import configparser; configparser.ConfigParser(defaults={"a": 
None})'
Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/lib/python3.7/configparser.py", line 638, in __init__
self._read_defaults(defaults)
  File "/usr/lib/python3.7/configparser.py", line 1216, in _read_defaults
self.read_dict({self.default_section: defaults})
  File "/usr/lib/python3.7/configparser.py", line 753, in read_dict
self.set(section, key, value)
  File "/usr/lib/python3.7/configparser.py", line 1197, in set
self._validate_value_types(option=option, value=value)
  File "/usr/lib/python3.7/configparser.py", line 1182, in _validate_value_types
raise TypeError("option values must be strings")
TypeError: option values must be strings

Should "None" not be used, or should this bug be reopened?

--
nosy: +Steap

___
Python tracker 

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



[issue34347] AIX: test_utf8_mode.test_cmd_line fails

2018-08-06 Thread Michael Felt


New submission from Michael Felt :

The test fails because

byte_str.decode('ascii', 'surragateescape')

is not what ascii(byte_str) - returns when called from the commandline.

Assumption: since " check('utf8', [arg_utf8])" succeeds I assume the parsing of 
the command-line is correct.

DETAILS
>>> arg = 'h\xe9\u20ac'.encode('utf-8')
>>> arg
b'h\xc3\xa9\xe2\x82\xac'

>>> arg.decode('ascii', 'surrogateescape')
'h\udcc3\udca9\udce2\udc82\udcac'


I am having a difficult time getting the syntax correct for all the "escapes", 
so I added a print statement in the check routine:

test_cmd_line (test.test_utf8_mode.UTF8ModeTests) ...
code:import locale, sys; print("%s:%s" % (locale.getpreferredencoding(), 
ascii(sys.argv[1:]))) arg:b'h\xc3\xa9\xe2\x82\xac'
out:UTF-8:['h\xe9\u20ac']

code:import locale, sys; print("%s:%s" % (locale.getpreferredencoding(), 
ascii(sys.argv[1:]))) arg:b'h\xc3\xa9\xe2\x82\xac'
out:ISO8859-1:['h\xc3\xa9\xe2\x82\xac']

test code with my debug statement (to generate above):

def test_cmd_line(self):
arg = 'h\xe9\u20ac'.encode('utf-8')
arg_utf8 = arg.decode('utf-8')
arg_ascii = arg.decode('ascii', 'surrogateescape')
code = 'import locale, sys; print("%s:%s" % 
(locale.getpreferredencoding(), ascii(sys.argv[1:])))'

def check(utf8_opt, expected, **kw):
out = self.get_output('-X', utf8_opt, '-c', code, arg, **kw)
print("\ncode:%s arg:%s\nout:%s" % (code, arg, out))
args = out.partition(':')[2].rstrip()
self.assertEqual(args, ascii(expected), out)

check('utf8', [arg_utf8])
if sys.platform == 'darwin' or support.is_android:
c_arg = arg_utf8
else:
c_arg = arg_ascii
check('utf8=0', [c_arg], LC_ALL='C')

So the first check succeeds:

check('utf8', [arg_utf8])

But the second does not:

FAIL: test_cmd_line (test.test_utf8_mode.UTF8ModeTests)
--
Traceback (most recent call last):
  File "/data/prj/python/src/python3-3.7.0/Lib/test/test_utf8_mode.py", line 
225, in test_cmd_line
check('utf8=0', [c_arg], LC_ALL='C')
  File "/data/prj/python/src/python3-3.7.0/Lib/test/test_utf8_mode.py", line 
218, in check
self.assertEqual(args, ascii(expected), out)
AssertionError: "['h\\xc3\\xa9\\xe2\\x82\\xac']" != 
"['h\\udcc3\\udca9\\udce2\\udc82\\udcac']"
- ['h\xc3\xa9\xe2\x82\xac']
+ ['h\udcc3\udca9\udce2\udc82\udcac']
 : ISO8859-1:['h\xc3\xa9\xe2\x82\xac']

I tried saying the "expected" is arg, but arg is still a byte object, the 
cmd_line result is not (printed as such).

AssertionError: "['h\\xc3\\xa9\\xe2\\x82\\xac']" != 
"[b'h\\xc3\\xa9\\xe2\\x82\\xac']"
- ['h\xc3\xa9\xe2\x82\xac']
+ [b'h\xc3\xa9\xe2\x82\xac']
?  +
 : ISO8859-1:['h\xc3\xa9\xe2\x82\xac']

--
components: Interpreter Core, Tests
messages: 323214
nosy: Michael.Felt
priority: normal
severity: normal
status: open
title: AIX: test_utf8_mode.test_cmd_line fails
type: behavior
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



[issue34348] Python 3.7 - Issues Installing Scikit Learn

2018-08-06 Thread Abhishek Reddy


New submission from Abhishek Reddy :

Hi

I am currently encountering below issues when trying to install any version of 
Scikit Learn (0.19.0 or 0.19.1 or 0.19.2)

Python Version - 3.7

/usr/local/bsb-python37 - Custom Location in which I configured and installed 
Python 3.7

I have installed all the prerequisite - OS packages - bias-devel , lapack-devel 
, atlas-devel. 

Earlier when I installed Python 2.7 I didn't run into any issues. Now when I 
re-try to install the scikit learn under Python 2.7 I am running into the same 
issue and the earlier successful installed version of scikit learn is corrupted.

Error
# /usr/local/bsb-python37/bin/python3.7 setup.py install 
--prefix=/usr/local/bsb-python37
Partial import of sklearn during the build process.
blas_opt_info:
blas_mkl_info:
customize UnixCCompiler
  libraries mkl_rt not found in ['/usr/local/bsb-python37/lib', 
'/usr/local/lib64', '/usr/local/lib', '/usr/lib64', '/usr/lib', '/usr/lib/']
  NOT AVAILABLE

blis_info:
customize UnixCCompiler
  libraries blis not found in ['/usr/local/bsb-python37/lib', 
'/usr/local/lib64', '/usr/local/lib', '/usr/lib64', '/usr/lib', '/usr/lib/']
  NOT AVAILABLE

  error: Command "g++ -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g 
-fwrapv -O3 -Wall -fPIC 
-I/usr/local/bsb-python37/lib/python3.7/site-packages/numpy-1.14.5-py3.7-linux-x86_64.egg/numpy/core/include
 
-I/usr/local/bsb-python37/lib/python3.7/site-packages/numpy-1.14.5-py3.7-linux-x86_64.egg/numpy/core/include
 -I/usr/local/bsb-python37/include/python3.7m -c 
sklearn/cluster/_dbscan_inner.cpp -o 
build/temp.linux-x86_64-3.7/sklearn/cluster/_dbscan_inner.o -MMD -MF 
build/temp.linux-x86_64-3.7/sklearn/cluster/_dbscan_inner.o.d" failed with exit 
status 1

Any help is greatly appreciated. I tried to google around and did all that I 
could try. No luck.

Thanks,
Abhishek

--
components: Installation
messages: 323215
nosy: abhishekreddyc
priority: normal
severity: normal
status: open
title: Python 3.7 - Issues Installing Scikit Learn
type: compile error
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



[issue24218] Also support SMTPUTF8 in smtplib's send_message method.

2018-08-06 Thread Jens Troeger

Jens Troeger  added the comment:

David, I tried to find the mentioned '\r\r…\n' issue but I could not find it 
here. However, from an initial investigation into the BytesGenerator, here is 
what’s happening.

Flattening the body and attachments of the EmailMessage object works, and 
eventually _write_headers() is called to flatten the headers which happens 
entry by entry 
(https://github.com/python/cpython/blob/master/Lib/email/generator.py#L417-L418).
 Flattening a header entry is a recursive process over the parse tree of the 
entry, which builds the flattened and encoded final string by descending into 
the parse tree and encoding & concatenating the individual “parts” (tokens of 
the header entry).

Given the parse tree for a header entry like "Martín Córdoba " 
eventually results in the correct flattened string:

'=?utf-8?q?Mart=C3=ADn_C=C3=B3rdoba?= \r\n'

at the bottom of the recursion for this “Mailbox” part. The recursive callstack 
is then:

_refold_parse_tree _header_value_parser.py:2687
fold [Mailbox] _header_value_parser.py:144
_refold_parse_tree _header_value_parser.py:2630
fold [Address] _header_value_parser.py:144
_refold_parse_tree _header_value_parser.py:2630
fold [AddressList] _header_value_parser.py:144
_refold_parse_tree _header_value_parser.py:2630
fold [Header] _header_value_parser.py:144
fold [_UniqueAddressHeader] headerregistry.py:258
_fold [EmailPolicy] policy.py:205
fold_binary [EmailPolicy] policy.py:199
_write_headers [BytesGenerator] generator.py:418
_write [BytesGenerator] generator.py:195

The problem now arises from the interplay of 

# 
https://github.com/python/cpython/blob/master/Lib/email/_header_value_parser.py#L2629
encoded_part = part.fold(policy=policy)[:-1] # strip nl

which strips the '\n' from the returned string, and

# 
https://github.com/python/cpython/blob/master/Lib/email/_header_value_parser.py#L2686
return policy.linesep.join(lines) + policy.linesep

which adds the policy’s line separation string linesep="\r\n" to the end of the 
flattened string upon unrolling the recursion.

I am not sure about a proper fix here, but considering that the linesep policy 
can be any string length (in this case len("\r\n") == 2) a fixed truncation of 
one character [:-1] seems wrong. Instead, using:

encoded_part = part.fold(policy=policy)[:-len(policy.linesep)] # strip nl

seems to work for entries with and without Unicode characters in their display 
names.

David, please advise on how to proceed from here.

--

___
Python tracker 

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



[issue2122] mmap.flush does not check for errors on windows

2018-08-06 Thread Berker Peksag


Change by Berker Peksag :


--
pull_requests: +8187

___
Python tracker 

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



[issue34349] asyncio.wait should accept generator of tasks as first argument

2018-08-06 Thread Nic Watson


New submission from Nic Watson :

Currently, passing a generator of coroutines or futures as the first parameter 
of asyncio.wait raises a TypeError.  This is in conflict with the documentation 
calling the first parameter a "sequence".

Line in question. 
https://github.com/python/cpython/blob/3.7/Lib/asyncio/tasks.py#L347

Generators are indeed coroutines, so the check to validate that the first 
parameter is not a coroutine or a future is too specific.

I'd suggest replacing that line with a check that the passed-in parameter is 
iterable, i.e. hasattr(futures, __iter__).

--
components: asyncio
messages: 323217
nosy: asvetlov, jnwatson, yselivanov
priority: normal
severity: normal
status: open
title: asyncio.wait should accept generator of tasks as first argument
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



[issue34346] dir() hangs interpreter

2018-08-06 Thread Chris Fuller


Change by Chris Fuller :


Removed file: https://bugs.python.org/file47731/splat.py

___
Python tracker 

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



[issue34346] dir() hangs interpreter

2018-08-06 Thread Chris Fuller


Change by Chris Fuller :


Added file: https://bugs.python.org/file47732/splat.py

___
Python tracker 

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



[issue34346] dir() hangs interpreter

2018-08-06 Thread Chris Fuller


Chris Fuller  added the comment:

It hangs, and on Cygwin it dumped core when I hit ctrl-break. I uploaded a 
revised script. It';s a heisenbug, all I did was removed the unused splat 
method.

--

___
Python tracker 

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



[issue34319] Clarify pathlib.Path("filepath").read_text()

2018-08-06 Thread Terry J. Reedy


Terry J. Reedy  added the comment:


New changeset 5b2657fb8c5aaa98e5748e1c325c74b97ea12fd1 by Terry Jan Reedy 
(Xtreak) in branch 'master':
bpo-34319: Clarify file handler closure in pathlib.read_text (GH-8645)
https://github.com/python/cpython/commit/5b2657fb8c5aaa98e5748e1c325c74b97ea12fd1


--

___
Python tracker 

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



[issue34319] Clarify pathlib.Path("filepath").read_text()

2018-08-06 Thread miss-islington


Change by miss-islington :


--
pull_requests: +8189

___
Python tracker 

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



[issue34319] Clarify pathlib.Path("filepath").read_text()

2018-08-06 Thread miss-islington


Change by miss-islington :


--
pull_requests: +8188

___
Python tracker 

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



[issue34319] Clarify pathlib.Path("filepath").read_text()

2018-08-06 Thread miss-islington


miss-islington  added the comment:


New changeset 1c6df83e9318ab4ef8e32b805b8226b1324e1ffd by Miss Islington (bot) 
in branch '3.7':
bpo-34319: Clarify file handler closure in pathlib.read_text (GH-8645)
https://github.com/python/cpython/commit/1c6df83e9318ab4ef8e32b805b8226b1324e1ffd


--
nosy: +miss-islington

___
Python tracker 

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



[issue34319] Clarify pathlib.Path("filepath").read_text()

2018-08-06 Thread miss-islington


miss-islington  added the comment:


New changeset 3da5c5c76d90ddfc4c188cc801d9387501b63b7f by Miss Islington (bot) 
in branch '3.6':
bpo-34319: Clarify file handler closure in pathlib.read_text (GH-8645)
https://github.com/python/cpython/commit/3da5c5c76d90ddfc4c188cc801d9387501b63b7f


--

___
Python tracker 

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



[issue34347] AIX: test_utf8_mode.test_cmd_line fails

2018-08-06 Thread Michael Felt


Michael Felt  added the comment:

In short, I do not understand how this passes on Linux.

This is python3-3.4.6 on sles12:

>>> 'h\xe9\u20ac'.encode('utf-8')
b'h\xc3\xa9\xe2\x82\xac'
>>> ascii('h\xe9\u20ac'.encode('utf-8'))
"b'h\\xc3\\xa9\\xe2\\x82\\xac'"
>>> 'h\xe9\u20ac'.encode('utf-8').decode('us-ascii', 'surrogateescape')
'h\udcc3\udca9\udce2\udc82\udcac'
>>>

This is python3-3.7.0 on AIX:
>>> 'h\xe9\u20ac'.encode('utf-8')
b'h\xc3\xa9\xe2\x82\xac'
>>> ascii('h\xe9\u20ac'.encode('utf-8'))
"b'h\\xc3\\xa9\\xe2\\x82\\xac'"
>>> 'h\xe9\u20ac'.encode('utf-8').decode('us-ascii', 'surrogateescape')
'h\udcc3\udca9\udce2\udc82\udcac'

If I am missing something essential here - please be blunt!

--

___
Python tracker 

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



[issue34347] AIX: test_utf8_mode.test_cmd_line fails

2018-08-06 Thread Michael Felt

Michael Felt  added the comment:

On 8/6/2018 10:10 PM, Michael Felt wrote:
> Michael Felt  added the comment:
>
> In short, I do not understand how this passes on Linux.
>
> This is python3-3.4.6 on sles12:
>
 'h\xe9\u20ac'.encode('utf-8')
> b'h\xc3\xa9\xe2\x82\xac'
 ascii('h\xe9\u20ac'.encode('utf-8'))
> "b'h\\xc3\\xa9\\xe2\\x82\\xac'"
 'h\xe9\u20ac'.encode('utf-8').decode('us-ascii', 'surrogateescape')
> 'h\udcc3\udca9\udce2\udc82\udcac'
> This is python3-3.7.0 on AIX:
 'h\xe9\u20ac'.encode('utf-8')
> b'h\xc3\xa9\xe2\x82\xac'
 ascii('h\xe9\u20ac'.encode('utf-8'))
> "b'h\\xc3\\xa9\\xe2\\x82\\xac'"
 'h\xe9\u20ac'.encode('utf-8').decode('us-ascii', 'surrogateescape')
> 'h\udcc3\udca9\udce2\udc82\udcac'
>
> If I am missing something essential here - please be blunt!
Also seeing the same with Windows.
C:\Users\MICHAELFelt>python
Python 3.7.0 (v3.7.0:1bf9cc5093, Jun 27 2018, 04:06:47) [MSC v.1914 32
bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> 'h\xe9\u20ac'.encode('utf-8')
b'h\xc3\xa9\xe2\x82\xac'
>>> ascii('h\xe9\u20ac'.encode('utf-8'))
"b'h\\xc3\\xa9\\xe2\\x82\\xac'"
>>> 'h\xe9\u20ac'.encode('utf-8').decode('ascii','surrogateescape')
'h\udcc3\udca9\udce2\udc82\udcac'
>>>
>
> --
>
> ___
> Python tracker 
> 
> ___
>

--
Added file: https://bugs.python.org/file47733/pEpkey.asc

___
Python tracker 

___

pEpkey.asc
Description: application/pgp-keys
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34350] Non obvious logging handler behaviour

2018-08-06 Thread Sebastian


New submission from Sebastian :

In Python 3.6.3 I can do:

import logging
logger = logging.getLogger()
logger.setLevel(logging.INFO)
logger.info("this does not work")
logging.info("PARTY")
logger.info("this works")

And it outputs:

INFO:root:PARTY
INFO:root:this works


The line 
logging.info("PARTY") 
seems to add a handler which makes the last line work. This is very confusing 
behavior as it is not obvious that a call to "logging.info" mutates the state 
of the logging subsystem and affects subsequent logging calls.

--
components: Library (Lib)
messages: 323224
nosy: oneofthose
priority: normal
severity: normal
status: open
title: Non obvious logging handler behaviour
versions: Python 3.6, Python 3.7

___
Python tracker 

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



[issue27186] add os.fspath()

2018-08-06 Thread Erik Janssens


Erik Janssens  added the comment:

is there a particular reason for PyOS_FSPath to live in posixmodule.c

since Objects/unicodeobject.c uses this function, this makes it not possible to 
compile Python without a posixmodule.

this makes it difficult to compile a 'core' python on a new platform, since 
implementing the posixmodule on a new platform is not trivial.

also the documentation on porting mentions that one should first port python 
without a posixmodule.

--
nosy: +erikjanss

___
Python tracker 

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



[issue34284] Nonsensical exception message when calling `__new__` on non-instaniable objects

2018-08-06 Thread Vadim Pushtaev


Vadim Pushtaev  added the comment:

Sorry for the delay, I'm still working on a new PR.

--

___
Python tracker 

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



[issue34350] Non obvious logging handler behaviour

2018-08-06 Thread Mark Dickinson


Mark Dickinson  added the comment:

The behaviour is long-standing and documented, in the note just under this 
entry: 
https://docs.python.org/3/library/logging.html?highlight=logging#logging.log

But I do agree that it's surprising and (at least for me) undesirable 
behaviour, in that it makes it way too easy to accidentally configure logging 
in library code, which is a no-no according to most logging "best practices" 
advice. (Applications do logging configuration; libraries should usually 
confine themselves to creating loggers and emitting log messages.)

But I suspect it would be rather hard to change now.

--
nosy: +mark.dickinson

___
Python tracker 

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



[issue2122] mmap.flush does not check for errors on windows

2018-08-06 Thread Mark Lawrence


Change by Mark Lawrence :


--
nosy:  -BreamoreBoy

___
Python tracker 

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



[issue34349] asyncio.wait should accept generator of tasks as first argument

2018-08-06 Thread epiphyte


Change by epiphyte :


--
nosy: +epiphyte

___
Python tracker 

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



[issue27186] add os.fspath()

2018-08-06 Thread Brett Cannon


Brett Cannon  added the comment:

On Mon, Aug 6, 2018, 13:56 Erik Janssens,  wrote:

>
> Erik Janssens  added the comment:
>
> is there a particular reason for PyOS_FSPath to live in posixmodule.c
>

It's there because the C API for the os module is kept in that module.

--

___
Python tracker 

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



[issue31047] Windows: os.path.isabs(os.path.abspath(" ")) == False

2018-08-06 Thread Steve Dower


Steve Dower  added the comment:


New changeset b0bf51b32240369ccb736dc32ff82bb96f375402 by Steve Dower in branch 
'3.6':
bpo-31047: Fix ntpath.abspath for invalid paths (GH-8544)
https://github.com/python/cpython/commit/b0bf51b32240369ccb736dc32ff82bb96f375402


--

___
Python tracker 

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



[issue34343] Why is turtle still present in python embedded for Windows?

2018-08-06 Thread Steve Dower


Steve Dower  added the comment:

No particular reason. Just needs to be added to EXCLUDE_FILE_FROM_LIBRARY in 
Tools/msi/make_zip.py

--

___
Python tracker 

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



[issue31047] Windows: os.path.isabs(os.path.abspath(" ")) == False

2018-08-06 Thread Steve Dower


Change by Steve Dower :


--
assignee:  -> steve.dower
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



[issue18540] imaplib.IMAP4() ends with "Name or service not known" on Fedora 18

2018-08-06 Thread Berker Peksag


Berker Peksag  added the comment:


New changeset e4dcbbd7f4ac18d01c0ec85f64ae98b8281ed403 by Berker Peksag in 
branch 'master':
bpo-18540: Fix EAI_NONAME in imaplib.IMAP4*() (GH-8634)
https://github.com/python/cpython/commit/e4dcbbd7f4ac18d01c0ec85f64ae98b8281ed403


--

___
Python tracker 

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



[issue18540] imaplib.IMAP4() ends with "Name or service not known" on Fedora 18

2018-08-06 Thread miss-islington


Change by miss-islington :


--
pull_requests: +8191

___
Python tracker 

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



[issue18540] imaplib.IMAP4() ends with "Name or service not known" on Fedora 18

2018-08-06 Thread miss-islington


Change by miss-islington :


--
pull_requests: +8190

___
Python tracker 

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



[issue18540] imaplib.IMAP4() ends with "Name or service not known" on Fedora 18

2018-08-06 Thread Berker Peksag


Berker Peksag  added the comment:


New changeset 5799e5a84c78eac672e5f5f4f3fd2d903ba51a9d by Berker Peksag (Miss 
Islington (bot)) in branch '3.7':
bpo-18540: Fix EAI_NONAME in imaplib.IMAP4*() (GH-8634)
https://github.com/python/cpython/commit/5799e5a84c78eac672e5f5f4f3fd2d903ba51a9d


--

___
Python tracker 

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



[issue18540] imaplib.IMAP4() ends with "Name or service not known" on Fedora 18

2018-08-06 Thread Berker Peksag


Berker Peksag  added the comment:


New changeset 671a13a7b6ff1022a6fd868e5842687123ab9fd1 by Berker Peksag (Miss 
Islington (bot)) in branch '3.6':
bpo-18540: Fix EAI_NONAME in imaplib.IMAP4*() (GH-8634)
https://github.com/python/cpython/commit/671a13a7b6ff1022a6fd868e5842687123ab9fd1


--

___
Python tracker 

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



[issue18540] imaplib.IMAP4() ends with "Name or service not known" on Fedora 18

2018-08-06 Thread Berker Peksag


Change by Berker Peksag :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
versions: +Python 3.7, Python 3.8 -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



[issue34296] Speed up python startup by pre-warming the vm

2018-08-06 Thread INADA Naoki


INADA Naoki  added the comment:

* While this issue is "pre warming VM", VM startup is not significant part of 
your 500ms.
* You're talking about application specific strategy now.  It's different of 
this issue.

And many ideas like yours are already discussed on ML, again and again.  I feel 
nothing is new or concrete.  It's not productive at all.

I want to close this issue.  Please give us more concrete idea or patch with 
target sample application you want to optimize.

--

___
Python tracker 

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



[issue31689] random.choices does not work with negative weights

2018-08-06 Thread David Kopec


David Kopec  added the comment:

It's not a bug, but I agree with Allen that it could use a much more clear 
error message. I think his proposed ValueError makes a lot more sense than just 
raising an IndexError as currently occurs. This will help people debug their 
programs who don't even realize they're accidentally using negative weights to 
begin with.

--
nosy: +davecom
versions: +Python 3.7 -Python 3.6

___
Python tracker 

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



[issue34343] Why is turtle still present in python embedded for Windows?

2018-08-06 Thread Vlad Tudorache


Vlad Tudorache  added the comment:

Thank you very much. Then I will simply remove it.

--

___
Python tracker 

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