[issue40873] Something wrong with html.unescape()

2020-06-18 Thread hongweipeng


Change by hongweipeng :


--
nosy: +hongweipeng

___
Python tracker 

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



[issue41029] parallel sftp from local to remote file creates empty directory in home path

2020-06-18 Thread Christian Heimes


Christian Heimes  added the comment:

ParallelSSH is a 3rd party library and not part of Python's standard library. 
Please report the issue at https://github.com/ParallelSSH/parallel-ssh/

--
nosy: +christian.heimes
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



[issue40851] subprocess.Popen: impossible to show console window when shell=True

2020-06-18 Thread Zackery Spytz


Change by Zackery Spytz :


--
keywords: +patch
nosy: +ZackerySpytz
nosy_count: 6.0 -> 7.0
pull_requests: +20152
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/20975

___
Python tracker 

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



[issue41029] parallel sftp from local to remote file creates empty directory in home path

2020-06-18 Thread Suganya Vijayaraghavan


New submission from Suganya Vijayaraghavan :

I was using parallelSSHClient - copy_to_file

The code was like below,
greenlets = client.copy_file('/tmp/logs', '/home/sugan/remote_copy/', 
recurse=True)

>From /tmp/logs, I'm copying to my home path(/home/sugan) under the name 
>'remote_copy'.

The copying is as expected but during copying the destination path is starting 
with '/' then after '/' what is the first directory (in my case it 'home') a 
empty directory 'home' is getting creating in my home path(/home/sugan)

output:
-rw-r--r-- 1 sugan sugan 420 Jun 19 00:15 sftp.py
drwxr-xr-x 3 sugan sugan 21  Jun 19 00:17 home

pwd: /home/sugan

Consider now my script is changed as,
greenlets = client.copy_file('/tmp/logs', '/opt/user1/remote_copy/', 
recurse=True)

My home path is - /home/sugan but I'm copying to /opt/user1. So now when I 
executed the script. The script creates a empty directory 'opt' in my home 
path(/home/sugan).


output:
-rw-r--r-- 1 sugan sugan 420 Jun 19 00:19 sftp.py
drwxr-xr-x 3 sugan sugan 21  Jun 19 00:22 opt

pwd: /home/sugan

So whatever destination path is given and the path startswith '/' then the 
first directory of the path is getting created in home path. If a same 
directory already exists in home path then it is ignored.

And if the destination path is a relative path from home then the 
parallelSSHClient.copy_file works as expected.



My concern is generally we use absolute path for all... So each an empty 
directory is getting created in home.

--
components: Library (Lib)
messages: 371845
nosy: sugan19
priority: normal
severity: normal
status: open
title: parallel sftp from local to remote file creates empty directory in home 
path
type: behavior
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



[issue40077] Convert static types to PyType_FromSpec()

2020-06-18 Thread Dong-hee Na


Change by Dong-hee Na :


--
pull_requests: +20151
pull_request: https://github.com/python/cpython/pull/20974

___
Python tracker 

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



[issue41021] ctypes callback with structure crashes in Python 3.8 on Windows

2020-06-18 Thread Eryk Sun


Change by Eryk Sun :


--
stage:  -> test needed
title: Ctype callback with Structures crashes on python 3.8 on windows. -> 
ctypes callback with structure crashes in Python 3.8 on Windows

___
Python tracker 

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



[issue41021] Ctype callback with Structures crashes on python 3.8 on windows.

2020-06-18 Thread Eryk Sun


Eryk Sun  added the comment:

Please provide complete code that can be compiled as is, and the required build 
environment. I wrote a similar example in C, compiled for x64 with MSVC, and it 
worked fine for me. Also, please provide more details about the error -- a 
traceback in a native debugger, exception analysis, or a dump file. 

One detail that stands out to me is that you set the ctypes callback return 
type to c_void_p -- instead of void (None). But that shouldn't cause a crash. 
Another concern is your use of WINFUNCTYPE (stdcall) and WinDLL instead of 
CFUNCTYPE (cdecl) and CDLL. In x64 they're the same, but it's still important 
to use the function's declared calling convention, for the sake of x86 
compatibility. Make sure you're really using stdcall.

Here's the code that worked for me:

c/test.c:

#include 

typedef void listen_fn(int, FILETIME);

static void
subscribe_thread(listen_fn *cb)
{
int i = 0;
FILETIME systime;
while (1) {
GetSystemTimeAsFileTime(&systime);
cb(i++, systime);
Sleep(1000);
   }
}

void __declspec(dllexport)
subscribe(listen_fn *cb)
{
CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)subscribe_thread, 
cb, 0, NULL);
}

test.py:

import ctypes
from ctypes import wintypes

lib = ctypes.CDLL('c/test.dll')
listen_fn = ctypes.CFUNCTYPE(None, ctypes.c_int, wintypes.FILETIME)

@listen_fn
def cb(val, ft):
print(f"callback {val:03d} {ft.dwHighDateTime} {ft.dwLowDateTime}")

print('press enter to quit')
lib.subscribe(cb)
input()

--
components: +Windows
nosy: +eryksun, paul.moore, steve.dower, tim.golden, zach.ware

___
Python tracker 

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



[issue39949] truncating match in regular expression match objects repr

2020-06-18 Thread Seth Troisi


Seth Troisi  added the comment:

I was thinking about how to add the end quote and found these weird cases:
  >>> "asdf'asdf'asdf"
  "asdf'asdf'asdf"
  >>> "asdf\"asdf\"asdf"
  'asdf"asdf"asdf'
  >>> "asdf\"asdf'asdf"
  'asdf"asdf\'asdf'

This means that len(s) +2 (or 3 for bytes) != len(repr(s))
e.g.

>>> s = "\"''"
'"\'\'\'\'\'\''
>>> s
>>> len(s)
7
>>> len(repr(s))
15

This can lead to a weird partial trailing character 
  >>> re.match(".*", "a"*48 + "'\"")
  <_sre.SRE_Match object; span=(0, 50), 
match='\>


This means I'll need to rethink len(group0) >= 48 as the condition for 
truncation (as a 30 length string can be truncated by %.50R)

Maybe it makes sense to write group0 to a temp string and then check if that's 
truncated and extract the quote character from that
OR
PyUnicode_FromFormat('%R', group0[:50]) # avoids trailing escape character 
('\') but might be longer than 50 characters

--

___
Python tracker 

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



[issue40334] PEP 617: new PEG-based parser

2020-06-18 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset a5442b26f46f1073d1eb78895d554be520105ecb by Lysandros Nikolaou in 
branch '3.9':
[3.9] bpo-40334: Produce better error messages on invalid targets (GH-20106) 
(GH-20973)
https://github.com/python/cpython/commit/a5442b26f46f1073d1eb78895d554be520105ecb


--

___
Python tracker 

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



[issue40334] PEP 617: new PEG-based parser

2020-06-18 Thread Lysandros Nikolaou


Change by Lysandros Nikolaou :


--
pull_requests: +20150
pull_request: https://github.com/python/cpython/pull/20973

___
Python tracker 

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



[issue40334] PEP 617: new PEG-based parser

2020-06-18 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset 01ece63d42b830df106948db0aefa6c1ba24416a by Lysandros Nikolaou in 
branch 'master':
bpo-40334: Produce better error messages on invalid targets (GH-20106)
https://github.com/python/cpython/commit/01ece63d42b830df106948db0aefa6c1ba24416a


--

___
Python tracker 

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



[issue12800] 'tarfile.StreamError: seeking backwards is not allowed' when extract symlink

2020-06-18 Thread Chris AtLee


Change by Chris AtLee :


--
pull_requests: +20149
pull_request: https://github.com/python/cpython/pull/20972

___
Python tracker 

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



[issue1222585] C++ compilation support for distutils

2020-06-18 Thread Ryan Schmidt


Ryan Schmidt  added the comment:

Christian, thanks for the pointer. I think you're right, I probably am actually 
wanting this to be fixed in setuptools, not distutils, since setuptools is what 
people are using today. Since setuptools is an offshoot of distutils, I had 
assumed that the developers of setuptools would take ownership of any remaining 
distutils bugs that affected setuptools but I guess not. I looked through the 
setuptools issue tracker and this was the closest existing bug I could find: 
https://github.com/pypa/setuptools/issues/1732

--

___
Python tracker 

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



[issue40958] ASAN/UBSAN: heap-buffer-overflow in pegen.c

2020-06-18 Thread Lysandros Nikolaou


Change by Lysandros Nikolaou :


--
pull_requests: +20148
pull_request: https://github.com/python/cpython/pull/20970

___
Python tracker 

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



[issue41028] Move docs.python.org language and version switcher out of cpython

2020-06-18 Thread Julien Palard


Change by Julien Palard :


--
keywords: +patch
pull_requests: +20147
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/20969

___
Python tracker 

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



[issue41028] Move docs.python.org language and version switcher out of cpython

2020-06-18 Thread Julien Palard


New submission from Julien Palard :

This is to track [1] from the cpython point of view, mostly just to remove the 
switchers as they are now handled by docsbuild-scripts.

see: https://mail.python.org/pipermail/doc-sig/2020-June/004200.html

[1]: https://github.com/python/docsbuild-scripts/issues/90

--
assignee: mdk
components: Documentation
messages: 371839
nosy: mdk
priority: normal
severity: normal
status: open
title: Move docs.python.org language and version switcher out of cpython

___
Python tracker 

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



[issue40958] ASAN/UBSAN: heap-buffer-overflow in pegen.c

2020-06-18 Thread Lysandros Nikolaou


Change by Lysandros Nikolaou :


--
pull_requests: +20146
pull_request: https://github.com/python/cpython/pull/20968

___
Python tracker 

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



[issue40958] ASAN/UBSAN: heap-buffer-overflow in pegen.c

2020-06-18 Thread Lysandros Nikolaou


Lysandros Nikolaou  added the comment:

> WIll make a PR soon

No need. Already got something ready.

--

___
Python tracker 

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



[issue40958] ASAN/UBSAN: heap-buffer-overflow in pegen.c

2020-06-18 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Hu, that is because now lineno, col_offset, end_lineno, end_col_offset are 
Py_ssize_t so we probably need to adapt the other assignments. WIll make a PR 
soon

--

___
Python tracker 

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



[issue38377] test_asyncio.test_events.GetEventLoopTestsMixin.test_get_event_loop_new_process mixin breaks in the Unix environment without working /dev/shm

2020-06-18 Thread STINNER Victor


STINNER Victor  added the comment:

test_multiprocessing_forkserver.test_resource_tracker_reused() failed on 3.8, 
3.9 and master buildbots. It looks like a real reproducible bug. I'm not sure 
how my change triggered this bug.

--
versions: +Python 3.10

___
Python tracker 

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



[issue40133] Provide additional matchers for unittest.mock

2020-06-18 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

I suggest waiting to see what I come up with as a proposal for what part(s) of 
this makes sense in the stdlib and why.  I've closed the PR.

Nothing is going to be added to mock without your agreement.

This issue is not a high priority for me, but leaving it open and assigned to 
me as reminder helps keep the TODO of whittling the proposal down with 
justifications on my radar.

--
priority: normal -> low

___
Python tracker 

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



[issue40816] Add missed AsyncContextDecorator to contextlib

2020-06-18 Thread Андрей Казанцев

Андрей Казанцев  added the comment:

Yury Selivanov, did you see the pull request?

--

___
Python tracker 

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



[issue38377] test_asyncio.test_events.GetEventLoopTestsMixin.test_get_event_loop_new_process mixin breaks in the Unix environment without working /dev/shm

2020-06-18 Thread Ned Deily


Ned Deily  added the comment:

> Hum, test_resource_tracker_reused() failed twice on macOS, but it's unclear 
> to me if it's a regression caused by my change or not.

It does appear to be caused by your change. I did a quick check with the 3.8 
branch. With that PR, test_multiprocessing_forkserver fails solidly. Backing up 
to the previous commit, test_multiprocessing_forkserver passes.

--
nosy: +ned.deily

___
Python tracker 

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



[issue38144] Add the root_dir and dir_fd parameters in glob.glob()

2020-06-18 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 8a64ceaf9856e7570cad6f5d628cce789834e019 by Serhiy Storchaka in 
branch 'master':
bpo-38144: Add the root_dir and dir_fd parameters in glob.glob(). (GH-16075)
https://github.com/python/cpython/commit/8a64ceaf9856e7570cad6f5d628cce789834e019


--

___
Python tracker 

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



[issue41027] get_version() fails to return gcc version for gcc-7

2020-06-18 Thread mbarbera


Change by mbarbera :


--
keywords: +patch
pull_requests: +20145
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/20967

___
Python tracker 

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



[issue40958] ASAN/UBSAN: heap-buffer-overflow in pegen.c

2020-06-18 Thread neonene


neonene  added the comment:

FYI, since PR 20875/20919, msvc(x64) has warned C4244 (conversion from 
'Py_ssize_t' to 'int', possible loss of data).
parse.c especially gets more than 700.

--
nosy: +neonene -christian.heimes, miss-islington

___
Python tracker 

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



[issue41027] get_version() fails to return gcc version for gcc-7

2020-06-18 Thread mbarbera


Change by mbarbera :


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



[issue41027] get_version() fails to return gcc version for gcc-7

2020-06-18 Thread mbarbera


New submission from mbarbera :

In Lib/distutils/cygwincompiler.py, get_version() tries to parse the output of 
shell commands to check for the gcc version. gcc-7 has changed the behavior of 
the flag -dumpversion to only show the major version number. This prevents the 
regex string RE_VERSION from parsing the version number from the shell output.

The issue was encountered when trying to install a third-party module to 
python3.6 on Ubuntu 18.04

--
components: Distutils
messages: 371830
nosy: dstufft, eric.araujo, mbarbera
priority: normal
severity: normal
status: open
title: get_version() fails to return gcc version for gcc-7
type: behavior
versions: Python 3.6

___
Python tracker 

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



[issue41026] mailbox does not support new Path object

2020-06-18 Thread Rémi Lapeyre

Rémi Lapeyre  added the comment:

Hi Laurence, Maildir predates pathlib so it's not surprising it hasn't been 
updated yet. Could you open a PR to add this?

BTW, you should use os.fspath() instead of str() here.

--
nosy: +remi.lapeyre
versions: +Python 3.10

___
Python tracker 

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



[issue38377] test_asyncio.test_events.GetEventLoopTestsMixin.test_get_event_loop_new_process mixin breaks in the Unix environment without working /dev/shm

2020-06-18 Thread STINNER Victor


STINNER Victor  added the comment:

Hum, test_resource_tracker_reused() failed twice on macOS, but it's unclear to 
me if it's a regression caused by my change or not.

x86-64 macOS 3.9:
https://buildbot.python.org/all/#builders/696/builds/119

FAIL: test_resource_tracker_reused 
(test.test_multiprocessing_forkserver.TestResourceTracker)
--
Traceback (most recent call last):
  File 
"/Users/buildbot/buildarea/3.9.billenstein-macos/build/Lib/test/_test_multiprocessing.py",
 line 5219, in test_resource_tracker_reused
self.assertTrue(is_resource_tracker_reused)
AssertionError: False is not true

--

___
Python tracker 

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



[issue41020] Could not build the ssl module!

2020-06-18 Thread Ned Deily


Ned Deily  added the comment:

You appear to be using the Developer Guide recipe for Python versions < 3.7. 
Try this one to get everything:

CPPFLAGS="-I$(brew --prefix openssl)/include" \
  LDFLAGS="-L$(brew --prefix openssl)/lib" \
  --with-openssl=$(brew --prefix openssl) \
  ./configure --with-pydebug

--

___
Python tracker 

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



[issue38377] test_asyncio.test_events.GetEventLoopTestsMixin.test_get_event_loop_new_process mixin breaks in the Unix environment without working /dev/shm

2020-06-18 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset e8056180a13b6755e4e3e5505b7bf03f79da29fb by Victor Stinner in 
branch '3.8':
bpo-38377: Add support.skip_if_broken_multiprocessing_synchronize() (GH-20944) 
(GH-20962) (GH-20966)
https://github.com/python/cpython/commit/e8056180a13b6755e4e3e5505b7bf03f79da29fb


--

___
Python tracker 

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



[issue41026] mailbox does not support new Path object

2020-06-18 Thread Laurence


Laurence  added the comment:

Sorry, should read "in particular the Maildir class I'm using"...

Same applies to mbox, however.

--

___
Python tracker 

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



[issue41002] HTTPResponse.read with amt is slow

2020-06-18 Thread Open Close

Open Close  added the comment:

@bmerry yah, sorry, don't bother. I have mistaken.
(I thought somehow 'MB/s' was simple speed, not std).

I confirmed your tests.
httpclient-read: 2504.5 ± 10.6 MB/s
httpclient-read-length: 871.5 ± 4.9 MB/s
httpclient-read-raw: 2528.3 ± 3.6 MB/s
socket-read: 2520.9 ± 3.6 MB/s

--

___
Python tracker 

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



[issue41026] mailbox does not support new Path object

2020-06-18 Thread Laurence


New submission from Laurence :

The mailbox library, in particular the Mailbox class I'm using, does not 
support the new Path object requiring a clumsy `mbx = 
Maildir(str(some_path_obj))` to use with a Path instance.

It currently blows up if passed a Path directly (does not support startswith) - 
perhaps a simple solution is to coerce whatever is passed into a string inside 
`__init__`?

Could this support be added?

I feel that strings representing paths should be discouraged as a general 
principal now we have a truly portable object to represent paths, and 
supporting Path in all places it makes logical sense (without breaking 
backwards compatibility, if implemented as I suggest with coercion by 
`str(...)` inside the module) in the core library seems like a good thing to me.

--
components: Library (Lib)
messages: 371823
nosy: LimaAlphaHotel
priority: normal
severity: normal
status: open
title: mailbox does not support new Path object
type: enhancement

___
Python tracker 

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



[issue41002] HTTPResponse.read with amt is slow

2020-06-18 Thread Bruce Merry

Bruce Merry  added the comment:

> (perhaps 'MB/s's are wrong).

Why, are you getting significantly different results?

Just in case it's confusing, the results are reported as A ± B MB/s, where A is 
the mean and B is the standard deviation of the mean. So it's about 3GB/s when 
no length if passed, or 1GB/s when a length is passed.

--

___
Python tracker 

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



[issue41002] HTTPResponse.read with amt is slow

2020-06-18 Thread Open Close

Open Close  added the comment:

@bmerry check the test results again.
(perhaps 'MB/s's are wrong).

httpclient-read: 3019.0 ± 63.8 MB/s
httpclient-read-length: 1050.3 ± 4.8 MB/s
--> httpclient-read-raw: 3150.3 ± 5.3 MB/s
--> socket-read: 3134.4 ± 7.9 MB/s

--
nosy: +op368

___
Python tracker 

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



[issue39247] dataclass defaults and property don't work together

2020-06-18 Thread Ivan Ivanyuk


Ivan Ivanyuk  added the comment:

Was there some solution in progress here? We would like to use dataclasses and 
seems this problem currently limits their usefulness to us.

We recently came upon the same behaviour 
https://mail.python.org/pipermail/python-list/2020-June/897502.html and I was 
wondering if it was possible to make it work without changing the property 
decorator behaviour. Is there a way at all to preserve the default value on the 
class with @property even before dataclass starts processing it? 

 An example from that mail thread to workaround this:

 from dataclasses import dataclass, field
 
 def set_property():
 Container.x = property(Container.get_x, Container.set_x)
 return 30
 
 @dataclass
 class Container:
 x: int = field(default_factory=set_property)
 
 def get_x(self) -> int:
 return self._x
 
 def set_x(self, z: int):
 if z > 1:
 self._x = z
 else:
 raise ValueError

set_property can also be made a class method and referenced like this:
 x: int = field(default_factory=lambda: Container.set_property())

Is it possible that this kind of behaviour can be made one of standard flows 
for the field() function and dataclasses module can generate a function like 
this and set it on the class during processing?
 Or maybe it's better to extend @property decorator to update property object 
with default value which can be used later by the dataclass?

--
nosy: +iivanyuk

___
Python tracker 

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



[issue38377] test_asyncio.test_events.GetEventLoopTestsMixin.test_get_event_loop_new_process mixin breaks in the Unix environment without working /dev/shm

2020-06-18 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +20144
pull_request: https://github.com/python/cpython/pull/20966

___
Python tracker 

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



[issue38377] test_asyncio.test_events.GetEventLoopTestsMixin.test_get_event_loop_new_process mixin breaks in the Unix environment without working /dev/shm

2020-06-18 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset b1e736113484c99acb57e4acb417b91a9e58e7ff by Victor Stinner in 
branch '3.9':
bpo-38377: Add support.skip_if_broken_multiprocessing_synchronize() (GH-20944) 
(GH-20962)
https://github.com/python/cpython/commit/b1e736113484c99acb57e4acb417b91a9e58e7ff


--

___
Python tracker 

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



[issue41013] test_os.test_memfd_create() fails on AMD64 FreeBSD Shared 3.x

2020-06-18 Thread Kyle Evans


Kyle Evans  added the comment:

Ah, now that I'm more awake, I see the problem- the write is unsuccessful 
because I haven't yet implemented grow-on-write. None of the consumers that I 
had found relied on it, instead choosing to ftruncate() it to the size they 
need before operating on it.

I think the best course of action might be to disable the test on FreeBSD for 
now (unless you're ok with tossing in a truncate to expand the file), because 
it might take me a little bit to get around to this one.

--

___
Python tracker 

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



[issue41025] C implementation of ZoneInfo cannot be subclassed

2020-06-18 Thread Paul Ganssle


Change by Paul Ganssle :


--
keywords: +patch
pull_requests: +20143
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/20965

___
Python tracker 

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



[issue41025] C implementation of ZoneInfo cannot be subclassed

2020-06-18 Thread Paul Ganssle

New submission from Paul Ganssle :

In the C implementation of zoneinfo.ZoneInfo, __init_subclass__ is not declared 
as a classmethod, which prevents it from being subclassed. This was not noticed 
because the tests for ZoneInfo subclasses in C are actually testing 
zoneinfo.ZoneInfo, not a subclass, due to a mistake in the inheritance tree: 
https://github.com/python/cpython/blob/8f192d12af82c4dc40730bf59814f6a68f68f950/Lib/test/test_zoneinfo/test_zoneinfo.py#L465-L487


Originally reported on the backport by Sébastien Eustace: 
https://github.com/pganssle/zoneinfo/issues/82

The fix in the backport is here: https://github.com/pganssle/zoneinfo/pull/83

--
assignee: p-ganssle
components: Library (Lib)
messages: 371817
nosy: p-ganssle
priority: high
severity: normal
stage: needs patch
status: open
title: C implementation of ZoneInfo cannot be subclassed
versions: Python 3.10, Python 3.9

___
Python tracker 

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



[issue41024] doc: Explicitly mention use of 'enum.Enum' as a valid container for 'choices' argument of 'argparse.ArgumentParser.add_argument'

2020-06-18 Thread vincent-ferotin


Change by vincent-ferotin :


--
keywords: +patch
pull_requests: +20142
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/20964

___
Python tracker 

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



[issue40884] Added defaults parameter for logging.Formatter

2020-06-18 Thread miss-islington


miss-islington  added the comment:


New changeset 8f192d12af82c4dc40730bf59814f6a68f68f950 by Bar Harel in branch 
'master':
bpo-40884: Added defaults parameter for logging.Formatter (GH-20668)
https://github.com/python/cpython/commit/8f192d12af82c4dc40730bf59814f6a68f68f950


--
nosy: +miss-islington

___
Python tracker 

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



[issue41013] test_os.test_memfd_create() fails on AMD64 FreeBSD Shared 3.x

2020-06-18 Thread Kyle Evans


Kyle Evans  added the comment:

(Transcription error beyond the bogus os.exit() :-))

--

___
Python tracker 

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



[issue40077] Convert static types to PyType_FromSpec()

2020-06-18 Thread STINNER Victor


STINNER Victor  added the comment:

PR 20960 (_bz2 module) triggers an interesting question. The effect of 
converting a static type to a heap type on pickle, especially for protocols 0 
and 1.

pickle.dumps(o, 0) calls object.__reduce__(o) which calls copyreg._reduce_ex(o, 
0).

copyreg._reduce_ex() behaves differently on heap types:

...
for base in cls.__mro__:
if hasattr(base, '__flags__') and not base.__flags__ & _HEAPTYPE:
break
else:
base = object # not really reachable
...

There are 3 things which impacts serialization/deserialization:

- Py_TPFLAGS_HEAPTYPE flag in the type flags
- Is __new__() overriden in the type?
- Py_TPFLAGS_BASETYPE flag in the type flags

Examples:

* In Python 3.7, _random.Random() cannot be serialized because it's a static 
type (it doesn't have (Py_TPFLAGS_HEAPTYPE)
* In master, _random.Random() cannot be deserialized because _random.Random() 
has __new__() method (it's not object.__new__())

--

___
Python tracker 

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



[issue41013] test_os.test_memfd_create() fails on AMD64 FreeBSD Shared 3.x

2020-06-18 Thread Kyle Evans


Kyle Evans  added the comment:

I think it's too early to look at this, I'll circle back another time. :-) I 
got a minute and extracted the relevant test, but I guess there must have been 
some fundamental transcription error:

import os

fd = os.memfd_create("Hi", os.MFD_CLOEXEC)
if fd == -1:
print("boo")
os.exit(1)

if os.get_inheritable(fd):
print("inheritable, boo")
os.exit(1)

with open(fd, "wb", closefd=False) as f:
f.write(b'memfd_create')
if f.tell() != 12:
print("Hork")
os.exit(1)
print("What?")

print("Done")

When I run this with python3.9, I get:

...
 3038 100554: shm_open2(SHM_ANON,O_RDWR|O_CLOEXEC,00,0,"memfd:Hi") = 3 (0x3)
 3038 100554: fcntl(3,F_GETFD,)  = 1 (0x1)
 3038 100554: fstat(3,{ mode=-- ,inode=10,size=0,blksize=4096 }) = 0 
(0x0)
 3038 100554: ioctl(3,TIOCGETA,0x7fffe2a0)   ERR#25 'Inappropriate ioctl 
for device'
 3038 100554: lseek(3,0x0,SEEK_CUR)  = 0 (0x0)
 3038 100554: lseek(3,0x0,SEEK_CUR)  = 0 (0x0)
 3038 100554: write(3,"memfd_create",12) = 0 (0x0)
 3038 100554: write(3,"memfd_create",12) = 0 (0x0)
 3038 100554: write(3,"memfd_create",12) = 0 (0x0)
 3038 100554: write(3,"memfd_create",12) = 0 (0x0)
 3038 100554: write(3,"memfd_create",12) = 0 (0x0)
(ad infinitum)

So in my local repro, Python is looping forever on successful write() for 
reasons I'm not immediately sure of.

--

___
Python tracker 

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



[issue41024] doc: Explicitly mention use of 'enum.Enum' as a valid container for 'choices' argument of 'argparse.ArgumentParser.add_argument'

2020-06-18 Thread vincent-ferotin

New submission from vincent-ferotin :

It is currently not obvious, reading :mod:`argparse` documentation, that 
:meth:`argparse.ArgumentParser.add_argument` could accept as 'choices' 
parameter an :class:`enum.Enum`.
However, it seems (at least to me) that this 'choices' parameter [1] is the 
perfect candidat of enums usage (see [2]).

So I suggest here to explicitly mention and illustrate such usage in current 
Python documentation. As far I as could test, such usage works at least with 
Python 3.5, 3.7, and 3.8.

A small patch on 'master' branches is in progress, and should shortly be 
available as a GitHub pull-request.

[1] https://docs.python.org/3/library/argparse.html#choices
[2] PEP 435: https://www.python.org/dev/peps/pep-0435/#motivation

--
assignee: docs@python
components: Documentation
messages: 371812
nosy: Vincent Férotin, docs@python
priority: normal
severity: normal
status: open
title: doc: Explicitly mention use of 'enum.Enum' as a valid container for 
'choices' argument of 'argparse.ArgumentParser.add_argument'
type: enhancement
versions: Python 3.10, Python 3.5, Python 3.6, Python 3.7, Python 3.8, Python 
3.9

___
Python tracker 

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



[issue41013] test_os.test_memfd_create() fails on AMD64 FreeBSD Shared 3.x

2020-06-18 Thread Christian Heimes


Christian Heimes  added the comment:

The traceback points to line 3520, which calls f.tell() on a file object that 
wraps a memfd.

--

___
Python tracker 

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



[issue38377] test_asyncio.test_events.GetEventLoopTestsMixin.test_get_event_loop_new_process mixin breaks in the Unix environment without working /dev/shm

2020-06-18 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +20141
pull_request: https://github.com/python/cpython/pull/20962

___
Python tracker 

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



[issue41013] test_os.test_memfd_create() fails on AMD64 FreeBSD Shared 3.x

2020-06-18 Thread Kyle Evans


Kyle Evans  added the comment:

Interesting; I don't quite have time to look at the moment, but what is the 
test doing that it's ultimately timing out?

Our memfd_create is assumed to be compatible, with the exception that we don't 
yet support HUGETLB (but there are patches in progress for the vm that might 
make it feasible); in my experience most users of memfd_create weren't really 
using hugetlb, though.

--

___
Python tracker 

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



[issue38377] test_asyncio.test_events.GetEventLoopTestsMixin.test_get_event_loop_new_process mixin breaks in the Unix environment without working /dev/shm

2020-06-18 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset ddbeb2f3e02a510c5784ffd74c5e09e8c70b5881 by Victor Stinner in 
branch 'master':
bpo-38377: Add support.skip_if_broken_multiprocessing_synchronize() (GH-20944)
https://github.com/python/cpython/commit/ddbeb2f3e02a510c5784ffd74c5e09e8c70b5881


--

___
Python tracker 

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



[issue41023] smtplib does not handle Unicode characters

2020-06-18 Thread R. David Murray


R. David Murray  added the comment:

If you use the 'sendmail' function for sending, then it is entirely your 
responsibility to turn the email into "wire format".  Unicode is not wire 
format, but if you give sendmail a string that only has ascii in it it nicely 
converts it to binary for you.  But given that the email RFCs specify specific 
ways to indicate how non-ascii is encoded in the message, there is no way for 
the smtp library to know now to do that correctly when passed an arbitrary 
unicode string, so it doesn't try.  sendmail requires *you* do do the encoding 
to binary, indicating you at least think that you got the RFC parts right :)  
In python2, strings are binary by default, so in that case you are handing 
sendmail binary format data (with the same assumption that you got the RFC 
parts right)...if you passed the python2 function a unicode string it would 
probably complain as well, although not in the same way.

If your raw email is RFC compliant, then you can do: sendmail(from, to, 
mymsg.encode()).

I see from your example that you are trying to use the email package to 
construct the email, which is good.  But, emails are *binary*, they are not 
unicode, so passing "message_from_string" a unicode string containing non-ascii 
isn't going to do what you are expecting, any more than passing unicode to the 
'sendmail' function did.  message_from_string is really only useful for doing 
certain sorts of debug and ought to be deprecated.  Or produce a warning when 
handed a string containing non-ascii.  (There are historical reasons why it 
doesn't :(

And then you should use smtplib's 'sendmessage' function, which understands 
email package messages and will Do the Right Thing with them (including the 
extraction of the to and from addresses your code is currently doing).

However, even if you encoded your raw message to binary and then passed it to 
message_from_bytes, your example message is *not* RFC compliant: without MIME 
headers, an email with non-ascii characters in the body is technically in 
violation of the RFC.  Most email programs will handle that particular message 
despite that, but not all.  You are better off using the email package to 
construct a properly RFC formatted email,  using the new API (ex: msg = 
EmailMessage() (not Message), and then doing msg['from'] = address, etc, and 
msg.set_content(your unicode string body)). I can't really give you much advice 
here (nor should I, this being a bug tracker :) because I don't know how 
exactly how the data is coming in to your program in your real use case.

Once you have a properly constructed EmailMessage object, you should use 
smtplib's 'sendmessage' function, which understands email package messages and 
will Do the Right Thing with them (including the extraction of the to and from 
addresses your code is currently doing, as well as properly handling BCC, which 
means deleting BCC headers from the message before sending it, which your code 
does not do and which 'sendmail' would not do.)

SMTPUTF8 is about non-ascii in the email *headers*, and most SMTP servers these 
days do not yes support it[*]. Some of the big ones do, though (I believe gmail 
does).

[*] although that doesn't explain why what you got was SMTPSenderRefused.  You 
should have gotten SMTPNotSupportedError.

--
resolution:  -> works for me
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



[issue41020] Could not build the ssl module!

2020-06-18 Thread Sree Vaddi


Sree Vaddi  added the comment:

openssl brew installed and upto date.
despite build says it could not build the ssl module.
i followed the macos instructions at the dev guide. 

svaddi@cpython % brew --prefix openssl
/usr/local/opt/openssl@1.1

--

___
Python tracker 

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



[issue40636] Provide a strict form of zip (PEP-618) requiring same length inputs

2020-06-18 Thread Ram Rachum


Change by Ram Rachum :


--
pull_requests: +20140
pull_request: https://github.com/python/cpython/pull/20961

___
Python tracker 

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



[issue17110] sys.argv docs should explaining how to handle encoding issues

2020-06-18 Thread Inada Naoki


Inada Naoki  added the comment:

>
> Manuel Jacob  added the comment:
>
> If the encoding supports it, since which Python version do
> Py_DecodeLocale() and os.fsencode() roundtrip?
>

Maybe, since Python 3.2. FWIW, fsencode is added by Victor in
https://bugs.python.org/issue8514

> The background of my question is that Mercurial goes some extra rounds to
> determine the correct encoding to emulate what Py_EncodeLocale() would do:
> https://www.mercurial-scm.org/repo/hg/file/5.4.1/mercurial/pycompat.py#l157
> . If os.fsencode() could be used, it would simplify the code. Mercurial
> supports Python 3.5+.
>
>
>

I think it is a right approach.
One of the important use case of os.fsencode is using file path from
sys.argv even if it can not be decoded by filesystem encoding.

--

___
Python tracker 

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



[issue32068] textpad from curses package isn't handling backspace key

2020-06-18 Thread SBC King


SBC King  added the comment:

I would create a pull request

--
nosy: +SBC King

___
Python tracker 

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



[issue40077] Convert static types to PyType_FromSpec()

2020-06-18 Thread Dong-hee Na


Change by Dong-hee Na :


--
pull_requests: +20139
pull_request: https://github.com/python/cpython/pull/20960

___
Python tracker 

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



[issue39093] tkinter objects garbage collected from non-tkinter thread cause crash

2020-06-18 Thread E. Paine


E. Paine  added the comment:

> ... would break any code that puts the interpreter in a non-main thread
Have people not been warned enough?! But seriously, looking anywhere on Google 
will scream at you to stop using using threads with tkinter, let alone having 
the interpreter in a thread.

I am not sure I agree with your statement that we would be keeping the 
interpreter exits, as that was only a 'fallback' if a delete was attempted in a 
thread. However, I agree with you that we should avoid breaking existing code 
where possible and so such a change shouldn't be added.

As for uncommenting CHECK_TCL_APPARTMENT in Tkapp_Dealloc, I looked at the 
blame and found that it was added as a comment:
https://github.com/python/cpython/commit/b5bfb9f38c786c3330b2d52d93b664588c42283dbecaus
I don't know the reason for adding it commented, but it is possible Martin 
couldn't find a situation in which it was required. My only problem with 
uncommenting it would be that I don't understand how the GC works. I suspect it 
would not be a problem, but if the error caused the GC to halt collecting, we 
would be in exactly the same situation (though I doubt this would be true).

> It should be done a bugfix regardless of anything else.
Agreed. Such a simple change to stop the interpreter crashing is definitely 
beneficial.

As for actually fixing the root of the problem, I suspect any of the changes 
you proposed, similar to mine, would be too controversial and not really go 
anywhere (being fairly large changes to fix just a handful of situations).

--

___
Python tracker 

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



[issue40968] urllib does not send http/1.1 ALPN extension

2020-06-18 Thread Christian Heimes


Change by Christian Heimes :


--
keywords: +patch
pull_requests: +20138
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/20959

___
Python tracker 

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



[issue41023] smtplib does not handle Unicode characters

2020-06-18 Thread Jay Patel


Change by Jay Patel :


Added file: 
https://bugs.python.org/file49252/providing_mail_options_in_sendmail.png

___
Python tracker 

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



[issue41023] smtplib does not handle Unicode characters

2020-06-18 Thread Jay Patel


Change by Jay Patel :


Added file: 
https://bugs.python.org/file49251/providing_Unicode_characters_in_email_body.png

___
Python tracker 

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



[issue41023] smtplib does not handle Unicode characters

2020-06-18 Thread Jay Patel


Jay Patel  added the comment:

Screenshot for the case, where only the 'raw_email' variable contains only 
'ascii' characters.

--
Added file: 
https://bugs.python.org/file49250/providing_only_ascii_characters.png

___
Python tracker 

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



[issue17110] sys.argv docs should explaining how to handle encoding issues

2020-06-18 Thread Manuel Jacob


Manuel Jacob  added the comment:

If the encoding supports it, since which Python version do Py_DecodeLocale() 
and os.fsencode() roundtrip?

The background of my question is that Mercurial goes some extra rounds to 
determine the correct encoding to emulate what Py_EncodeLocale() would do: 
https://www.mercurial-scm.org/repo/hg/file/5.4.1/mercurial/pycompat.py#l157 . 
If os.fsencode() could be used, it would simplify the code. Mercurial supports 
Python 3.5+.

--

___
Python tracker 

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



[issue41023] smtplib does not handle Unicode characters

2020-06-18 Thread Jay Patel


New submission from Jay Patel :

According to the user requirements, I need to send an email, which is provided 
as a raw email, i.e., the contents of email are provided in form of headers. To 
accomplish this I am using the methods provided in the "send_rawemail_demo.py" 
file (attached below).
The smtplib library works fine when providing only 'ascii' characters in the 
'raw_email' variable. But, when I provide any Unicode characters either in the 
Subject or Body of the email, then the sendmail method of the smtplib library 
fails with the following message:
UnicodeEncodeError 'ascii' codec can't encode characters in position 123-124: 
ordinal not in range(128)
I tried providing the mail_options=["SMTPUTF-8"] in the sendmail method (On 
line no. 72 in the send_rawemail_demo.py file), but then it fails (even for the 
'ascii' characters) with the exception as SMTPSenderRefused.
I have faced the same issue on Python 3.6. 
The sendmail method of the SMTP class encodes the message using 'ascii' as:
if isinstance(msg, str):
msg = _fix_eols(msg).encode('ascii')
The code works properly for Python 2 as the smtplib library for Python 2 does 
not have the above line and hence it allows Unicode characters in the Body and 
the Subject.

--
components: email
files: send_rawemail_demo.py
messages: 371801
nosy: barry, jpatel, r.david.murray
priority: normal
severity: normal
status: open
title: smtplib does not handle Unicode characters
type: enhancement
versions: Python 3.8
Added file: https://bugs.python.org/file49249/send_rawemail_demo.py

___
Python tracker 

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



[issue41019] The necessary bits to build these optional modules were not found:

2020-06-18 Thread Ronald Oussoren


New submission from Ronald Oussoren :

What's your question or bug report?

The log just shows that a number of extensions could not be build because their 
dependencies are not installed.  
https://devguide.python.org/setup/#macos-and-os-x shows how to install 
dependencies (but I noticed that sqlite is not mentioned there)

--

___
Python tracker 

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



[issue41013] test_os.test_memfd_create() fails on AMD64 FreeBSD Shared 3.x

2020-06-18 Thread Kubilay Kocak


Kubilay Kocak  added the comment:

memfd_create  came in via:

https://github.com/freebsd/freebsd/commit/575e351fdd996f72921b87e71c2c26466e887ed2

via review: https://reviews.freebsd.org/D21393

via kevans (cc'd)

--
nosy: +kevans

___
Python tracker 

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



[issue41022] AST sum types is unidentifiable after ast.Constant became a base class

2020-06-18 Thread Batuhan Taskaya


New submission from Batuhan Taskaya :

Previously (before ast.Constant became a base class for deprecated node 
classes), Sum types were identifiable with this rule;

len(node_class.__subclasses__()) > 0

Now, this is also valid for the ast.Constant itself because of ast.Str, ast.Num 
etc. bases it. The bad side is, it makes (complex) sum classes unidentifiable.

--
components: Library (Lib)
messages: 371797
nosy: BTaskaya, pablogsal, serhiy.storchaka
priority: normal
severity: normal
status: open
title: AST sum types is unidentifiable after ast.Constant became a base class

___
Python tracker 

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



[issue40133] Provide additional matchers for unittest.mock

2020-06-18 Thread Chris Withers


Chris Withers  added the comment:

Gregory, I find your response a little troubling. Myself and Karthikeyan both 
do a lot of work on Mock, some might even say we're the maintainers of Mock in 
both cpython's core repo and the backport.

We both feel this belongs standalone on pypi, and would prefer not to see this 
merged.

"We've been using these internally at Google for years" is not a compelling 
argument and suggests you already have a viable solution which doesn't involve 
merging these into the core repo. Your phrasing could be interpreted as 
somewhat bullying - "it's right for Google, so I'm going to do it for all of 
Python in spite of comments from other core contributors, and I don't want to 
discuss this on a mailing list because that will take too long".

Please consider re-closing this issue and respecting the decisions of those of 
us who maintain mock long-term. If not, please suggest a way forward to mediate 
this disagreement, but please do not unilaterally merge anything without 
sorting this out first.

--

___
Python tracker 

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



[issue40968] urllib does not send http/1.1 ALPN extension

2020-06-18 Thread Christian Heimes


Change by Christian Heimes :


--
title: urllib is unable to deal with TURN server infront -> urllib does not 
send http/1.1 ALPN extension
versions: +Python 3.10, Python 3.7, Python 3.9

___
Python tracker 

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



[issue41021] Ctype callback with Structures crashes on python 3.8 on windows.

2020-06-18 Thread Aravindhan


New submission from Aravindhan :

Python Process crashes with unauthorised memory access when the C++ DLL 
callback has arguments as structures. Happens in python 3.8. python 3.7 works 
fine with same source code. Initial investigations revels that the structure is 
called back as a pointer instead of plain python object. Callbacks with 
Primitive types are successful. This might be something to do with vector 
calling in python 3.8?

>>>Replicate:

>>>A c++ DLL with "subscribe_cb" function and a callback "listen_cb"; where 
>>>FILETIME is windows FILETIME structure (it can be any structure for that 
>>>matter)

extern "C" CBFUNC(void, listen_cb)(int value, FILETIME ts );
extern "C" EXFUNC(void) subscribe_cb(listen_cb);

EXFUNC(void) subscribe_cb(listen_cb cb)
{

int i = 0;
while (true) {
FILETIME systime;
GetSystemTimeAsFileTime(&systime);
i++;
Sleep(1000);
cb(i, systime);
   }
}


>>>Python client for the dll

class FT(Structure):
_fields_ = [("dwLowDateTime", c_ulong, 32),
("dwHighDateTime", c_ulong, 32)]


@WINFUNCTYPE(c_void_p, c_int, FT)
def cb(val, ft):
print(f"callback {val} {ft.dwLowDateTime} {ft.dwHighDateTime}")


lib = WinDLL(r"C:\Temp\CBsimulate\CbClient\CbClient\Debug\DummyCb.dll")

lib.subscribe_cb(cb)

while 1:
sleep(5)

--
components: ctypes
messages: 371796
nosy: amaury.forgeotdarc, belopolsky, itsgk92, meador.inge
priority: normal
severity: normal
status: open
title: Ctype callback with Structures crashes on python 3.8 on windows.
type: crash
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



[issue11102] configure doesn't find "major()" on HP-UX v11.31

2020-06-18 Thread Michael Osipov


Change by Michael Osipov <1983-01...@gmx.net>:


--
nosy: +michael-o

___
Python tracker 

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



[issue36346] Prepare for removing the legacy Unicode C API

2020-06-18 Thread Inada Naoki


Inada Naoki  added the comment:


New changeset 610a60c601fb4380eee30e15be1cd4dcbdaeec4c by Inada Naoki in branch 
'3.9':
bpo-36346: Add Py_DEPRECATED to deprecated unicode APIs (GH-20878)
https://github.com/python/cpython/commit/610a60c601fb4380eee30e15be1cd4dcbdaeec4c


--

___
Python tracker 

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



[issue35018] Sax parser provides no user access to lexical handlers

2020-06-18 Thread Zackery Spytz


Change by Zackery Spytz :


--
versions: +Python 3.10 -Python 3.8

___
Python tracker 

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



[issue41004] Hash collisions in IPv4Interface and IPv6Interface

2020-06-18 Thread martin w


martin w  added the comment:

Absolutely, go ahead Amir

--

___
Python tracker 

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



[issue41004] Hash collisions in IPv4Interface and IPv6Interface

2020-06-18 Thread Sree Vaddi


Change by Sree Vaddi :


--
keywords: +patch
nosy: +svaddi
nosy_count: 3.0 -> 4.0
pull_requests: +20137
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/20956

___
Python tracker 

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



[issue41004] Hash collisions in IPv4Interface and IPv6Interface

2020-06-18 Thread Amir Mohamadi


Amir Mohamadi  added the comment:

Can I make a PR for this?

--
nosy: +Amir

___
Python tracker 

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