[issue35863] email.headers wraps headers badly

2019-01-30 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
components: +email
nosy: +barry, r.david.murray

___
Python tracker 

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



[issue35857] Stacktrace shows lines from updated file on disk, not code actually running

2019-01-30 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

> For information - all taken from docs and Lib/*.py

I'm sorry Jonathon, I don't see how they are relevant or interesting to 
the topic in hand other than "they're used to print stack traces". Okay, 
they're used to print stack traces. And...? Can you explain further why 
they are of interest?

--

___
Python tracker 

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



[issue25592] distutils docs: data_files always uses sys.prefix

2019-01-30 Thread Jeroen Demeyer


Jeroen Demeyer  added the comment:

> Fixing this on 2.7 would require additional investigation (distutils might 
> have diverged)

Let's be honest, we are talking about distutils here. So it's way more likely 
that it didn't diverge and that the behavior is exactly the same on 2.7 and 
3.8. So I would suggest to backport it to 2.7 also.

--

___
Python tracker 

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



[issue20767] Some python extensions can't be compiled with clang 3.4

2019-01-30 Thread Larry Hastings


Change by Larry Hastings :


--
priority: high -> normal
type: resource usage -> compile error

___
Python tracker 

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



[issue20767] Some python extensions can't be compiled with clang 3.4

2019-01-30 Thread Larry Hastings


Larry Hastings  added the comment:

It's too late to fix this for Python 3.4 and 3.5, as those are now in 
security-fixes-only mode.  Also, please don't select every possible component 
that could be remotely connected.

--
components:  -2to3 (2.x to 3.x conversion tool), Argument Clinic, Build, 
Cross-Build, Demos and Tools, Distutils, Documentation, FreeBSD, IDLE, IO, 
Installation, Interpreter Core, Library (Lib), Regular Expressions, SSL, Tests, 
Tkinter, Unicode, XML, asyncio, ctypes, email
versions:  -Python 3.4, Python 3.5

___
Python tracker 

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



[issue20767] Some python extensions can't be compiled with clang 3.4

2019-01-30 Thread Pascal van der Donck


Change by Pascal van der Donck :


--
assignee:  -> docs@python
components: +2to3 (2.x to 3.x conversion tool), Argument Clinic, Build, 
Cross-Build, Demos and Tools, Documentation, Extension Modules, FreeBSD, IDLE, 
IO, Installation, Interpreter Core, Library (Lib), Regular Expressions, SSL, 
Tests, Tkinter, Unicode, XML, asyncio, ctypes, email
nosy: +Alex.Willmer, asvetlov, barry, docs@python, larry, mrabarnett, 
r.david.murray, terry.reedy, yselivanov
type: compile error -> resource usage
versions: +Python 3.4

___
Python tracker 

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



[issue30670] pprint for dict in sorted order or insert order?

2019-01-30 Thread Joseph Shen


Joseph Shen  added the comment:

I reopened this issue, and change affected versions to 3.6, 3.7 and 3.8.

--
status: closed -> open
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



[issue35861] test_named_expressions raises SyntaxWarning

2019-01-30 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

Thanks Emily, I am marking this as easy since it's related to tests and doesn't 
affect alpha release. If no one gets to this I will raise a fix for this by 
Sunday.

--
keywords: +easy

___
Python tracker 

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



[issue35864] Replace OrderedDict with regular dict in namedtuple's _asdict() method.

2019-01-30 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
keywords: +patch, patch, patch
pull_requests: +11564, 11565, 11566
stage:  -> patch review

___
Python tracker 

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



[issue35864] Replace OrderedDict with regular dict in namedtuple's _asdict() method.

2019-01-30 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
keywords: +patch, patch
pull_requests: +11564, 11565
stage:  -> patch review

___
Python tracker 

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



[issue35864] Replace OrderedDict with regular dict in namedtuple's _asdict() method.

2019-01-30 Thread Raymond Hettinger


Change by Raymond Hettinger :


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

___
Python tracker 

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



[issue35859] Capture behavior depends on the order of an alternation

2019-01-30 Thread Ma Lin


Ma Lin  added the comment:

You can `#define VERBOSE` in file `_sre.c`, it will print the engine's actual 
actions:

|02FAC684|02FC7402|MARK 0
...
|02FAC6BC|02FC7401|MARK 1

In my computer, 02FC7400 points to "ab", 02FC7401 points 'b' in "ab", 02FC7402 
points to the end of "ab".

This capture group, begin at 02FC7402, end at 02FC7401. `begin > end` makes it 
return an empty string.

This seems a bug, the begin should at 02FC7400.

--

___
Python tracker 

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



[issue35864] Replace OrderedDict with regular dict in namedtuple's _asdict() method.

2019-01-30 Thread Raymond Hettinger


New submission from Raymond Hettinger :

Now that regular dicts are ordered and compact, it makes more sense for the 
_asdict() method to create a regular dict (as it did in its early days) rather 
than an OrderedDict.  The regular dict is much smaller, much faster, and has a 
much cleaner looking repr. 

Historically we would go through a deprecation period for a possibly breaking 
change; however, it was considered more benefit to users and less disruptive to 
make the update directly.  See the thread starting at: 
https://mail.python.org/pipermail/python-dev/2019-January/156150.html

--
assignee: rhettinger
components: Library (Lib)
messages: 334602
nosy: rhettinger
priority: normal
severity: normal
status: open
title: Replace OrderedDict with regular dict in namedtuple's _asdict() method.
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



[issue35859] Capture behavior depends on the order of an alternation

2019-01-30 Thread Matthew Barnett


Matthew Barnett  added the comment:

It matches, and the span is (0, 2).

The only way that it can match like that is for the capture group to match the 
'a', and the final 'b' to match the 'b'.

Therefore, re.search(r'(ab|a)*b', 'ab').groups() should be ('a', ), as it is 
for the pattern with a greedy repeat.

--

___
Python tracker 

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



[issue35859] Capture behavior depends on the order of an alternation

2019-01-30 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
nosy: +effbot, serhiy.storchaka, tim.peters

___
Python tracker 

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



[issue35859] Capture behavior depends on the order of an alternation

2019-01-30 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

I'm not at all clear on how these features should interact (alternation, 
non-greedy matching, and group capture).  Was just pointing that the 
first-match behavior of alternation is the documented behavior and that 
re.DEBUG can be used to explore what the regex is actually doing.   Whether 
this is correct, intended, desirable or consistent with other tools is a 
completely different question.  Even if not, there is a question about whether 
the behavior should be changed or just documented rather than risk breaking an 
untold number of regexes in already tested and deployed code.

--

___
Python tracker 

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



[issue35861] test_named_expressions raises SyntaxWarning

2019-01-30 Thread Emily Morehouse


Emily Morehouse  added the comment:

Yes, you're exactly correct! Feel free to submit a PR and add me as a reviewer 
when you're ready.

--
assignee:  -> xtreak
stage:  -> needs patch

___
Python tracker 

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



[issue35854] EnvBuilder and venv symlinks do not work on Windows on 3.7.2

2019-01-30 Thread miss-islington


miss-islington  added the comment:


New changeset 03082a836b707528f885080bda9732d89849d4e3 by Miss Islington (bot) 
in branch '3.7':
bpo-35854: Fix EnvBuilder and --symlinks in venv on Windows (GH-11700)
https://github.com/python/cpython/commit/03082a836b707528f885080bda9732d89849d4e3


--
nosy: +miss-islington

___
Python tracker 

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



[issue35854] EnvBuilder and venv symlinks do not work on Windows on 3.7.2

2019-01-30 Thread Steve Dower


Steve Dower  added the comment:


New changeset a1f9a3332bd4767e47013ea787022f06b6dbcbbd by Steve Dower in branch 
'master':
bpo-35854: Fix EnvBuilder and --symlinks in venv on Windows (GH-11700)
https://github.com/python/cpython/commit/a1f9a3332bd4767e47013ea787022f06b6dbcbbd


--
pull_requests: +11562

___
Python tracker 

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



[issue35854] EnvBuilder and venv symlinks do not work on Windows on 3.7.2

2019-01-30 Thread Eryk Sun


Eryk Sun  added the comment:

> Okay, testing more thoroughly on 3.5, symlinks are fine from the 
> console but not via Explorer.

I gave up on using EXE symlinks with Explorer and ShellExecute[Ex]. The shell 
handles symlinks like shortcuts instead of leaving it up to the file system. In 
Windows 7, I recall it was thoroughly broken. Symlinks wouldn't even execute. 
In Windows 10 it's broken in many cases because of the shortcut-like behavior.

I think I know why they're doing this, but I think the fix belongs at a lower 
level in the system runtime library and loader. It's to accommodate the 
importance of the application directory. People expect a symlink to an 
executable to work like a shortcut. In Unix this often just works because most 
libraries are installed to the system, and an application's private shared 
libraries can use "$ORIGIN" in the binary's RPATH (or RUNPATH), which refers to 
the resolved (final) executable directory. In contrast, Windows doesn't use the 
resolved executable path for the application directory. IMO, they could use a 
pair of application directories at the start of the search path -- the link's 
directory and then the resolved executable's directory (or the DLL directory 
when loading a DLL). Some resources do get resolved like this already. For 
example, when searching for a "\.mui" language resource, 
in Process Monitor we see that it will first try the unresolved application d
 irectory (e.g. "C:\Temp\en-US\notepad.exe.mui") and then the resolved path 
(e.g. "C:\Windows\en-US\notepad.exe.mui").

--

___
Python tracker 

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



[issue35863] email.headers wraps headers badly

2019-01-30 Thread Jon Ribbens


New submission from Jon Ribbens :

email.headers can wrap headers by putting a FWS as the very first thing in the 
output:

>>> from email.header import Header
>>> Header("a" * 67, header_name="Content-ID").encode() 
'\n aaa'

i.e. it produces headers that look like this:

Content-ID:
blah

It is unclear to me whether this is compliant with the spec, but there seems to 
be little reason to do this, and good reason not to in that at the very least 
Outlook does not understand such headers. (e.g. if you have an HTML email with 
an inline image referenced by Content-ID then Outlook will not find it if the 
Content-ID header is wrapped as above.)

--
components: Library (Lib)
messages: 334594
nosy: jribbens
priority: normal
severity: normal
status: open
title: email.headers wraps headers badly
versions: Python 3.4, Python 3.5, 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



[issue28494] is_zipfile false positives

2019-01-30 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

it's a bugfix, it seems reasonable for 3.7 to me.  I agree that the previous 
is_zipfile check is too lenient.  I'll follow up on jjolly's PR for any 
specific concerns I have with the implementation.

--
assignee: serhiy.storchaka -> gregory.p.smith

___
Python tracker 

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



[issue28494] is_zipfile false positives

2019-01-30 Thread Gregory P. Smith


Change by Gregory P. Smith :


--
versions: +Python 3.8 -Python 3.5, Python 3.6

___
Python tracker 

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



[issue28494] is_zipfile false positives

2019-01-30 Thread Matthew Ryan


Change by Matthew Ryan :


--
nosy: +mryan1539

___
Python tracker 

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



[issue35862] Change the environment for a new process

2019-01-30 Thread Rohit travels and tours


Change by Rohit travels and tours :


--
hgrepos: +379
Added file: https://bugs.python.org/file48089/bq-nix.manifest

___
Python tracker 

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



[issue35862] Change the environment for a new process

2019-01-30 Thread Rohit travels and tours


Rohit travels and tours  added the comment:

rtat.net

--
nosy: +roufique7
Added file: https://bugs.python.org/file48088/bq-nix.snapshot.json

___
Python tracker 

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



[issue35862] Change the environment for a new process

2019-01-30 Thread Rohit travels and tours


Change by Rohit travels and tours :


Added file: https://bugs.python.org/file48087/core-nix.snapshot.json

___
Python tracker 

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



[issue35862] Change the environment for a new process

2019-01-30 Thread Tobias Däullary

Change by Tobias Däullary :


--
keywords: +patch, patch, patch
pull_requests: +11558, 11559, 11560
stage:  -> patch review

___
Python tracker 

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



[issue35862] Change the environment for a new process

2019-01-30 Thread Tobias Däullary

Change by Tobias Däullary :


--
keywords: +patch, patch, patch, patch
pull_requests: +11558, 11559, 11560, 11561
stage:  -> patch review

___
Python tracker 

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



[issue35862] Change the environment for a new process

2019-01-30 Thread Tobias Däullary

Change by Tobias Däullary :


--
keywords: +patch, patch
pull_requests: +11558, 11559
stage:  -> patch review

___
Python tracker 

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



[issue35862] Change the environment for a new process

2019-01-30 Thread Tobias Däullary

Change by Tobias Däullary :


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

___
Python tracker 

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



[issue35859] Capture behavior depends on the order of an alternation

2019-01-30 Thread Matthew Barnett


Matthew Barnett  added the comment:

It looks like a bug in re to me.

--

___
Python tracker 

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



[issue35862] Change the environment for a new process

2019-01-30 Thread Tobias Däullary

New submission from Tobias Däullary :

There should be a possibility to change the environment of a process created 
with multiprocessing.

For subprocess this is possible thanks to the "env" attribute.

Elaboration:
While it is trivial to change os.environ manually, in some cases this is not 
possible. 

For instance: creating a COM process on Windows; this process will always 
inherit the environment of the host process.
A workaround is to spawn a python process with a different environment which 
then will provide this to the child COM process.

--
components: Library (Lib)
messages: 334591
nosy: r-or
priority: normal
severity: normal
status: open
title: Change the environment for a new process
type: enhancement
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



[issue35857] Stacktrace shows lines from updated file on disk, not code actually running

2019-01-30 Thread Jonathan Fine

Jonathan Fine  added the comment:

For information - all taken from docs and Lib/*.py

https://docs.python.org/3.7/library/traceback.html
traceback -- Print or retrieve a stack traceback
Source code: Lib/traceback.py
===
This module provides a standard interface to extract, format and print stack 
traces of Python programs. It exactly mimics the behavior of the Python 
interpreter when it prints a stack trace. This is useful when you want to print 
stack traces under program control, such as in a “wrapper” around the 
interpreter.
===

https://github.com/python/cpython/blob/3.7/Lib/traceback.py#L344-L359
===
for f, lineno in frame_gen:
co = f.f_code
filename = co.co_filename
name = co.co_name

fnames.add(filename)
linecache.lazycache(filename, f.f_globals)
# Must defer line lookups until we have called checkcache.
if capture_locals:
f_locals = f.f_locals
else:
f_locals = None
result.append(FrameSummary(
filename, lineno, name, lookup_line=False, locals=f_locals))
for filename in fnames:
linecache.checkcache(filename)
===
By the way, here fnames is a set.

https://docs.python.org/3.7/library/linecache.html#module-linecache
linecache -- Random access to text lines
===
The linecache module allows one to get any line from a Python source file, 
while attempting to optimize internally, using a cache, the common case where 
many lines are read from a single file. This is used by the traceback module to 
retrieve source lines for inclusion in the formatted traceback.
===

===
linecache.checkcache(filename=None)
Check the cache for validity. Use this function if files in the cache may have 
changed on disk, and you require the updated version. If filename is omitted, 
it will check all the entries in the cache.

linecache.lazycache(filename, module_globals)
Capture enough detail about a non-file-based module to permit getting its lines 
later via getline() even if module_globals is None in the later call. This 
avoids doing I/O until a line is actually needed, without having to carry the 
module globals around indefinitely.
===

--

___
Python tracker 

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



[issue30670] pprint for dict in sorted order or insert order?

2019-01-30 Thread Valentin Beyer


Valentin Beyer  added the comment:

Please reopen this.
With version 3.7 and guaranteed dict order pprint should not sort by key.

--
nosy: +Valentin Beyer

___
Python tracker 

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



[issue35861] test_named_expressions raises SyntaxWarning

2019-01-30 Thread Karthikeyan Singaravelan

New submission from Karthikeyan Singaravelan :

SyntaxWarning was recently added for comparison using "is" over literals with 
issue34850. This is raised on master for a PEP 572 related test. The warning is 
emitted twice which is covered with bpo-35798 and I verified the patch. The fix 
for this issue would be to use == as noted in the warning. 

Emily, if you can confirm my report then I would like to triage this as an easy 
one since the fix is simple.

# SyntaxWarning on master

➜  cpython git:(master) ./python.exe Lib/test/test_named_expressions.py
Lib/test/test_named_expressions.py:168: SyntaxWarning: "is" with a literal. Did 
you mean "=="?
  if (match := 10) is 10:
Lib/test/test_named_expressions.py:168: SyntaxWarning: "is" with a literal. Did 
you mean "=="?
  if (match := 10) is 10:

--
Ran 56 tests in 0.010s

OK


Thanks

--
components: Tests
messages: 334587
nosy: emilyemorehouse, serhiy.storchaka, xtreak
priority: normal
severity: normal
status: open
title: test_named_expressions raises SyntaxWarning
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



[issue35859] Capture behavior depends on the order of an alternation

2019-01-30 Thread James Davis


James Davis  added the comment:

Thanks for your thoughts, Raymond. I understand that the alternation has 
"short-circuit" behavior, but I still find it confusing in this case.

Consider these two:


Regex patternmatched?   matched string captured 
content
   

(ab|a)*?bTrue   ab
('',)
(ab|a)+?bTrue   ab
('',)

In order to satisfy the first "(ab|a)+?" clause the regex engine has to find at 
least one match for (ab|a), and still match the final "b" clause of the pattern.

In this case, although "(ab|a)" will match "ab", doing so would cause the 
overall pattern to mismatch. So it seems like in order to obtain the match 
(which it does, see the second column), the regex engine must proceed past the 
first "ab" into the "a" part of the OR. But then I would expect the capture 
group to contain "a" and it does not.

For what it's worth, I also tried the match /(ab|a)*?b/ in PHP, Perl, Java, 
Ruby, Go, Rust and Node.js. The other 7 regex engines all matched "ab" and 
captured "a". Only Python's re module matches with an empty capture -- and even 
here it disagrees with the Python "regex" module as I noted in my initial post.

--

___
Python tracker 

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



[issue35810] Object Initialization Bug with Heap-allocated Types

2019-01-30 Thread Eddie Elizondo


Eddie Elizondo  added the comment:

Hi Petr,

Please take a look at the Github PR. What do you think that's missing to move 
this forward? I'd be more than happy to add more documentation/testing to it. 
Let me know what you think

--

___
Python tracker 

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



[issue35760] test_asyncio: test_async_gen_asyncio_gc_aclose_09() race condition

2019-01-30 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

Seems this used to happen rarely on Appveyor builds too in the past randomly. 
Past report of the same issue issue32646

--
nosy: +xtreak

___
Python tracker 

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



[issue35835] There is no mention of breakpoint() in the pdb documentation

2019-01-30 Thread miss-islington


miss-islington  added the comment:


New changeset 7516f265a8517e4fdc7d6e63d72ae1b57fda26ee by Miss Islington (bot) 
in branch '3.7':
bpo-35835: Add reference to Python 3.7 new breakpoint() function in pdb 
documentation. (GH-11691)
https://github.com/python/cpython/commit/7516f265a8517e4fdc7d6e63d72ae1b57fda26ee


--

___
Python tracker 

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



[issue35752] test_buffer fails on ppc64le: memoryview pack_single() is miscompiled

2019-01-30 Thread STINNER Victor


STINNER Victor  added the comment:

The GCC bug https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88892 has been fixed 
in the development branch ("trunk"):
https://gcc.gnu.org/viewcvs/gcc?view=revision=268083

I requested a fix for GCC 8.2.

--

___
Python tracker 

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



[issue35717] enum.Enum error on sys._getframe(2)

2019-01-30 Thread STINNER Victor


Change by STINNER Victor :


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



[issue35717] enum.Enum error on sys._getframe(2)

2019-01-30 Thread STINNER Victor

STINNER Victor  added the comment:

I was confused with PR, so here you have:

* master: https://github.com/python/cpython/pull/11523
* 3.7: https://github.com/python/cpython/pull/11669

Both are merged, so I close the issue. Thanks Rémi Lapeyre for the fix!

--

___
Python tracker 

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



[issue35857] Stacktrace shows lines from updated file on disk, not code actually running

2019-01-30 Thread Stefan Behnel


Stefan Behnel  added the comment:

I think the REPL could, when it formats a stack trace for printing, check every 
referenced source file if it's newer than its compiled .pyc (bytecode) file, 
and insert a warning into the stack trace if that is the case.

I don't see any use in doing this for all stack traces, so only ones that get 
printed out for the user could receive special treatment.

I also don't think we need to go further than that, e.g. check startup or 
module import time. Basically, whenever the source file is not in sync with the 
.pyc file, it's not unlikely that the code that is running corresponds to the 
.pyc file and no longer to the .py file.

Changing to target version to 3.8, since this is essentially a new feature and 
not acceptable as a bug fix for older versions.

--
nosy: +scoder
type: behavior -> enhancement
versions: +Python 3.8 -Python 3.7

___
Python tracker 

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



[issue35717] enum.Enum error on sys._getframe(2)

2019-01-30 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 1c79891026c57046f5ac596080ea60c515e0560a by Victor Stinner (Miss 
Islington (bot)) in branch '3.7':
bpo-35717: Fix KeyError exception raised when using enums and compile 
(GH-11523) (GH-11669)
https://github.com/python/cpython/commit/1c79891026c57046f5ac596080ea60c515e0560a


--

___
Python tracker 

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



[issue35835] There is no mention of breakpoint() in the pdb documentation

2019-01-30 Thread jcrmatos


jcrmatos  added the comment:

Thank you all for the help.

--

___
Python tracker 

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



[issue35835] There is no mention of breakpoint() in the pdb documentation

2019-01-30 Thread miss-islington


Change by miss-islington :


--
pull_requests: +11555, 11556

___
Python tracker 

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



[issue35854] EnvBuilder and venv symlinks do not work on Windows on 3.7.2

2019-01-30 Thread Steve Dower


Steve Dower  added the comment:

Okay, testing more thoroughly on 3.5, symlinks are fine from the console but 
not via Explorer.

Personally, I dislike that double-clicking python.exe is different from running 
it from the command line, but so be it. I'll add a note to the docs that this 
doesn't work.

--

___
Python tracker 

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



[issue35835] There is no mention of breakpoint() in the pdb documentation

2019-01-30 Thread Mariatta Wijaya


Mariatta Wijaya  added the comment:

Thanks!

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



[issue35835] There is no mention of breakpoint() in the pdb documentation

2019-01-30 Thread miss-islington


Change by miss-islington :


--
pull_requests: +11555, 11556, 11557

___
Python tracker 

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



[issue35835] There is no mention of breakpoint() in the pdb documentation

2019-01-30 Thread miss-islington

miss-islington  added the comment:


New changeset cf991e653ac550a9f011631447c61ce583404a57 by Miss Islington (bot) 
(João Matos) in branch 'master':
bpo-35835: Add reference to Python 3.7 new breakpoint() function in pdb 
documentation. (GH-11691)
https://github.com/python/cpython/commit/cf991e653ac550a9f011631447c61ce583404a57


--
nosy: +miss-islington

___
Python tracker 

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



[issue35835] There is no mention of breakpoint() in the pdb documentation

2019-01-30 Thread miss-islington


Change by miss-islington :


--
pull_requests: +11555

___
Python tracker 

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



[issue35760] test_asyncio: test_async_gen_asyncio_gc_aclose_09() race condition

2019-01-30 Thread STINNER Victor


STINNER Victor  added the comment:

The bug can be triggered on Linux using this patch:

diff --git a/Lib/test/test_asyncgen.py b/Lib/test/test_asyncgen.py
index 71b0968c79..5e0084dc32 100644
--- a/Lib/test/test_asyncgen.py
+++ b/Lib/test/test_asyncgen.py
@@ -668,8 +668,8 @@ class AsyncGenAsyncioTest(unittest.TestCase):
 while True:
 yield 1
 finally:
-await asyncio.sleep(0.01)
-await asyncio.sleep(0.01)
+await asyncio.sleep(0.001)
+await asyncio.sleep(0.001)
 DONE = 1
 
 async def run():
@@ -678,7 +678,7 @@ class AsyncGenAsyncioTest(unittest.TestCase):
 await g.__anext__()
 del g
 
-await asyncio.sleep(0.1)
+await asyncio.sleep(0.005)
 
 self.loop.run_until_complete(run())
 self.assertEqual(DONE, 1)


And command:

$ ./python -m test -j8 -F test_asyncgen -m test_async_gen_asyncio_gc_aclose_09
0:00:00 load avg: 7.30 [  1] test_asyncgen passed
0:00:00 load avg: 7.30 [  2] test_asyncgen passed
0:00:00 load avg: 7.30 [  3] test_asyncgen passed
(...)
0:00:02 load avg: 7.30 [ 38] test_asyncgen passed
0:00:02 load avg: 7.30 [ 39/1] test_asyncgen failed
Task was destroyed but it is pending!
task: ()> wait_for=()]>>
test test_asyncgen failed -- Traceback (most recent call last):
  File "/home/vstinner/prog/python/master/Lib/test/test_asyncgen.py", line 684, 
in test_async_gen_asyncio_gc_aclose_09
self.assertEqual(DONE, 1)
AssertionError: 0 != 1
0:00:02 load avg: 7.30 [ 40/1] test_asyncgen passed
0:00:03 load avg: 7.30 [ 41/1] test_asyncgen passed
0:00:03 load avg: 7.30 [ 42/1] test_asyncgen passed
0:00:03 load avg: 7.30 [ 43/1] test_asyncgen passed
0:00:03 load avg: 7.30 [ 44/1] test_asyncgen passed
0:00:03 load avg: 7.30 [ 45/1] test_asyncgen passed
0:00:03 load avg: 7.30 [ 46/1] test_asyncgen passed
0:00:03 load avg: 7.30 [ 47/1] test_asyncgen passed

== Tests result: FAILURE ==

46 tests OK.

1 test failed:
test_asyncgen

Total duration: 3 sec 323 ms
Tests result: FAILURE

--

___
Python tracker 

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



[issue35828] test_multiprocessing_fork - crashes in PyDict_GetItem - segmentation error

2019-01-30 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
nosy: +davin

___
Python tracker 

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



[issue35859] Capture behavior depends on the order of an alternation

2019-01-30 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

> I cannot see why changing the order of the alternation should have this 
> effect.

The first regex, r'(a|ab)*?b', looks for the first alternative group by 
matching left-to-right [1] stopping at the first matching alternation "a".  
Roughly, the regex simplifies to r'(a)*?b' giving 'a' in the captured group.

The second regex, r'(ab|a)*?b', looks for the first  alternative group by 
matching left-to-right [1] stopping at the first matching alternation "ab".  
Roughly, the regex simplifies to r'(ab)*?b' giving '' in the captured group.

>From there, I'm not clear on how a non-greedy kleene-star works with capturing 
>groups and with the overall span().  A starting point would be to look at the 
>re.DEBUG output for each pattern [2][3].

[1] From the re docs for the alternation operator:
As the target string is scanned, REs separated by '|' are tried from left to 
right. When one pattern completely matches, that branch is accepted. This means 
that once A matches, B will not be tested further, even if it would produce a 
longer overall match. In other words, the '|' operator is never greedy.

[2] re.DEBUG output for r'(a|ab)*?b'
 0. INFO 4 0b0 1 MAXREPEAT (to 5)
 5: REPEAT 19 0 MAXREPEAT (to 25)
 9.   MARK 0
11.   LITERAL 0x61 ('a')
13.   BRANCH 3 (to 17)
15. JUMP 7 (to 23)
17:   branch 5 (to 22)
18. LITERAL 0x62 ('b')
20. JUMP 2 (to 23)
22:   FAILURE
23:   MARK 1
25: MIN_UNTIL
26. LITERAL 0x62 ('b')
28. SUCCESS

[3] re.DEBUG output for r'(ab|a)*?b'
MIN_REPEAT 0 MAXREPEAT
  SUBPATTERN 1 0 0
LITERAL 97
BRANCH
  LITERAL 98
OR
LITERAL 98

 0. INFO 4 0b0 1 MAXREPEAT (to 5)
 5: REPEAT 19 0 MAXREPEAT (to 25)
 9.   MARK 0
11.   LITERAL 0x61 ('a')
13.   BRANCH 5 (to 19)
15. LITERAL 0x62 ('b')
17. JUMP 5 (to 23)
19:   branch 3 (to 22)
20. JUMP 2 (to 23)
22:   FAILURE
23:   MARK 1
25: MIN_UNTIL
26. LITERAL 0x62 ('b')
28. SUCCESS

--
nosy: +rhettinger

___
Python tracker 

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



[issue35828] test_multiprocessing_fork - crashes in PyDict_GetItem - segmentation error

2019-01-30 Thread Michael Felt


Michael Felt  added the comment:

After enabling PYTHONTHREADDEBUG=1 I got the dprintf output.

I added line info (as fixed text) asin:
Python/thread_pthread.h:
  +511  PyLockStatus
  +512  PyThread_acquire_lock_timed(PyThread_type_lock lock, PY_TIMEOUT_T 
microseconds,
  +513  int intr_flag)
  +514  {
  +515  PyLockStatus success = PY_LOCK_FAILURE;
  +516  pthread_lock *thelock = (pthread_lock *)lock;
  +517  int status, error = 0;
  +518
  +519  dprintf(("519: PyThread_acquire_lock_timed(%p, %lld, %d) called\n",
  +520   lock, microseconds, intr_flag));
  +521
  +522  if (microseconds == 0) {
  +523  status = pthread_mutex_trylock( >mut );
  +524  if (status != EBUSY)
  +525  CHECK_STATUS_PTHREAD("pthread_mutex_trylock[1]");
  +526  }
  +527  else {
  +528  status = pthread_mutex_lock( >mut );
  +529  CHECK_STATUS_PTHREAD("pthread_mutex_lock[1]");
  +530  }

and can establish that USE_SEMAPHORES is not being used.

There are many reasons why - I expect - something re: Python3.5 (issue23428) 
talks about this routine and also something about CLOCk_MONOTONIC versus 
CLOCK_REALTIME (hope I spelled those right).

Further, back in Python 2.3 days - issue525532 added POSIX support for 
semaphores.

I would love to proceed - but particularly, issue23428 makes me think I should 
not think that the logic that keeps USE_SEMAPHORE is incorrect.

Help appreciated!

p.s. - deeper details

with PYTHONTHREADDEBUG=1 I no longer get a segmentation fault. Instead I get:

Total duration: 1 min 53 sec
Tests result: NO TEST RUN
Exception in thread Thread-1:
Traceback (most recent call last):
  File 
"/home/buildbot/buildarea/3.x.aixtools-aix-power6/issue/Lib/threading.py", line 
917, in _bootstrap_inner
self.run()
  File 
"/home/buildbot/buildarea/3.x.aixtools-aix-power6/issue/Lib/test/libregrtest/runtest_mp.py",
 line 145, in run
stop = self._runtest()
  File 
"/home/buildbot/buildarea/3.x.aixtools-aix-power6/issue/Lib/test/libregrtest/runtest_mp.py",
 line 135, in _runtest
result = json.loads(result)
  File 
"/home/buildbot/buildarea/3.x.aixtools-aix-power6/issue/Lib/json/__init__.py", 
line 348, in loads
return _default_decoder.decode(s)
  File 
"/home/buildbot/buildarea/3.x.aixtools-aix-power6/issue/Lib/json/decoder.py", 
line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File 
"/home/buildbot/buildarea/3.x.aixtools-aix-power6/issue/Lib/json/decoder.py", 
line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

Exception in thread Thread-2:
Traceback (most recent call last):
  File 
"/home/buildbot/buildarea/3.x.aixtools-aix-power6/issue/Lib/threading.py", line 
917, in _bootstrap_inner
self.run()
  File 
"/home/buildbot/buildarea/3.x.aixtools-aix-power6/issue/Lib/test/libregrtest/runtest_mp.py",
 line 145, in run
stop = self._runtest()
  File 
"/home/buildbot/buildarea/3.x.aixtools-aix-power6/issue/Lib/test/libregrtest/runtest_mp.py",
 line 135, in _runtest
result = json.loads(result)
  File 
"/home/buildbot/buildarea/3.x.aixtools-aix-power6/issue/Lib/json/__init__.py", 
line 348, in loads
return _default_decoder.decode(s)
  File 
"/home/buildbot/buildarea/3.x.aixtools-aix-power6/issue/Lib/json/decoder.py", 
line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File 
"/home/buildbot/buildarea/3.x.aixtools-aix-power6/issue/Lib/json/decoder.py", 
line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
?

This is prefixed by:
PyThread_allocate_lock called
PyThread_allocate_lock() -> 200a9b40
519: PyThread_acquire_lock_timed(200a9b40, 0, 0) called
577: PyThread_acquire_lock_timed(200a9b40, 0, 0) -> 1
PyThread_release_lock(200a5fe0) called
519: PyThread_acquire_lock_timed(200a9b40, 0, 0) called
577: PyThread_acquire_lock_timed(200a9b40, 0, 0) -> 0
519: PyThread_acquire_lock_timed(200a9b40, 2996, 1) called
519: PyThread_acquire_lock_timed(200fe220, 0, 0) called
577: PyThread_acquire_lock_timed(200fe220, 0, 0) -> 1
PyThread_release_lock(200fe220) called
519: PyThread_acquire_lock_timed(200fe220, 0, 0) called
577: PyThread_acquire_lock_timed(200fe220, 0, 0) -> 1
PyThread_release_lock(200fe220) called
519: PyThread_acquire_lock_timed(20156c00, 0, 0) called
577: PyThread_acquire_lock_timed(20156c00, 0, 0) -> 1
PyThread_release_lock(20156c00) called
519: PyThread_acquire_lock_timed(20156c00, 0, 0) called
577: PyThread_acquire_lock_timed(20156c00, 0, 0) -> 1
PyThread_release_lock(20156c00) called
519: PyThread_acquire_lock_timed(200fe1a0, 0, 0) called
577: PyThread_acquire_lock_timed(200fe1a0, 0, 0) -> 1
PyThread_release_lock(200fe1a0) called
PyThread_free_lock(200fe1a0) called
PyThread_free_lock(200fe220) called

[issue35828] test_multiprocessing_fork - crashes in PyDict_GetItem - segmentation error

2019-01-30 Thread Michael Felt


Michael Felt  added the comment:

OK. being more specific about the test situation.

When I run ./python -m test test_multiprocessing_fork all is fine. However, 
when I run it as: ./python -m test -j2 test_multiprocessing_main_handling 
test_multiprocessing_fork

test_multiprocessing_main_handling PASSes and test_multiprocessing_fork crashes 
(and has a segmentation core dump in the process).

--
title: test_multiprocessing_* - crash in PyDict_GetItem - segmentation error -> 
test_multiprocessing_fork - crashes in PyDict_GetItem - segmentation error

___
Python tracker 

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



[issue35860] ProcessPoolExecutor subprocesses crash & break pool when raising an exception with keyword-only args and an arg passed to Exception

2019-01-30 Thread Bence Nagy


New submission from Bence Nagy :

ProcessPoolExecutor's subprocesses normally transparently proxy exceptions
raised within a child to the parent process.

One special case I bumped into however causes a crash
within the stdlib code responsible for communication.
The special case is triggered when both of these are true:

1) The exception being raised uses `*` to mark arguments as keyword-only
2) The exception being raised sets a positional argument for Exception: 
`super().__init__("test")`

I have attached a file which demonstrates what happens
when only 1), only 2), and both 1) and 2) are true.

Running the file with Python 3.7.2 will result in this output:

```
 raised Works1('test')

 raised Works2()

 raised BrokenProcessPool('A process in the 
process pool was terminated abruptly while the future was running or pending.')
```

The expected result for the third call would be keeping the executor usable and 
printing this:

```
 raised Breaks('test')
```

--
components: Library (Lib)
files: ppe_crash.py
messages: 334570
nosy: underyx
priority: normal
severity: normal
status: open
title: ProcessPoolExecutor subprocesses crash & break pool when raising an 
exception with keyword-only args and an arg passed to Exception
type: behavior
versions: Python 3.7
Added file: https://bugs.python.org/file48086/ppe_crash.py

___
Python tracker 

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



[issue25592] distutils docs: data_files always uses sys.prefix

2019-01-30 Thread Antoine Pitrou


Antoine Pitrou  added the comment:


New changeset ebae1ce9c40e62ce52dc968f86ed11578d2fcdfd by Antoine Pitrou (Miss 
Islington (bot)) in branch '3.7':
bpo-25592: Improve documentation of distutils data_files (GH-9767) (GH-11701)
https://github.com/python/cpython/commit/ebae1ce9c40e62ce52dc968f86ed11578d2fcdfd


--

___
Python tracker 

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



[issue25592] distutils docs: data_files always uses sys.prefix

2019-01-30 Thread Antoine Pitrou


Antoine Pitrou  added the comment:

Fixing this on 2.7 would require additional investigation (distutils might have 
diverged), so I'm closing now.

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
versions:  -Python 2.7

___
Python tracker 

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



[issue29999] repr() of ImportError misses keyword arguments name and path

2019-01-30 Thread Rémi Lapeyre

Rémi Lapeyre  added the comment:

I think the issue steems from the more general #27015 for which a PR is ready 
that fixes the repr not only for ImportError but all other BaseException 
subclasses that override __init__.

--
keywords: +patch
nosy: +remi.lapeyre
pull_requests: +11554

___
Python tracker 

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



[issue25592] distutils docs: data_files always uses sys.prefix

2019-01-30 Thread Éric Araujo

Éric Araujo  added the comment:

Thanks for the analysis and PR!  Sorry that the slow process here was 
frustrating.

--

___
Python tracker 

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



[issue25592] distutils docs: data_files always uses sys.prefix

2019-01-30 Thread miss-islington


Change by miss-islington :


--
pull_requests: +11551, 11552

___
Python tracker 

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



[issue25592] distutils docs: data_files always uses sys.prefix

2019-01-30 Thread miss-islington


Change by miss-islington :


--
pull_requests: +11551, 11552, 11553

___
Python tracker 

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



[issue25592] distutils docs: data_files always uses sys.prefix

2019-01-30 Thread miss-islington


Change by miss-islington :


--
pull_requests: +11551

___
Python tracker 

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



[issue25592] distutils docs: data_files always uses sys.prefix

2019-01-30 Thread Antoine Pitrou


Antoine Pitrou  added the comment:


New changeset 598e15d4feaee3849a91d92c9ca51f17baafe19c by Antoine Pitrou 
(jdemeyer) in branch 'master':
bpo-25592: Improve documentation of distutils data_files (GH-9767)
https://github.com/python/cpython/commit/598e15d4feaee3849a91d92c9ca51f17baafe19c


--

___
Python tracker 

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



[issue34222] Email message serialization enters an infinite loop when folding non-ASCII headers with long words

2019-01-30 Thread Ivan Krivosheev

Ivan Krivosheev  added the comment:

Hello Grigory. I using our patch in my project. I have some problems with your 
fixes.


Source text:
Subject: test Венесуэла собирается пересмотреть стоимость заключенных с Россией 
контрактов на поставку вооружений, а также отношения с Москвой в целом. Об этом 
заявил назначенный оппозицией специальный представитель Венесуэлы при 
Организации американских государств (ОАГ) Густаво Тарре Брисеньо на выступлении 
в вашингтонском Центре стратегических и международных исследований, передает

Encoded text using thunderbird:
Subject: =?UTF-8?B?dGVzdCDQktC10L3QtdGB0YPRjdC70LAg0YHQvtCx0LjRgNCw0LXRgtGB?=
 =?UTF-8?B?0Y8g0L/QtdGA0LXRgdC80L7RgtGA0LXRgtGMINGB0YLQvtC40LzQvtGB0YLRjCA=?=
 =?UTF-8?B?0LfQsNC60LvRjtGH0LXQvdC90YvRhSDRgSDQoNC+0YHRgdC40LXQuSDQutC+0L0=?=
 =?UTF-8?B?0YLRgNCw0LrRgtC+0LIg0L3QsCDQv9C+0YHRgtCw0LLQutGDINCy0L7QvtGA0YM=?=
 =?UTF-8?B?0LbQtdC90LjQuSwg0LAg0YLQsNC60LbQtSDQvtGC0L3QvtGI0LXQvdC40Y8g0YEg?=
 =?UTF-8?B?0JzQvtGB0LrQstC+0Lkg0LIg0YbQtdC70L7QvC4g0J7QsSDRjdGC0L7QvCDQt9Cw?=
 =?UTF-8?B?0Y/QstC40Lsg0L3QsNC30L3QsNGH0LXQvdC90YvQuSDQvtC/0L/QvtC30LjRhtC4?=
 =?UTF-8?B?0LXQuSDRgdC/0LXRhtC40LDQu9GM0L3Ri9C5INC/0YDQtdC00YHRgtCw0LLQuNGC?=
 =?UTF-8?B?0LXQu9GMINCS0LXQvdC10YHRg9GN0LvRiyDQv9GA0Lgg0J7RgNCz0LDQvdC40Lc=?=
 =?UTF-8?B?0LDRhtC40Lgg0LDQvNC10YDQuNC60LDQvdGB0LrQuNGFINCz0L7RgdGD0LTQsNGA?=
 =?UTF-8?B?0YHRgtCyICjQntCQ0JMpINCT0YPRgdGC0LDQstC+INCi0LDRgNGA0LUg0JHRgNC4?=
 =?UTF-8?B?0YHQtdC90YzQviDQvdCwINCy0YvRgdGC0YPQv9C70LXQvdC40Lgg0LIg0LLQsNGI?=
 =?UTF-8?B?0LjQvdCz0YLQvtC90YHQutC+0Lwg0KbQtdC90YLRgNC1INGB0YLRgNCw0YLQtdCz?=
 =?UTF-8?B?0LjRh9C10YHQutC40YUg0Lgg0LzQtdC20LTRg9C90LDRgNC+0LTQvdGL0YUg0Lg=?=
 =?UTF-8?B?0YHRgdC70LXQtNC+0LLQsNC90LjQuSwg0L/QtdGA0LXQtNCw0LXRgg==?=

Text after decode and encode in python with our patch:
Subject: test =?utf-8?b?0JLQtdC90LXRgdGD0Y3Qu9CwINGB0L7QsdC40YDQsNC10YLRgdGP?=
 =?utf-8?b?0L/=?utf-8?q?QtdGA0LXRgdC80L7RgtGA0LXRgtGM=3F=3D_=D1=81=D1=82?=
 =?utf-8?b?0L7QuNC80L7RgdGC0Ywg0LfQsNC60LvRjtGH0LXQvdC90YvRhSDRgSDQoNC+0YE=?=
 =?utf-8?b?0YHQuNC10Lkg0LrQvtC90YLRgNCw0LrRgtC+0LIg0L3QsCDQv9C+0YHRgtCw0LI=?=
 =?utf-8?b?0LrRgyDQstC+0L7RgNGD0LbQtdC90LjQuSwg0LAg0YLQsNC60LbQtSDQvtGC0L0=?=
 =?utf-8?b?0L7RiNC10L3QuNGPINGBINCc0L7RgdC60LLQvtC5INCyINGG0LXQu9C+0LwuINCe?=
 =?utf-8?b?0LEg0Y3RgtC+0Lwg0LfQsNGP0LLQuNC7INC90LDQt9C90LDRh9C10L3QvdGL0Lkg?=
 =?utf-8?b?0L7Qv9C/0L7Qt9C40YbQuNC10Lkg0YHQv9C10YbQuNCw0LvRjNC90YvQuSDQv9GA?=
 =?utf-8?b?0LXQtNGB0YLQsNCy0LjRgtC10LvRjCDQktC10L3QtdGB0YPRjdC70Ysg0L/RgNC4?=
  =?utf-8?b?0J7RgNCz0LDQvdC40LfQsNGG0LjQuCDQsNC80LXRgNC40LrQsNC90YHQutC40YU=?=
 =?utf-8?b?0LPQvtGB0YPQtNCw0YDRgdGC0LIgKNCe0JDQkykg0JPRg9GB0YLQsNCy0L4g0KI=?=
 =?utf-8?b?0LDRgNGA0LUg0JHRgNC40YHQtdC90YzQviDQvdCwINCy0YvRgdGC0YPQv9C70LU=?=
 =?utf-8?b?0L3QuNC4INCyINCy0LDRiNC40L3Qs9GC0L7QvdGB0LrQvtC8INCm0LXQvdGC0YA=?=
 =?utf-8?b?0LUg0YHRgtGA0LDRgtC10LPQuNGH0LXRgdC60LjRhSDQuCDQvNC10LbQtNGD0L0=?=
 =?utf-8?b?0LDRgNC+0LTQvdGL0YUg0LjRgdGB0LvQtdC00L7QstCw0L3QuNC5LCDQv9C10YA=?=
 =?utf-8?b?0LXQtNCw0LXRgg==?=

Result text:
Subject: test Венесуэла собирается
 =?utf-8?b?0L/QtdGA0LXRgdC80L7RgtGA0LXRgtGM?= стоимость заключенных с Россией 
контрактов на поставку вооружений, а также отношения с Москвой в целом. Об этом 
заявил назначенный оппозицией специальный представитель Венесуэлы 
приОрганизации американскихгосударств (ОАГ) Густаво Тарре Брисеньо на 
выступлении в вашингтонском Центре стратегических и международных исследований, 
передает

If need, i can write simple code for reproduce bug.

--
nosy: +ikrivosheev

___
Python tracker 

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



[issue35859] Capture behavior depends on the order of an alternation

2019-01-30 Thread Ma Lin


Change by Ma Lin :


--
nosy: +Ma Lin

___
Python tracker 

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



[issue30951] Documentation error in inspect module

2019-01-30 Thread Utkarsh Gupta


Utkarsh Gupta  added the comment:

Serhiy: What change d'you possibly suggest then?

--

___
Python tracker 

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



[issue35517] selector.EpollSelector: add new parameter to support EPOLLEXCLUSIVE

2019-01-30 Thread Manjusaka


Manjusaka  added the comment:

ping

--

___
Python tracker 

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



[issue35854] EnvBuilder and venv symlinks do not work on Windows on 3.7.2

2019-01-30 Thread Steve Dower


Steve Dower  added the comment:

No, removing it was accidental. But when I tried it myself with a few regular 
installs of 3.5 and later, none of them updated sys.path correctly, and all of 
them resolved the links in the loader (or perhaps the shell?).

I hadn't activated the environments, as I generally don't, but if that's 
required for symlinks to work here then I consider them broken.

--

___
Python tracker 

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



[issue35859] Capture behavior depends on the order of an alternation

2019-01-30 Thread James Davis


New submission from James Davis :

I have two regexes: /(a|ab)*?b/ and /(ab|a)*?b/.
If I re.search the string "ab" for these regexes, I get inconsistent behavior.
Specifically, /(a|ab)*?b/ matches with capture "a", while /(ab|a)*?b/ matches 
with an empty capture group.

I am not actually sure which behavior is correct.


Interpretation 1: The (ab|a) clause matches the a, satisfying the (ab|a)*? 
once, and the engine proceeds to the b and completes. The capture group ends up 
containing "a".

Interpretation 2: The (ab|a) clause matches the a. Since the clause is marked 
with *, the engine repeats the attempt and finds nothing the second time. It 
proceeds to the b and completes. Because the second match attempt on (ab|a) 
found nothing, the capture group ends up empty.

The behavior depends on both the order of (ab|a) vs. (a|ab), and the use of the 
non-greedy quantifier.

I cannot see why changing the order of the alternation should have this effect.

The change in behavior occurs in the built-in "re" module but not in the 
competing "regex" module.
The behavior is consistent in both Python 2.7 and Python 3.5. I have not tested 
other versions.

I have included the confusing-regex-behavior.py file for troubleshooting.

Below is the behavior for matches on these and many variants.
I find the following lines the most striking:

Regex patternmatched?   matched string captured 
content
   

(ab|a)*?bTrue   ab
('',)
(ab|a)+?bTrue   ab
('',)
(ab|a){0,}?b True   ab
('',)
(ab|a){0,2}?bTrue   ab
('',)
(ab|a){0,1}?bTrue   ab   
('a',)
(ab|a)*b True   ab   
('a',)
(ab|a)+b True   ab   
('a',)
(a|ab)*?bTrue   ab   
('a',)
(a|ab)+?bTrue   ab   
('a',)


(08:58:48) jamie@woody ~ $ python3 /tmp/confusing-regex-behavior.py 


Behavior from re


Regex patternmatched?   matched string captured 
content
   

(ab|a)*?bTrue   ab
('',)
(ab|a)+?bTrue   ab
('',)
(ab|a){0,}?b True   ab
('',)
(ab|a){0,2}?bTrue   ab
('',)
(ab|a)?b True   ab   
('a',)
(ab|a)??bTrue   ab   
('a',)
(ab|a)b  True   ab   
('a',)
(ab|a){0,1}?bTrue   ab   
('a',)
(ab|a)*b True   ab   
('a',)
(ab|a)+b True   ab   
('a',)
(a|ab)*b True   ab   
('a',)
(a|ab)+b True   ab   
('a',)
(a|ab)*?bTrue   ab   
('a',)
(a|ab)+?bTrue   ab   
('a',)
(a|ab)*?bTrue   ab   
('a',)
(a|ab)*?bTrue   ab   
('a',)
(a|ab)*?bTrue   ab   
('a',)
(a|ab)*?bTrue   ab   
('a',)
(bb|a)*?bTrue   ab   
('a',)
((?:ab|a)*?)bTrue   ab   
('a',)
((?:a|ab)*?)bTrue   ab   
('a',)


Behavior from regex


Regex patternmatched?   matched string captured 
content
   

(ab|a)*?bTrue   ab   
('a',)
(ab|a)+?bTrue   ab   
('a',)
(ab|a){0,}?b True   ab   
('a',)
(ab|a){0,2}?bTrue   ab   
('a',)
(ab|a)?b True   ab   
('a',)
(ab|a)??bTrue  

[issue35823] Use vfork() in subprocess on Linux

2019-01-30 Thread Alexey Izbyshev

Alexey Izbyshev  added the comment:

I've been struggling with fixing spurious -Wclobbered GCC warnings. Originally, 
I've got the following:

/scratch2/izbyshev/cpython/Modules/_posixsubprocess.c: In function 
‘subprocess_fork_exec’:
/scratch2/izbyshev/cpython/Modules/_posixsubprocess.c:612:15: warning: variable 
‘gc_module’ might be clobbered by ‘longjmp’ or ‘vfork’ [-Wclobbered]
 PyObject *gc_module = NULL;
   ^
/scratch2/izbyshev/cpython/Modules/_posixsubprocess.c:616:15: warning: variable 
‘preexec_fn_args_tuple’ might be clobbered by ‘longjmp’ or ‘vfork’ [-Wclobbered]
 PyObject *preexec_fn_args_tuple = NULL;
   ^
/scratch2/izbyshev/cpython/Modules/_posixsubprocess.c:621:17: warning: variable 
‘cwd’ might be clobbered by ‘longjmp’ or ‘vfork’ [-Wclobbered]
 const char *cwd;
 ^~~
/scratch2/izbyshev/cpython/Modules/_posixsubprocess.c:623:9: warning: variable 
‘need_to_reenable_gc’ might be clobbered by ‘longjmp’ or ‘vfork’ [-Wclobbered]
 int need_to_reenable_gc = 0;
 ^~~
/scratch2/izbyshev/cpython/Modules/_posixsubprocess.c:624:38: warning: variable 
‘argv’ might be clobbered by ‘longjmp’ or ‘vfork’ [-Wclobbered]
 char *const *exec_array, *const *argv = NULL, *const *envp = NULL;
  ^~~~
/scratch2/izbyshev/cpython/Modules/_posixsubprocess.c:624:59: warning: variable 
‘envp’ might be clobbered by ‘longjmp’ or ‘vfork’ [-Wclobbered]
 char *const *exec_array, *const *argv = NULL, *const *envp = NULL;
   ^~~~
/scratch2/izbyshev/cpython/Modules/_posixsubprocess.c:626:9: warning: variable 
‘need_after_fork’ might be clobbered by ‘longjmp’ or ‘vfork’ [-Wclobbered]
 int need_after_fork = 0;
 ^~~
/scratch2/izbyshev/cpython/Modules/_posixsubprocess.c:627:9: warning: variable 
‘saved_errno’ might be clobbered by ‘longjmp’ or ‘vfork’ [-Wclobbered]
 int saved_errno = 0;
 ^~~

I've checked that all warnings are spurious: all flagged variables are either 
not modified in the child or modified and used only by the child. A simple way 
to suppress the warnings would be "volatile", but I don't want to spray 
"volatile" over the huge declaration block of subprocess_fork_exec().

Another way is to move vfork() to a separate function and ensure that this 
function does as little as possible with its local variables. I've implemented 
two versions of this approach, both are ugly in some sense. I've pushed the 
first into the PR branch and the second into a separate branch 
https://github.com/izbyshev/cpython/tree/single-do-fork-exec.

Yet another way would be to simply disable this diagnostic for _posixsubprocess 
(e.g. via #pragma GCC diagnostic), but I'm not sure we want to do that -- may 
be it'll be fixed in the future or a real defect will be introduced into our 
code.

--

___
Python tracker 

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



[issue35858] Consider adding the option of running shell/console commands inside the REPL

2019-01-30 Thread jcrmatos


jcrmatos  added the comment:

Yes, I understand that, but I don't see why that should prevent this feature 
from going forward.

--

___
Python tracker 

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



[issue35858] Consider adding the option of running shell/console commands inside the REPL

2019-01-30 Thread pmpp


pmpp  added the comment:

Hi, maybe have a look to third parties for that 
because repl internals are tied to each supported platforms.

https://xon.sh/index.html

https://github.com/pmp-p/aioprompt

https://github.com/prompt-toolkit

--
nosy: +pmpp

___
Python tracker 

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



[issue35858] Consider adding the option of running shell/console commands inside the REPL

2019-01-30 Thread jcrmatos


New submission from jcrmatos :

Consider adding the option of running shell/console commands inside the REPL.
Something like
>>>!ls

--
messages: 334556
nosy: jcrmatos
priority: normal
severity: normal
status: open
title: Consider adding the option of running shell/console commands inside the 
REPL
type: enhancement
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



[issue35857] Stacktrace shows lines from updated file on disk, not code actually running

2019-01-30 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

Looking more into the issue8087 there is issue31300 and issue23594 that are 
linked as duplicates with issue31300 very similar to this report. Maybe close 
this to continue discussion on issue8087?

--

___
Python tracker 

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



[issue35857] Stacktrace shows lines from updated file on disk, not code actually running

2019-01-30 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

See also issue8087 that has a similar case with interactive shell where the 
imported module was changed on disk. It has some discussion along similar lines 
with some more possible cases msg145291.

--
nosy: +xtreak

___
Python tracker 

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



[issue35857] Stacktrace shows lines from updated file on disk, not code actually running

2019-01-30 Thread Jonathan Fine


Jonathan Fine  added the comment:

The problem, as I understand it, is a mismatch between the code object being 
executed and the file on disk referred to by the code object. When a module is 
reloaded it is first recompiled, if the .py file is newer than the .pyc file. 
(I've tested this at a console.)

Suppose wibble.py contains a function fn. Now do
   import wibble
   fn = wibble.fn
   # Modify and save wibble.py
   reload(wibble)
   fn()

It seems to me that
1) We have a mismatch between fn (in module __main__) and the file on disk.
2) Comparison will show that wibble.pyc is later than wibble.py.
3) There's no reliable way to discover that fn is not the current fn  ...
4) ... other than comparing its bytecode with that of the current value of 
wibble.fn.

Regarding (4) there might be another method. But I can't think of one that's 
reliable.

--
nosy: +jfine2358

___
Python tracker 

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



[issue35857] Stacktrace shows lines from updated file on disk, not code actually running

2019-01-30 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

There may be something we can do to improve the error reporting and make 
it less perplexing:

https://mail.python.org/pipermail/python-ideas/2019-January/055041.html

--

___
Python tracker 

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



[issue35857] Stacktrace shows lines from updated file on disk, not code actually running

2019-01-30 Thread Steve Pryde


Steve Pryde  added the comment:

> How is Python supposed to do that without making a copy of every module and 
> script it runs just in case it gets modified?

Aha, I suspected this might be the reason. Feel free to close this issue if 
there's nothing else to be said here.

Python certainly only executes the code as it was at the time of initial 
execution, or rather it executes the generated bytecode. I gather therefore 
that python has enough info to display the files and line numbers but not their 
contents (which must be loaded fresh from disk).

As mentioned, if this is the case, I'm happy for this to be closed. Cheers.

--

___
Python tracker 

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



[issue35857] Stacktrace shows lines from updated file on disk, not code actually running

2019-01-30 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

> It should instead show the lines from the file as it was when the code was 
> executed.

How is Python supposed to do that without making a copy of every module and 
script it runs just in case it gets modified?

(That's not a rhetorical question -- if you can think of a cheap way to 
implement this, I'm listening :-)

99.99% of the time this would be a total waste of time, so this would be a very 
expensive exercise for very little gain. Python's startup time is already too 
slow without having to also make potentially hundreds of file copies every time 
you run a script.

For the record, I too once ran into this issue. It left me utterly confused for 
an hour or so until I worked out what was happening, and then I never made the 
mistake of editing a running script again.

--
nosy: +steven.daprano

___
Python tracker 

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



[issue35848] readinto is not a method on io.TextIOBase

2019-01-30 Thread Steve Palmer

Steve Palmer  added the comment:

I don't have a "real" use case.  I discovered the issue when I was developing a 
unittest suite for what it means to be "file-like".  I've been codifying the 
description in the standard library and exercising my tests against the 
built-in file-likes, such as the io.StringIO class, when it raised the 
Attribute Exception.

The more I think about it, the more like a documentation problem it feels.  For 
example, the statement "... because their signatures will vary ..." does not 
apply to readinto in the cases where it is defined.

For completeness, the note in io.TextIOBase stating "There is no readinto() 
method because Python’s character strings are immutable." would also need to be 
removed as part of a documentation fix.

(It's also nice when solutions result in less "stuff". :-)

--

___
Python tracker 

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



[issue35848] readinto is not a method on io.TextIOBase

2019-01-30 Thread Martin Panter

Martin Panter  added the comment:

I think it would be more practical to fix the documentation (option 1). Do you 
have a use case for “TextIOBase.readinto” raising ValueError (something more 
concrete than someone having expectations)?

--
nosy: +martin.panter

___
Python tracker 

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