[issue38519] Internal include files missing on Windows

2019-10-24 Thread Zackery Spytz


Zackery Spytz  added the comment:

Hi, Steve. I've created a PR for this.

--
nosy: +ZackerySpytz

___
Python tracker 

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



[issue38519] Internal include files missing on Windows

2019-10-24 Thread Zackery Spytz


Change by Zackery Spytz :


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

___
Python tracker 

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



[issue38582] re: backreference number in replace string can't >= 100

2019-10-24 Thread Ma Lin


Ma Lin  added the comment:

@veaba 
Post only in English is fine.

> Is this actually needed?
Maybe very very few people dynamically generate some large patterns.

> However, \g<...> is not accepted in a pattern.
> in the "regex" module I added support for it in a pattern too.
Yes, backreference number in pattern also can't >= 100
Support \g<...> in pattern is a good idea.

If fix this issue, may produce backward compatibility issue: the parser will 
confuse backreference numbers and octal escape numbers.
Maybe can clarify the limit (<=99) in the document is enough.

--

___
Python tracker 

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



[issue38587] __set_name__ missing from descriptor howto documentation

2019-10-24 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Thanks for the note.  I've already go this in my pending edits.

--
assignee: docs@python -> rhettinger
nosy: +rhettinger
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> Descriptors HowTo doesn't mention __set_name__

___
Python tracker 

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



[issue35448] ConfigParser .read() - handling of nonexistent files

2019-10-24 Thread Batuhan


Change by Batuhan :


--
versions: +Python 3.9 -Python 3.8

___
Python tracker 

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



[issue35448] ConfigParser .read() - handling of nonexistent files

2019-10-24 Thread Batuhan


Change by Batuhan :


--
keywords: +patch
pull_requests: +16452
stage: test needed -> patch review
pull_request: https://github.com/python/cpython/pull/16920

___
Python tracker 

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



[issue38582] re: backreference number in replace string can't >= 100

2019-10-24 Thread veaba

veaba <908662...@qq.com> added the comment:

这里来自实际我的一个项目(https://github.com/veaba/tensorflow-docs/blob/master/scripts/spider_tensorflow_docs.py#L39-L56),当然也许我这个方法不是正确的,它只是我刚学python的一个尝试。

这个项目步骤是这样:根据HTML tag 提取文本转为markdown格式。 标签,需要用符号“`”包围,然后循环里面将匹配的字符通过\\* 
替换出来。

所以,你们见到了,我发现这样的一个正则溢出错误。


如果能够放开反斜杠替换符无限个数限制对我会很友好,当然如果真的不需要的话,我自己想别的办法。


This is from a project I actually worked on 
(https://github.com/veaba/tensorflow-docs/blob/master/scripts/spider_tensorflow_docs.py#L39-L56).
 Of course, this method is not correct. It's just an attempt to learn python.



The project steps are as follows: extract the text according to HTML tag and 
change it to markdown format. The < code > label needs to be surrounded by the 
symbol "`", and then the matching characters are replaced by \ \ * in the loop.



So, as you can see, I found such a regular overflow error.




It would be nice for me to be able to let go of the infinite number of 
backslash substitutions. Of course, if I really don't need it, I'll try 
something else.

--
hgrepos: +385

___
Python tracker 

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



[issue38584] argparse: Specifying a whitespace-only help message to a positional arg triggers an IndexError when displaying --help

2019-10-24 Thread paul j3


paul j3  added the comment:

Just today on SO someone found a similar bug in the help format with metavars, 
that involved an unpacking the expected only one value, but got 2.

https://stackoverflow.com/questions/58541460/tuple-metavar-value-for-positional-argument-with-nargs-1

This had be raise years ago, as https://bugs.python.org/issue14074

--

___
Python tracker 

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



[issue38584] argparse: Specifying a whitespace-only help message to a positional arg triggers an IndexError when displaying --help

2019-10-24 Thread Lucas Cimon


Lucas Cimon  added the comment:

Thanks for the feedbacks paul.j3 !

I totally agree it would be best to test all formatter classes.
I modified the new test to do so.

I think I should probably place this test somewhere else in test_argparse.py, 
but I'm having trouble figuring out where exactly... I just updated the PR and 
moved the new test to the TestOptionalsHelpVersionActions class.

About the best fix, I think a fix to _split_lines() would be more complex. It 
needs to return a list, so we would make it return [''] in that case ? That 
would be a bit strange.

What do you think ? :)

--

___
Python tracker 

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



[issue38438] argparse "usage" overly-complex with nargs="*"

2019-10-24 Thread paul j3


Change by paul j3 :


--
nosy: +paul.j3

___
Python tracker 

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



[issue38569] Unknown distribution option: 'license_files'

2019-10-24 Thread Brett Cannon


Brett Cannon  added the comment:

Why do you think the warning can be removed? Is it documented as supported in 
distutils? If setuptools supports that argument but not distutils then that 
would be a bug against them.

--
nosy: +brett.cannon

___
Python tracker 

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



[issue38587] __set_name__ missing from descriptor howto documentation

2019-10-24 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
nosy: +ncoghlan
versions: +Python 3.9 -Python 3.6

___
Python tracker 

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



[issue38582] re: backreference number in replace string can't >= 100

2019-10-24 Thread Vedran Čačić

Vedran Čačić  added the comment:

Is this actually needed? I can't remember ever needing more than 4 (in a 
pattern). I find it very hard to believe someone might actually have such a 
regex with more than a hundred backreferences. Probably it's just a misguided 
attempt to parse a nested structure with a regex.

--
nosy: +veky

___
Python tracker 

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



[issue38587] __set_name__ missing from descriptor howto documentation

2019-10-24 Thread Mike Driscoll


New submission from Mike Driscoll :

I noticed that __set_name__ is not mentioned in 
https://docs.python.org/3/howto/descriptor.html even though it was added in 
https://www.python.org/dev/peps/pep-0487/ and mentioned here 
https://docs.python.org/3/whatsnew/3.6.html#pep-487-descriptor-protocol-enhancements

--
assignee: docs@python
components: Documentation
messages: 355345
nosy: Mike Driscoll, docs@python
priority: normal
severity: normal
status: open
title: __set_name__ missing from descriptor howto documentation
versions: Python 3.6, Python 3.7, Python 3.8

___
Python tracker 

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



[issue38558] Data Structures documentation out of sync with new Walrus operator

2019-10-24 Thread Ammar Askar


Change by Ammar Askar :


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

___
Python tracker 

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



[issue38092] environment variables not passed correctly using new virtualenv launching in windows and python3.7+

2019-10-24 Thread Steve Dower


Steve Dower  added the comment:

You're right, the logic to actually launch _base_executable is in there twice 
now, and the second one (that never gets used) is more important.

--

___
Python tracker 

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



[issue38582] re: backreference number in replace string can't >= 100

2019-10-24 Thread Matthew Barnett


Matthew Barnett  added the comment:

A numeric escape of 3 digits is an octal (base 8) escape; the octal escape 
"\100" gives the same character as the hexadecimal escape "\x40".

In a replacement template, you can use "\g<100>" if you want group 100 because 
\g<...> accepts both numeric and named group references.

However, \g<...> is not accepted in a pattern.

(By the way, in the "regex" module I added support for it in a pattern too.)

--

___
Python tracker 

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



[issue38584] argparse: Specifying a whitespace-only help message to a positional arg triggers an IndexError when displaying --help

2019-10-24 Thread paul j3


paul j3  added the comment:

So the error occurs in HelpFormatter._format_action when 'help_lines' is an 
empty list:


if action.help:
help_text = self._expand_help(action)
help_lines = self._split_lines(help_text, help_width)
 >> parts.append('%*s%s\n' % (indent_first, '', help_lines[0]))
for line in help_lines[1:]:
parts.append('%*s%s\n' % (help_position, '', line))

It occurs with both optionals and positionals.  It does not occur with 
argparse.RawTextHelpFormatter.

The default _split_lines:

def _split_lines(self, text, width):
text = self._whitespace_matcher.sub(' ', text).strip()
return _textwrap.wrap(text, width)

Because of the 'strip' it treats a help with space as empty

In [27]: f._split_lines('',40)  
Out[27]: []
In [28]: f._split_lines('test',40)  
Out[28]: ['test']
In [29]: f._split_lines(' ',40) 
Out[29]: []

None or '' don't trigger this because they are weeded out by the 'if 
action.help:' line.

Maybe the change proposed here, to skip the problem line if 'help_lines' is 
empty is the right one.  Assuming a list is non-empty can be dangerous.  But it 
would be wise to test the patch with the alternative formatters like the 
RawText.  

It may also be worth thinking about correcting the issue in _split_lines(), 
which is shorter.  The only difference in  RawTextHelpFormatter is in this 
method.

--

___
Python tracker 

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



[issue38576] CVE-2019-18348: CRLF injection via the host part of the url passed to urlopen()

2019-10-24 Thread Gregory P. Smith


Change by Gregory P. Smith :


--
stage:  -> needs patch

___
Python tracker 

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



[issue35113] inspect.getsource returns incorrect source for classes when class definition is part of multiline strings

2019-10-24 Thread Caleb Donovick


Change by Caleb Donovick :


--
nosy: +donovick

___
Python tracker 

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



[issue38576] CVE-2019-18348: CRLF injection via the host part of the url passed to urlopen()

2019-10-24 Thread Gregory P. Smith


Change by Gregory P. Smith :


--
nosy: +gregory.p.smith

___
Python tracker 

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



[issue33348] lib2to3 doesn't parse f(*[] or [])

2019-10-24 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

I'm marking this fixed, technically it still exists in 2.7.  it'll be up to 
someone who cares about making a change to 2.7 to make a PR to go in there for 
the final release.  It has existed so long, I doubt it matters there.

--
resolution:  -> fixed
stage: patch review -> commit review
status: open -> closed
versions:  -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



[issue20443] __code__. co_filename should always be an absolute path

2019-10-24 Thread Yury Selivanov


Change by Yury Selivanov :


--
nosy:  -yselivanov

___
Python tracker 

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



[issue20443] __code__. co_filename should always be an absolute path

2019-10-24 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

(read that as: feel free to keep the behavior for co_filename and path[0] and 
lets see what happens :)

--

___
Python tracker 

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



[issue20443] __code__. co_filename should always be an absolute path

2019-10-24 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

I think sys.argv[0] is the important one as program logic often tends to use 
that as an input.

I'm honestly unsure of if this will be as much of a problem for .co_filename or 
sys.path[0].

--

___
Python tracker 

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



[issue38586] logging: handlers names are not set when using fileConfig

2019-10-24 Thread Lucas Cimon


Change by Lucas Cimon :


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

___
Python tracker 

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



[issue38586] logging: handlers names are not set when using fileConfig

2019-10-24 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +vinay.sajip

___
Python tracker 

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



[issue38586] logging: handlers names are not set when using fileConfig

2019-10-24 Thread Lucas Cimon


New submission from Lucas Cimon :

The logging.Handler .name property is not set when the logging configuration is 
loaded with logging.fileConfig

--
components: Library (Lib)
messages: 355338
nosy: Lucas Cimon
priority: normal
severity: normal
status: open
title: logging: handlers names are not set when using fileConfig
versions: Python 3.9

___
Python tracker 

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



[issue38585] defusedexpat not supported past python 3.3/3.4

2019-10-24 Thread STINNER Victor


Change by STINNER Victor :


--
nosy: +christian.heimes

___
Python tracker 

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



[issue38584] argparse: Specifying a whitespace-only help message to a positional arg triggers an IndexError when displaying --help

2019-10-24 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +paul.j3, rhettinger

___
Python tracker 

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



[issue38585] defusedexpat not supported past python 3.3/3.4

2019-10-24 Thread Avi Kelman


New submission from Avi Kelman :

https://docs.python.org/3/library/xml.html continues to recommend defusedexpat, 
but that package won't install for any Python versions after 3.4 because the 
package isn't being maintained. 
https://bitbucket.org/tiran/defusedexpat/src/default/ linked from 
https://pypi.org/project/defusedexpat/ stops at 3.3. 
https://github.com/tiran/defusedexpat stops at 3.4.

If the package doesn't actually work for newer Pythons, the recommendation 
should be removed from official documentation.

--
assignee: docs@python
components: Documentation
messages: 355337
nosy: Avi Kelman, docs@python
priority: normal
severity: normal
status: open
title: defusedexpat not supported past python 3.3/3.4
type: behavior
versions: 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



[issue38584] argparse: Specifying a whitespace-only help message to a positional arg triggers an IndexError when displaying --help

2019-10-24 Thread Lucas Cimon


Change by Lucas Cimon :


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

___
Python tracker 

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



[issue38584] argparse: Specifying a whitespace-only help message to a positional arg triggers an IndexError when displaying --help

2019-10-24 Thread Lucas Cimon


New submission from Lucas Cimon :

The test I am going to add to test_argparse.py:

def test_whitespace_help(self):
parser = self._get_parser()
parser.add_argument(
'--foo2', action='store_true', help=' ')
parser.add_argument(
'bar2', type=float, help=' ')
parser.format_help()  # raises an IndexError

--
components: Library (Lib)
messages: 355336
nosy: Lucas Cimon
priority: normal
severity: normal
status: open
title: argparse: Specifying a whitespace-only help message to a positional arg 
triggers an IndexError when displaying --help
versions: Python 3.9

___
Python tracker 

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



[issue20443] __code__. co_filename should always be an absolute path

2019-10-24 Thread STINNER Victor


STINNER Victor  added the comment:

> To help address the original report filing issue, we could add a notion of 
> .co_cwd to code objects for use in resolving co_filename.  Allow it to be '' 
> if getcwd failed at source load time.  Code could check if co_cwd exists and 
> join it with the co_filename.  Also let co_cwd remain empty when there is no 
> valid co_filename for the code.

Do you mean that co_filename attribute of code objects must remain relative?


> Preaching: Code that calls os.chdir() is always a potential problem as it 
> alters process global state.  That call is best avoided as modifying globals 
> is impolite.

I thought that calling os.chdir("/") is a good practice when launching a 
program as a daemon. And thne call os.fork() twice to detach the process from 
its parent and run it in background.

I commonly use os.chdir() in my programs for various reasons. A classical use 
case is to mimick a shell script doing something like (cd $DIRECTORY; command): 
temporary change the current directory.

cwd parameter of subprocess.Popen helps to avoid changing the currently 
directory, but sometimes subprocess is not used at all.

Maybe avoiding os.chdir() is a good practice, but it's hard to prevent users to 
call it. I don't see how os.chdir() is bad by design. I'm not sure that it's 
really useful to debate this neither :-)

--

___
Python tracker 

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



[issue20443] __code__. co_filename should always be an absolute path

2019-10-24 Thread STINNER Victor


STINNER Victor  added the comment:

> Please revert.

Ok ok, I will revert my change, but only on sys.argv[0].


> A getcwd() call doesn't even have to succeed.  A single file python program 
> should still be able to run in that environment rather than fail to start.

The current implementation leaves a path unchanged if it fails to make it 
absolute:

config_run_filename_abspath:

wchar_t *abs_filename;
if (_Py_abspath(config->run_filename, _filename) < 0) {
/* failed to get the absolute path of the command line filename:
   ignore the error, keep the relative path */
return _PyStatus_OK();
}
if (abs_filename == NULL) {
return _PyStatus_NO_MEMORY();
}

PyMem_RawFree(config->run_filename);
config->run_filename = abs_filename;

with:

/* Get an absolute path.
   On error (ex: fail to get the current directory), return -1.
   On memory allocation failure, set *abspath_p to NULL and return 0.
   On success, return a newly allocated to *abspath_p to and return 0.
   The string must be freed by PyMem_RawFree(). */
int _Py_abspath(const wchar_t *path, wchar_t **abspath_p);

--

___
Python tracker 

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



[issue38583] The activate script in Windows is not correct for venvs created in git-bash

2019-10-24 Thread Mo


New submission from Mo :

When creating a virtual environment on Windows from git-bash (using python -m 
venv), VIRTUAL_ENV in the activate script is set using a windows style path 
(C:\some\path) instead of the bash style (/c/some/path).

This means the system python and pip get used, despite the user thinking they 
are working in a venv after sourcing activate.

As activate is a bash script, the paths in it should always be in the bash 
style, regardless of platform.

This is described in a stack overflow issue here: 
https://stackoverflow.com/questions/57758841/windows-virtualenv-created-via-gitbash-using-system-python

I have confirmed the behaviour in 3.7.3, 3.7.4, 3.7.5 and 3.8.0.

--
components: Windows
messages: 355333
nosy: Mo, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: The activate script in Windows is not correct for venvs created in 
git-bash
type: behavior
versions: Python 3.7, Python 3.8

___
Python tracker 

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



[issue38582] re: backreference number in replace string can't >= 100

2019-10-24 Thread Ma Lin


Ma Lin  added the comment:

Backreference number in replace string can't >= 100
https://github.com/python/cpython/blob/v3.8.0/Lib/sre_parse.py#L1022-L1036

If none take this, I will try to fix this issue tomorrow.

--
nosy: +serhiy.storchaka
title: Regular match overflow -> re: backreference number in replace string 
can't >= 100
versions: +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



[issue38581] Crash on distutils/util.py when header variable isn't a string

2019-10-24 Thread STINNER Victor


STINNER Victor  added the comment:

I'm not sure of the status of bzr. Is it still maintained? It sounds like 
Breezy is the new upstream.

I don't think that it's worth it to bother with modifying distutils. Especially 
because it will take weeks or months until your system will get the fix.

I close the issue as rejected.

--
resolution:  -> rejected
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



[issue38582] Regular match overflow

2019-10-24 Thread Ma Lin


Ma Lin  added the comment:

An simpler reproduce code:

```
import re

NUM = 99

# items = [ '(001)', '(002)', '(003)', ..., '(NUM)']
items = [r'(%03d)' % i for i in range(1, 1+NUM)]
pattern = '|'.join(items)

# repl = '\1\2\3...\NUM'
temp = ('\\' + str(i) for i in range(1, 1+NUM))
repl = ''.join(temp)

text = re.sub(pattern, repl, '(001)')
print(text)

# if NUM == 99
# output: (001)
# if NUM == 100
# output: (001@)
# if NUM == 101
# output: (001@A)
```

--
components: +Regular Expressions
nosy: +ezio.melotti, mrabarnett

___
Python tracker 

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



[issue38576] CVE-2019-18348: CRLF injection via the host part of the url passed to urlopen()

2019-10-24 Thread Charalampos Stratakis


Change by Charalampos Stratakis :


--
nosy: +cstratak

___
Python tracker 

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



[issue38582] Regular match overflow

2019-10-24 Thread Ma Lin


Change by Ma Lin :


--
nosy: +Ma Lin
type: security -> 

___
Python tracker 

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



[issue38340] ERROR WHILE BUILDING pyworld for x86_64-linux-gnu-gcc

2019-10-24 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


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



[issue38581] Crash on distutils/util.py when header variable isn't a string

2019-10-24 Thread Lealinux


Lealinux  added the comment:

bzr (2.7) fail on install with pip3.7/pip3.8
breezy (3.x) success on install with pip3.7/pip3.8

We can forget the patch and close the report issue;
Sorry for the disturb :(

--

___
Python tracker 

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



[issue38582] Regular match overflow

2019-10-24 Thread veaba

New submission from veaba <908662...@qq.com>:

Regular match overflow
code:
```python
import re
# list => str
def list_to_str(str_list, code=""):
if isinstance(str_list, list):
return code.join(str_list)
else:
return ''
def fn_parse_code(list_str, text):
code_text_str=''
code_text_str = list_to_str(list_str, '|')  # => xxx|oo
reg_list = ['+', '.', '[', ']','((','))']
for reg in reg_list:
code_text_str_temp = code_text_str.replace(reg, "\\" + 
reg).replace('((','(\\(').replace('))','))')
code_text_str=code_text_str_temp

# compile
pattern_str = re.compile(code_text_str )

#list_str=>\\1\\2\\...

flag_str = ''

for item in enumerate(list_str):
flag_str = flag_str + "\\" + str(item[0] + 1)

print("1:",pattern_str)
print("2:",flag_str)
print("3:",text)
reg_text = re.sub(r''+code_text_str+'', "`" + flag_str + "`", text)
return reg_text

# a list
strs=['(tf.batch_gather)', '(None)', '(tf.bitwise.bitwise_and)', '(None)', 
'(tf.bitwise.bitwise_or)', '(None)', '(tf.bitwise.bitwise_xor)', '(None)', 
'(tf.bitwise.invert)', '(None)', '(tf.bitwise.left_shift)', '(None)', 
'(tf.bitwise.right_shift)', '(None)', '(tf.clip_by_value)', '(None)', 
'(tf.concat)', "('concat')", '(tf.debugging.check_numerics)', '(None)', 
'(tf.dtypes.cast)', '(None)', '(tf.dtypes.complex)', '(None)', 
'(tf.dtypes.saturate_cast)', '(None)', '(tf.dynamic_partition)', '(None)', 
'(tf.expand_dims)', '(None)', '(None)', '(None)', '(tf.gather_nd)', '(None)', 
'(0)', '(tf.gather)', '(None)', '(None)', '(None)', '(0)', '(tf.identity)', 
'(None)', '(tf.io.decode_base64)', '(None)', '(tf.io.decode_compressed)', 
"('')", '(None)', '(tf.io.encode_base64)', '(False)', '(None)', 
'(tf.math.abs)', '(None)', '(tf.math.acos)', '(None)', '(tf.math.acosh)', 
'(None)', '(tf.math.add_n)', '(None)', '(tf.math.add)', '(None)', 
'(tf.math.angle)', '(None)', '(tf.math.asin)', '(None)', '(tf.math.asinh)', 
'(None)', '(tf.math.atan2)', '(None)', '(tf.math.atan)', '(None)', 
'(tf.math.atanh)', '(None)', '(tf.math.ceil)', '(None)', '(tf.math.conj)', 
'(None)', '(tf.math.cos)', '(None)', '(tf.math.cosh)', '(None)', 
'(tf.math.digamma)', '(None)', '(tf.math.divide_no_nan)', '(None)', 
'(tf.math.divide)', '(None)', '(tf.math.equal)', '(None)', '(tf.math.erf)', 
'(None)', '(tf.math.erfc)', '(None)', '(tf.math.exp)', '(None)', 
'(tf.math.expm1)', '(None)', '(tf.math.floor)', '(None)', '(tf.math.floordiv)', 
'(None)', '(tf.math.floormod)', '(None)', '(tf.math.greater_equal)', '(None)', 
'(tf.math.greater)', '(None)', '(tf.math.imag)', '(None)', 
'(tf.math.is_finite)', '(None)', '(tf.math.is_inf)', '(None)', 
'(tf.math.is_nan)', '(None)', '(tf.math.less_equal)', '(None)', 
'(tf.math.less)', '(None)', '(tf.math.lgamma)', '(None)', '(tf.math.log1p)', 
'(None)', '(tf.math.log_sigmoid)', '(None)', '(tf.math.log)', '(None)', 
'(tf.math.logical_and)', '(None)', '(tf.math.logical_not)', '(None)', 
'(tf.math.logical_or)', '(None)', '(tf.math.logical_xor)', "('LogicalXor')", 
'(tf.math.maximum)', '(None)', '(tf.math.minimum)', '(None)', 
'(tf.math.multiply)', '(None)', '(tf.math.negative)', '(None)', 
'(tf.math.not_equal)', '(None)', '(tf.math.pow)', '(None)', '(tf.math.real)', 
'(None)', '(tf.math.reciprocal)', '(None)', '(tf.math.reduce_any)', '(None)', 
'(False)', '(None)', '(tf.math.reduce_max)', '(None)', '(False)', '(None)', 
'(tf.math.reduce_mean)', '(None)', '(False)', '(None)', '(tf.math.reduce_min)', 
'(None)', '(False)', '(None)', '(tf.math.reduce_prod)', '(None)', '(False)', 
'(None)', '(tf.math.reduce_sum)', '(None)', '(False)', '(None)', 
'(tf.math.rint)', '(None)', '(tf.math.round)', '(None)', '(tf.math.rsqrt)', 
'(None)', '(tf.math.sign)', '(None)', '(tf.math.sin)', '(None)', 
'(tf.math.sinh)', '(None)', '(tf.math.sqrt)', '(None)', '(tf.math.square)', 
'(None)', '(tf.math.squared_difference)', '(None)', '(tf.math.subtract)', 
'(None)', '(tf.math.tan)', '(None)', '(tf.math.truediv)', '(None)', 
'(tf.math.unsorted_segment_max)', '(None)', '(tf.math.unsorted_segment_mean)', 
'(None)', '(tf.math.unsorted_segment_min)', '(None)', 
'(tf.math.unsorted_segment_prod)', '(None)', 
'(tf.math.unsorted_segment_sqrt_n)', '(None)', 
'(tf.math.unsorted_segment_sum)', '(None)', '(tf.ones_like)', '(None)', 
'(None)', '(True)', '(tf.rank)', '(None)', '(tf.realdiv)', '(None)', 
'(tf.reduce_all)', '(None)', '(False)', '(None)', '(tf.size)', '(None)', 
'(tf.int32)', '(tf.squeeze)', '(None)', '(None)', '(None)', '(tf.stack)', 
'(0)', "('stack')", '(tf.strings.as_string)', '(-1)', '(False)', '(False)', 
'(-1)', "('')", '(None)', '(tf.strings.join)', "('')", '(None)', 
'(tf.strings.length)', '(None)', "('BYTE')", '(tf.strings.reduce_join)', 
'(None)', '(False)', "('')", '(None)', '(tf.strings.regex_full_match)', 
'(None)', '(tf.strings.regex_replace)', '(True)', '(None)', 
'(tf.strings.strip)', '(None)', '(tf.strings.substr)', '(None)', "('BYTE')", 
'(tf.strings.to_hash_bucket_fast)', 

[issue38581] Crash on distutils/util.py when header variable isn't a string

2019-10-24 Thread STINNER Victor


STINNER Victor  added the comment:

That sounds like a bug in bzr. You may try Breezy which supports Python 3.

https://launchpad.net/brz

--
nosy: +vstinner

___
Python tracker 

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



[issue38581] Crash on distutils/util.py when header variable isn't a string

2019-10-24 Thread Lealinux


New submission from Lealinux :

Hello,

With some pip3 package, distutils could crash if variable "header" isn't a real 
string variable :



$ pip3 install bzr
Collecting bzr
  Using cached 
https://files.pythonhosted.org/packages/62/3a/81325e34bcc78f67cc33dfac64f44e7c8329d4481dec1b789267b98644c3/bzr-2.7.0.tar.gz
ERROR: Complete output from command python setup.py egg_info:
ERROR: running egg_info
creating pip-egg-info/bzr.egg-info
writing pip-egg-info/bzr.egg-info/PKG-INFO
Traceback (most recent call last):
  File "", line 1, in 
  File "pip-install/bzr/setup.py", line 781, in 
setup(**ARGS)
  File "distutils/core.py", line 148, in setup
dist.run_commands()
  File "distutils/dist.py", line 966, in run_commands
self.run_command(cmd)
  File "distutils/dist.py", line 985, in run_command
cmd_obj.run()
  File "setuptools/command/egg_info.py", line 289, in run
writer(self, ep.name, os.path.join(self.egg_info, ep.name))
  File "setuptools/command/egg_info.py", line 621, in write_pkg_info
metadata.write_pkg_info(cmd.egg_info)
  File "distutils/dist.py", line 1117, in write_pkg_info
self.write_pkg_file(pkg_info)
  File "setuptools/dist.py", line 165, in write_pkg_file
long_desc = rfc822_escape(self.get_long_description())
  File "distutils/util.py", line 470, in rfc822_escape
lines = header.split('\n')
TypeError: a bytes-like object is required, not 'str'

-

On this case (bzr), "header" is a bytes-like object.

On attachment, a patch proposal to have a (possible) solution


PS: newbie on python-core-patching and python-bug-report, sorry if we have 
missed something

--
components: Library (Lib)
files: distutils_rfc822_escape.patch
keywords: patch
messages: 355326
nosy: Lealinux
priority: normal
severity: normal
status: open
title: Crash on distutils/util.py when header variable isn't a string
type: crash
versions: Python 3.8
Added file: https://bugs.python.org/file48676/distutils_rfc822_escape.patch

___
Python tracker 

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



[issue38580] select()'s documentation claims only sequences are accepted, but it allows all iterables

2019-10-24 Thread Dong-hee Na


Change by Dong-hee Na :


--
nosy: +serhiy.storchaka, vstinner

___
Python tracker 

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



[issue38580] select()'s documentation claims only sequences are accepted, but it allows all iterables

2019-10-24 Thread Jakub Stasiak

New submission from Jakub Stasiak :

Excerpt from the documentation:

"""This is a straightforward interface to the Unix select() system call. The 
first three arguments are sequences of ‘waitable objects’: either integers 
representing file descriptors or objects with a parameterless method named 
fileno() returning such an integer:"""

In reality it accepts for example dictionary key views (that's how I discovered 
it) due to its internal usage of PySequence_Fast, which (from 
https://docs.python.org/3/c-api/sequence.html#c.PySequence_Fast):

"""Return the sequence or iterable o as an object usable by the other 
PySequence_Fast* family of functions. If the object is not a sequence or 
iterable, raises TypeError with m as the message text. Returns NULL on 
failure."""

I made a pull request to document this behavior in select 
(https://github.com/python/cpython/pull/16832) but it was recommended that I 
create this issue because the solution may not be obvious here.

--
components: Library (Lib)
messages: 355325
nosy: corona10, jstasiak
priority: normal
pull_requests: 16447
severity: normal
status: open
title: select()'s documentation claims only sequences are accepted, but it 
allows all iterables
type: behavior
versions: 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



[issue38576] CVE-2019-18348: CRLF injection via the host part of the url passed to urlopen()

2019-10-24 Thread STINNER Victor


Change by STINNER Victor :


--
title: CVE-2019-18348 CRLF injection via the host part of the url passed to 
urlopen() -> CVE-2019-18348: CRLF injection via the host part of the url passed 
to urlopen()

___
Python tracker 

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



[issue32080] Re locale test fails after installing Python 3.6.3 on ubuntu 16.04

2019-10-24 Thread STINNER Victor


STINNER Victor  added the comment:

Yeah, that's a duplicate of bpo-29571 which has been fixed by:

New changeset 279657bac2856039ba422c18a3d7f227b455e9d6 by Victor Stinner in 
branch '3.7':
[3.7] bpo-29571: Fix test_re.test_locale_flag() (GH-12178)
https://github.com/python/cpython/commit/279657bac2856039ba422c18a3d7f227b455e9d6

Python 3.7.3 and newer include my fix.

--
resolution:  -> fixed
stage:  -> resolved
status: open -> closed
superseder:  -> test_re is failing when local is set for `en_IN`

___
Python tracker 

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



[issue33384] Build does not work with closed stdin on NetBSD

2019-10-24 Thread STINNER Victor


STINNER Victor  added the comment:

> I can confirm that I can no longer reproduce this problem with Python
3.7.5 on NetBSD

Great!

--

___
Python tracker 

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



[issue36338] urlparse of urllib returns wrong hostname

2019-10-24 Thread STINNER Victor


STINNER Victor  added the comment:

OMG parsing an URL is a can of worms... There are so many open issues related 
to URL parsing!

* bpo-18191: urllib.parse.splitport("::1")
* bpo-20271: urllib.parse.urlparse('http://[::1]spam:80')
* bpo-28841: urlparse.urlparse() parses invalid URI without generating an error 
(examples provided)
* bpo-33342: urlsplit("//user:[@host")
* bpo-34360: 'http://[::1]]'
* bpo-35377: urlparse doesn't validate the scheme
* bpo-35748: 'http://www.google.com\@xxx.com'
* bpo-36338 (this issue): urlparse('http://demo.com[attacker.com]')
* bpo-37678: urlparse('http://user:pass#?[w...@example.com:80/path')

Related:

* bpo-3647: urlparse - relative url parsing and joins to be RFC3986 compliance
* bpo-16909: urlparse: add userinfo attribute
* bpo-18140: issue with 'http://auser:secr#et@192.168.0.1:8080/a/b/c.html'
* bpo-22234: urllib.parse.urlparse accepts any falsy value as an url
* bpo-22852: "urllib.parse wrongly strips empty #fragment, ?query, //netloc"
* bpo-23328: issue with "http://someuser:a/b@10.11.12.13:1234;
* bpo-23448: "urllib2 needs to remove scope from IPv6 address when creating 
Host header"
* bpo-23505: [CVE-2015-2104] Urlparse insufficient validation leads to open 
redirect

There are 124 open issues with "urllib" in their title and 12 open issues with 
"urlparse" in their title.

--

___
Python tracker 

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



[issue33384] Build does not work with closed stdin on NetBSD

2019-10-24 Thread Leonardo Taccari


Leonardo Taccari  added the comment:

Hello Victor,
I can confirm that I can no longer reproduce this problem with Python
3.7.5 on NetBSD and according a double-check to
Python/pylifecycle.c:is_valid_fd() now fstat() is always used on
NetBSD.

Thanks for the update and for looking at it!

--

___
Python tracker 

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



[issue23505] [CVE-2015-2104] Urlparse insufficient validation leads to open redirect

2019-10-24 Thread STINNER Victor


Change by STINNER Victor :


--
title: Urlparse insufficient validation leads to open redirect -> 
[CVE-2015-2104] Urlparse insufficient validation leads to open redirect

___
Python tracker 

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



[issue27657] urlparse fails if the path is numeric

2019-10-24 Thread STINNER Victor


STINNER Victor  added the comment:

This issue got fixes, so I close it.

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



[issue38579] 'u' formatted arrays mostly prevent appends of 4 byte characters

2019-10-24 Thread Dan Snider


New submission from Dan Snider :

Unicode characters with code points above u+ can only be added to the end 
of an array, and only from a call to the "fromunicode" method. This is because 
"fromunicode" uses a different procedure to modify the array compared to 
__new__, __setitem__, append, and extend array methods, all of which eventually 
call u_setitem routine, which calls PyArg_Parse with a format spec of "u#". The 
error occurs in that call, from what at first glance appears to be an incorrect 
length determination for unicode objects of the 4 byte kind.

--
components: Library (Lib)
messages: 355319
nosy: bup
priority: normal
severity: normal
status: open
title: 'u' formatted arrays mostly prevent appends of 4 byte characters
type: behavior
versions: Python 3.5, Python 3.6, Python 3.7, Python 3.8

___
Python tracker 

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



[issue13131] FD leak in urllib2

2019-10-24 Thread STINNER Victor


STINNER Victor  added the comment:

This issue is a duplicate of bpo-12133 which has been fixed in Python 2.7 by:

commit c74a6ba2d6c1f331896cf8dacc698b0b88c7e670
Author: Victor Stinner 
Date:   Fri Jun 17 14:06:27 2011 +0200

Issue #12133: AbstractHTTPHandler.do_open() of urllib.request closes the 
HTTP
connection if its getresponse() method fails with a socket error. Patch 
written
by Ezio Melotti.

--
nosy: +vstinner
resolution:  -> duplicate
stage: patch review -> resolved
status: open -> closed
superseder:  -> ResourceWarning in urllib.request

___
Python tracker 

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



[issue34028] Python 3.7.0 wont compile with SSL Support 1.1.0 > alledged missing X509_VERIFY_PARAM_set1_host() support

2019-10-24 Thread Christian Heimes


Christian Heimes  added the comment:

--with-openssl only sets the header location for the pre-processor and library 
path for the dynamic linker. It does *not* affect the search and lookup paths 
of the dynamic loader! If you have installed OpenSSL in a non-standard location 
then you need to tell the dynamic loader how to load the shared libraries. This 
can be done in three ways:

* configure the dynamic loader globally in /etc/ld.so.conf (not advised for 
custom OpenSSL)
* Add a rpath to the ELF header of _ssl and _hashlib extensions at link time. 
This can be accomplished by setting LD_RUN_PATH=/path/to/lib or 
LDFLAGS=-Wl,-rpath,/path/to/lib
* Add the shared library directory to the runtime lookup path of ld.so by 
setting LD_LIBRARY_PATH env var.

--

___
Python tracker 

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



[issue34028] Python 3.7.0 wont compile with SSL Support 1.1.0 > alledged missing X509_VERIFY_PARAM_set1_host() support

2019-10-24 Thread Malek Ghantous


Malek Ghantous  added the comment:

Thanks for your responses. Yum is not an option as I'm on a machine without 
root privileges.  

OK, so I have to be a bit contrite here, I tried everything you suggested, but 
in the end the solution goes back to this comment, and the LDFLAGS environment 
variable:

https://bugs.python.org/issue34028?@ok_message=msg%20355232%20cr%C3%A9%C3%A9%0Aissue%2034028%20message_count%2C%20type%2C%20versions%2C%20curieux%2C%20nosy_count%2C%20messages%20modifi%C3%A9%28s%29%20avec%20succ%C3%A8s&@template=item#msg339455

I think I was using the wrong compiler when I tried that solution the first 
time.  So I'm sorry about that.  

But while we're here, I may as well ask if there isn't another way to do this, 
without having recourse to the environment variable.  Is there a way to specify 
these flags using just the configure script?  Based on something I read 
somewhere on the web, I generally prefer to steer clear of setting environment 
variables, though perhaps I needn't be so reluctant.  Incidentally, the 
environment variables OPENSSL_LDFLAGS etc as suggested in config.log (thanks 
for that, I wouldn't have thought to look there) do not appear to work.

--

___
Python tracker 

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



[issue20271] urllib.parse.urlparse() accepts wrong URLs

2019-10-24 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

With Victor's PR 16780, "http://[::1]spam:80; would raise a ValueError.

ValueError: Invalid network location: '[::1]spam:80'

--

___
Python tracker 

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



[issue38577] OPENSSL_* flags not propagated to extensions during build

2019-10-24 Thread Björn Pollex

Björn Pollex  added the comment:

Thanks for the response, that clarifies it! In that case this issue is invalid.

--
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue38577] OPENSSL_* flags not propagated to extensions during build

2019-10-24 Thread Christian Heimes


Christian Heimes  added the comment:

'--with-openssl' purpose is to override the OpenSSL location for Python's 
internal _ssl and _hashlib module. It is not designed to interfere with 3rd 
party extensions that are built with distutils or setuptools.

It is the decision of a 3rd party package how it wants to handle these extra 
flags -- or if it is able to use them at all. In case of PyMySQL you must use 
the same shared libraries as libmysqlclient. You cannot use a  different 
OpenSSL ABIs, APIs, or shared libraries for PyMySQL and libmysqlclient.

--

___
Python tracker 

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



[issue37911] Minor error in PEP567 code example

2019-10-24 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


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



[issue38323] asyncio: MultiLoopWatcher has a race condition (test_asyncio: test_close_kill_running() hangs on AMD64 RHEL7 Refleaks 3.x)

2019-10-24 Thread Kyle Stanley


Change by Kyle Stanley :


--
nosy: +aeros

___
Python tracker 

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



[issue38546] test_concurrent_futures: reap_children() warnings on RHEL7 and RHEL8 buildbots

2019-10-24 Thread STINNER Victor


STINNER Victor  added the comment:

I closed bpo-38448 as duplicate of this issue. Copy of its only message:

AMD64 RHEL8 Refleaks 3.x:
https://buildbot.python.org/all/#/builders/272/builds/23

0:27:13 load avg: 4.88 [416/419/1] test_concurrent_futures failed (env changed) 
(17 min 11 sec) -- running: test_capi (7 min 28 sec), test_gdb (8 min 49 sec), 
test_asyncio (23 min 23 sec)
beginning 6 repetitions
123456
.Warning -- reap_children() reaped child process 26487
.
Warning -- multiprocessing.process._dangling was modified by 
test_concurrent_futures
  Before: set()
  After:  {}

--
title: test_concurrent_futures: test_interpreter_shutdown() warning 
"reap_children() reaped child process" on AMD64 RHEL7 3.x -> 
test_concurrent_futures: reap_children() warnings on RHEL7 and RHEL8 buildbots

___
Python tracker 

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



[issue38448] test_concurrent_futures: reap_children() reaped child process 26487 on AMD64 RHEL8 Refleaks 3.x

2019-10-24 Thread STINNER Victor


STINNER Victor  added the comment:

I close this issue as a duplicate of bpo-38546.

--
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> test_concurrent_futures: test_interpreter_shutdown() warning 
"reap_children() reaped child process" on AMD64 RHEL7 3.x

___
Python tracker 

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



[issue38546] test_concurrent_futures: test_interpreter_shutdown() warning "reap_children() reaped child process" on AMD64 RHEL7 3.x

2019-10-24 Thread STINNER Victor


STINNER Victor  added the comment:

New warning on AMD64 RHEL8 LTO + PGO 3.x:
https://buildbot.python.org/all/#/builders/284/builds/171

...
test_killed_child 
(test.test_concurrent_futures.ProcessPoolSpawnProcessPoolExecutorTest) ... 
0.26s ok
test_map (test.test_concurrent_futures.ProcessPoolSpawnProcessPoolExecutorTest) 
... 0.29s ok
test_map_chunksize 
(test.test_concurrent_futures.ProcessPoolSpawnProcessPoolExecutorTest) ... 
0.31s ok
test_map_exception 
(test.test_concurrent_futures.ProcessPoolSpawnProcessPoolExecutorTest) ... 
0.30s ok
test_map_timeout 
(test.test_concurrent_futures.ProcessPoolSpawnProcessPoolExecutorTest) ... 
6.29s ok
test_max_workers_negative 
(test.test_concurrent_futures.ProcessPoolSpawnProcessPoolExecutorTest) ... 
0.32s ok
test_max_workers_too_large 
(test.test_concurrent_futures.ProcessPoolSpawnProcessPoolExecutorTest) ... 
skipped 'Windows-only process limit'
test_no_stale_references 
(test.test_concurrent_futures.ProcessPoolSpawnProcessPoolExecutorTest) ... 
0.29s ok
test_ressources_gced_in_workers 
(test.test_concurrent_futures.ProcessPoolSpawnProcessPoolExecutorTest) ... 
1.58s ok
test_shutdown_race_issue12456 
(test.test_concurrent_futures.ProcessPoolSpawnProcessPoolExecutorTest) ... 
0.30s Warning -- reap_children() reaped child process 10340
ok
test_submit 
(test.test_concurrent_futures.ProcessPoolSpawnProcessPoolExecutorTest) ... 
0.29s ok
test_submit_keyword 
(test.test_concurrent_futures.ProcessPoolSpawnProcessPoolExecutorTest) ... 
0.31s ok
...

--

___
Python tracker 

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



[issue38578] test_concurrent_futures failed on AMD64 FreeBSD Shared 3.8

2019-10-24 Thread STINNER Victor


STINNER Victor  added the comment:

Logs around the first failure:

...
test_zero_timeout (test.test_concurrent_futures.ThreadPoolAsCompletedTest) ... 
2.24s ok
test_default_workers (test.test_concurrent_futures.ThreadPoolExecutorTest) ... 
0.96s ok
test_free_reference (test.test_concurrent_futures.ThreadPoolExecutorTest) ... 
0.56s ok
test_idle_thread_reuse (test.test_concurrent_futures.ThreadPoolExecutorTest) 
... 1.05s Warning -- threading_cleanup() failed to cleanup 2 threads (count: 2, 
dangling: 3)
Dangling thread: 
Dangling thread: <_MainThread(MainThread, started 34371022848)>
Dangling thread: 
FAIL
test_map (test.test_concurrent_futures.ThreadPoolExecutorTest) ... 3.80s 
Warning -- threading_cleanup() failed to cleanup -2 threads (count: 0, 
dangling: 1)
Dangling thread: <_MainThread(MainThread, started 34371022848)>
ok
test_map_exception (test.test_concurrent_futures.ThreadPoolExecutorTest) ... 
1.67s ok
test_map_submits_without_iteration 
(test.test_concurrent_futures.ThreadPoolExecutorTest)
Tests verifying issue 11777. ... 2.64s ok
...

--

___
Python tracker 

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



[issue38578] test_concurrent_futures failed on AMD64 FreeBSD Shared 3.8

2019-10-24 Thread STINNER Victor

New submission from STINNER Victor :

On AMD64 FreeBSD Shared 3.8 which is know to be very slow, different 
test_concurrent_futures tests failed.

https://buildbot.python.org/all/#builders/374/builds/3

test_concurrent_futures was run twice. Once in parallel of other tests, then 
alone in sequence.


The first run emitted two "threading_cleanup() failed" warnings and 
test_idle_thread_reuse() failed:

test_idle_thread_reuse (test.test_concurrent_futures.ThreadPoolExecutorTest) 
... 1.05s Warning -- threading_cleanup() failed to cleanup 2 threads (count: 2, 
dangling: 3)
test_map (test.test_concurrent_futures.ThreadPoolExecutorTest) ... 3.80s 
Warning -- threading_cleanup() failed to cleanup -2 threads (count: 0, 
dangling: 1)

FAIL: test_idle_thread_reuse 
(test.test_concurrent_futures.ThreadPoolExecutorTest)
--
Traceback (most recent call last):
  File 
"/usr/home/buildbot/python/3.8.koobs-freebsd-564d/build/Lib/test/test_concurrent_futures.py",
 line 782, in test_idle_thread_reuse
    self.assertEqual(len(executor._threads), 1)
AssertionError: 2 != 1

At the second run, test_free_reference() failed:

1:15:08 load avg: 9.24 Re-running test_concurrent_futures in verbose mode

FAIL: test_free_reference (test.test_concurrent_futures.ThreadPoolExecutorTest)
--
Traceback (most recent call last):
  File 
"/usr/home/buildbot/python/3.8.koobs-freebsd-564d/build/Lib/test/test_concurrent_futures.py",
 line 745, in test_free_reference
    self.assertIsNone(wr())
AssertionError:  
is not None

--
components: Tests
messages: 355308
nosy: vstinner
priority: normal
severity: normal
status: open
title: test_concurrent_futures failed on AMD64 FreeBSD Shared 3.8
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



[issue37922] inspect.getsource returns wrong class definition when multiple class definitions share the same name (but are defined in different scopes)

2019-10-24 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

Closing it as duplicate of issue35113.

--
nosy: +serhiy.storchaka
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> inspect.getsource returns incorrect source for classes when 
class definition is part of multiline strings
type:  -> behavior

___
Python tracker 

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



[issue32080] Re locale test fails after installing Python 3.6.3 on ubuntu 16.04

2019-10-24 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

Looking at the traceback in the screenshot this seems to be same as issue29571 
happening on en_IN locale.

--
nosy: +vstinner

___
Python tracker 

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



[issue34792] Tutorial doesn''t discuss / and * function arguments

2019-10-24 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

With PEP 570 implementation docs were expanded : 
https://github.com/python/cpython/commit/b76302ddd0896cb39ce69909349b53db6e7776e2#diff-d764089fca21fdc70d55804714b1cba5

--
nosy: +pablogsal

___
Python tracker 

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



[issue31670] Associate .wasm with application/wasm

2019-10-24 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
superseder:  -> http.server module sets incorrect mimetype for WebAssembly files
versions:  -Python 2.7, Python 3.7

___
Python tracker 

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



[issue27992] Clarify %(prog)s in argparse help formatter returns basename of sys.argv[0] by default

2019-10-24 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +rhettinger

___
Python tracker 

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



[issue38565] Expose the value passed of typed passed to functools.lru_cache

2019-10-24 Thread Manjusaka


Manjusaka  added the comment:

Yes, you are right, we shouldn't consider about the unstandard using way. I 
will update my PR

BTW, what're means for the "make_key" parameter?

--

___
Python tracker 

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



[issue25430] speed up ipaddress __contain__ method

2019-10-24 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

Closing it as resolved since the optimization was merged in 3.8.0 . Thanks 
@gescheit for the report and patch.

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



[issue38172] Python 3.8 Segfult with Bandersnatch pytest Suite

2019-10-24 Thread STINNER Victor


STINNER Victor  added the comment:

I will do it differently. Nobody managed to reproduce the bug. The upstream CI 
looks to be fine. So I close the issue.

If someone sees a crash, please open a new issue with more context, like 
explain how to reproduce it ;-)

--
resolution:  -> fixed
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



[issue35293] make doctest (Sphinx) emits a lot of warnings

2019-10-24 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

Relevant docutils upstream issue : https://sourceforge.net/p/docutils/bugs/373/ 
. Also the SyntaxWarning was changed to DeprecationWarning with msg349335.

--

___
Python tracker 

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



[issue38577] OPENSSL_* flags not propagated to extensions during build

2019-10-24 Thread Björn Pollex

Change by Björn Pollex :


--
assignee:  -> christian.heimes
components: +Extension Modules, SSL, macOS
nosy: +christian.heimes, ned.deily, ronaldoussoren

___
Python tracker 

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



[issue38172] Python 3.8 Segfult with Bandersnatch pytest Suite

2019-10-24 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

It seems now bandersnatch is tested with python 3.8.0 stable release and passes 
: https://travis-ci.org/pypa/bandersnatch/builds/599806554 . @cooperlees, can 
you please confirm and close the issue?

--

___
Python tracker 

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



[issue38577] OPENSSL_* flags not propagated to extensions during build

2019-10-24 Thread Björn Pollex

New submission from Björn Pollex :

When building Python 3.7.2 using pyenv on MacOS, it will use `--with-openssl` 
to configure OpenSSL. With that option, the compiler options for OpenSSL will 
be passed via `OPENSSL_*` variables, rather than normal compiler flags (e.g. 
`OPENSSL_LDFLAGS` vs. `LDFLAGS`). When compiling an extension, these flags will 
not be propagated by `distutils`, and so an extension that depends on OpenSSL 
fails to compile.

I'm not sure what the expected behavior here is. Should the package handle this 
by querying `sysconfig` directly in `setup.py`? Or should this be handled 
automatically by `distutils`?

Specifically, I ran into this issue when trying to install `mysqlclient-python` 
(https://github.com/PyMySQL/mysqlclient-python).

--
messages: 355299
nosy: Björn Pollex
priority: normal
severity: normal
status: open
title: OPENSSL_* flags not propagated to extensions during build
versions: Python 3.7

___
Python tracker 

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



[issue30458] [security][CVE-2019-9740][CVE-2019-9947] HTTP Header Injection (follow-up of CVE-2016-5699)

2019-10-24 Thread Riccardo Schirone


Riccardo Schirone  added the comment:

I have created https://bugs.python.org/issue38576 to address CVE-2019-18348.

@gregory.p.smith if you have particular complains about these CVEs feel free to 
let me know (even privately). I think the security impact of these flaws is: an 
application that relies on urlopen/HTTPConnection/etc. where either the query 
part, the path part or the host part are user-controlled, could be exploited to 
send unintended HTTP headers to other hosts (maybe services that would not be 
directly reachable by the user).

FYI, there were some good replies to that CVE talk, one of which is 
https://grsecurity.net/reports_of_cves_death_greatly_exaggerated .

--

___
Python tracker 

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



[issue38565] Expose the value passed of typed passed to functools.lru_cache

2019-10-24 Thread Manjusaka


Change by Manjusaka :


--
pull_requests: +16446
pull_request: https://github.com/python/cpython/pull/16916

___
Python tracker 

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



[issue38565] Expose the value passed of typed passed to functools.lru_cache

2019-10-24 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

The rule used in the lru_cache implementation is: do not write in C that can be 
written in Python.

--

___
Python tracker 

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



[issue38565] Expose the value passed of typed passed to functools.lru_cache

2019-10-24 Thread Manjusaka


Manjusaka  added the comment:

I have already make a new function like this

static PyObject *
lru_cache_cache_parameters(lru_cache_object *self)
{
PyObject *cache_parameters =  PyDict_New();
PyDict_SetItemString(cache_parameters, "maxsize", 
PyLong_FromSsize_t(self->maxsize));
PyDict_SetItemString(cache_parameters, "typed", self->typed == 0 ? Py_False 
: Py_True);
return cache_parameters;
}

--

___
Python tracker 

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



[issue38566] Description of '\w' behavior is vague in `re` documentation

2019-10-24 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +serhiy.storchaka
type:  -> behavior

___
Python tracker 

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



[issue38576] CVE-2019-18348 CRLF injection via the host part of the url passed to urlopen()

2019-10-24 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +vstinner, xtreak

___
Python tracker 

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



[issue38573] Not Implemented Error in stdLib HTMLParser

2019-10-24 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

See also https://bugs.python.org/issue32876 and 
https://bugs.python.org/issue31844

--
nosy: +berker.peksag, ezio.melotti, xtreak

___
Python tracker 

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



[issue38576] CVE-2019-18348 CRLF injection via the host part of the url passed to urlopen()

2019-10-24 Thread Riccardo Schirone


New submission from Riccardo Schirone :

Copy-pasted from https://bugs.python.org/issue30458#msg347282


The commit b7378d77289c911ca6a0c0afaf513879002df7d5 is incomplete: it doesn't 
seem to check for control characters in the "host" part of the URL, only in the 
"path" part of the URL. Example:
---
try:
from urllib import request as urllib_request
except ImportError:
import urllib2 as urllib_request
import socket
def bug(*args):
raise Exception(args)
# urlopen() must not call create_connection()
socket.create_connection = bug
urllib_request.urlopen('http://127.0.0.1\r\n\x20hihi\r\n :11211')
---

The URL comes from the first message of this issue:
https://bugs.python.org/issue30458#msg294360

Development branches 2.7 and master produce a similar output:
---
Traceback (most recent call last):
 ...
Exception: (('127.0.0.1\r\n hihi\r\n ', 11211), ..., None)
---

So urllib2/urllib.request actually does a real network connection (DNS query), 
whereas it should reject control characters in the "host" part of the URL.

***

A second problem comes into the game. Some C libraries like glibc strip the end 
of the hostname (strip at the first newline character) and so HTTP Header 
injection is still possible is this case:
https://bugzilla.redhat.com/show_bug.cgi?id=1673465

***

According to the RFC 3986, the "host" grammar doesn't allow any control 
character, it looks like:

   host  = IP-literal / IPv4address / reg-name

   ALPHA (letters)
   DIGIT (decimal digits)
   unreserved= ALPHA / DIGIT / "-" / "." / "_" / "~"
  pct-encoded = "%" HEXDIG HEXDIG
  sub-delims  = "!" / "$" / "&" / "'" / "(" / ")"
  / "*" / "+" / "," / ";" / "="
   reg-name  = *( unreserved / pct-encoded / sub-delims )

   IP-literal= "[" ( IPv6address / IPvFuture  ) "]"
   IPvFuture = "v" 1*HEXDIG "." 1*( unreserved / sub-delims / ":" )
   IPv6address   =6( h16 ":" ) ls32
 /   "::" 5( h16 ":" ) ls32
 / [   h16 ] "::" 4( h16 ":" ) ls32
 / [ *1( h16 ":" ) h16 ] "::" 3( h16 ":" ) ls32
 / [ *2( h16 ":" ) h16 ] "::" 2( h16 ":" ) ls32
 / [ *3( h16 ":" ) h16 ] "::"h16 ":"   ls32
 / [ *4( h16 ":" ) h16 ] "::"  ls32
 / [ *5( h16 ":" ) h16 ] "::"  h16
 / [ *6( h16 ":" ) h16 ] "::"
   h16   = 1*4HEXDIG
   ls32  = ( h16 ":" h16 ) / IPv4address
   IPv4address   = dec-octet "." dec-octet "." dec-octet "." dec-octet



CVE-2019-18348 was assigned to this flaw, which is similar to CVE-2019-9947 and 
CVE-2019-9740 but it is about the *host* part of a url.

--
messages: 355294
nosy: rschiron
priority: normal
severity: normal
status: open
title: CVE-2019-18348 CRLF injection via the host part of the url passed to 
urlopen()
type: security

___
Python tracker 

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



[issue35745] Add import statement in dataclass code snippet

2019-10-24 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

See also https://bugs.python.org/issue36661

--
nosy: +eric.smith, xtreak

___
Python tracker 

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



[issue38574] Dataclasses documentation should show the necessary imports

2019-10-24 Thread Eric V. Smith


Eric V. Smith  added the comment:

This is a duplicate of issue 36661.

--
nosy: +eric.smith
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> Missing dataclass decorator import in dataclasses module docs

___
Python tracker 

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



[issue38565] Expose the value passed of typed passed to functools.lru_cache

2019-10-24 Thread Manjusaka


Manjusaka  added the comment:

I think to modify in lru_cache should be good in normal circumstance

But here's maybe some people modify the wrapped object that underlying in  
lru_cache

So I prefer to add a new function in _functools.c?

--

___
Python tracker 

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



[issue38575] Child process deadlock in subprocess.Popen

2019-10-24 Thread Zhipeng Xie


New submission from Zhipeng Xie <775350...@qq.com>:

Hi, we had a child process deadlock on _disabling_gc_lock in subprocess.Popen. 
It seems that after 
https://github.com/python/cpython/commit/5e8e371364ee58dadb9a4e4e51c7e9cf6bedbfae,
 subprocess.Popen no longer support to be called in preexec_fn.

Steps to reproduce:
[root@localhost ~]# python2 --version
Python 2.7.15
[root@localhost ~]# python2 mtfork.py 

wait for a while and the child process deadlock

Here is the gdb stack:

(gdb) py-bt
Traceback (most recent call first):
  Waiting for the GIL
  File "/usr/local/lib/python2.7/subprocess.py", line 931, in _execute_child
with self._disabling_gc_lock:
  File "/usr/local/lib/python2.7/subprocess.py", line 394, in __init__
errread, errwrite)
  File "mtfork.py", line 36, in run_cmd
stderr=subprocess.PIPE)
  File "/usr/local/lib/python2.7/subprocess.py", line 989, in _execute_child
preexec_fn()
  File "/usr/local/lib/python2.7/subprocess.py", line 394, in __init__
errread, errwrite)
  File "mtfork.py", line 15, in run_command
stdout=arg_stdout, stderr=arg_stderr, shell=True)
  File "mtfork.py", line 51, in _readerthread3
status = run_command("/root/exe",preexec_fn=preexec_fn_no_args)
  File "/usr/local/lib/python2.7/threading.py", line 754, in run
self.__target(*self.__args, **self.__kwargs)
  File "/usr/local/lib/python2.7/threading.py", line 801, in __bootstrap_inner
self.run()
  File "/usr/local/lib/python2.7/threading.py", line 774, in __bootstrap
self.__bootstrap_inner()
(gdb) py-list
 926# The first char specifies the exception type: 0 means
 927# OSError, 1 means some other error.
 928errpipe_read, errpipe_write = self.pipe_cloexec()
 929try:
 930try:
>931with self._disabling_gc_lock:
 932gc_was_enabled = gc.isenabled()
 933# Disable gc to avoid bug where gc -> 
file_dealloc ->
 934# write to stderr -> hang.
 935# https://bugs.python.org/issue1336
 936gc.disable()

--
components: Library (Lib)
files: mtfork.py
messages: 355290
nosy: Zhipeng Xie
priority: normal
severity: normal
status: open
title: Child process deadlock in subprocess.Popen
type: behavior
versions: Python 2.7
Added file: https://bugs.python.org/file48675/mtfork.py

___
Python tracker 

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



[issue38574] Dataclasses documentation should show the necessary imports

2019-10-24 Thread Leon Matthews


New submission from Leon Matthews :

In the code sample documentation for other modules we show the necessary 
imports, we should do the same for dataclasses.

For example, the very first example uses the `dataclass` decorator without 
importing it first. It should read::

from dataclasses import dataclass

@dataclass
class InventoryItem:
...

--
assignee: docs@python
components: Documentation
messages: 355289
nosy: Leon Matthews, docs@python
priority: normal
severity: normal
status: open
title: Dataclasses documentation should show the necessary imports
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



[issue38565] Expose the value passed of typed passed to functools.lru_cache

2019-10-24 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

It is easy:

diff --git a/Lib/functools.py b/Lib/functools.py
index 3192bd02d9..52c07db749 100644
--- a/Lib/functools.py
+++ b/Lib/functools.py
@@ -499,7 +499,9 @@ def lru_cache(maxsize=128, typed=False):
 # The user_function was passed in directly via the maxsize argument
 user_function, maxsize = maxsize, 128
 wrapper = _lru_cache_wrapper(user_function, maxsize, typed, _CacheInfo)
-return update_wrapper(wrapper, user_function)
+func = update_wrapper(wrapper, user_function)
+func.cache_parameters = lambda: {'maxsize': maxsize, 'typed': typed}
+return func
 elif maxsize is not None:
 raise TypeError(
 'Expected first argument to be an integer, a callable, or None')

But there are many design questions. Why method instead of just attribute?

func.cache_parameters = {'maxsize': maxsize, 'typed': typed}

Or maybe just add the "typed" attribute?

func.typed = typed


Also I consider adding the more general "make_key" parameter to lru_cache(). 
The "typed" parameter would just specify the default value for "make_key".

--

___
Python tracker 

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



[issue38573] Not Implemented Error in stdLib HTMLParser

2019-10-24 Thread Yevgeny Pats


New submission from Yevgeny Pats :

Not implemented error in built-in HTMLParser

from html.parser import HTMLParser
parser = HTMLParser()
parser.feed(bytearray.fromhex('3c215b63612121').decode('ascii'))

# This will throw (found by https://github.com/fuzzitdev/pythonfuzz):
Traceback (most recent call last):
  File "/Users/yevgenyp/fuzzitdev/pythonfuzz/pythonfuzz/fuzzer.py", line 21, in 
worker
target(buf)
  File "examples/htmlparser/fuzz.py", line 12, in fuzz
pass
  File 
"/usr/local/Cellar/python/3.7.4/Frameworks/Python.framework/Versions/3.7/lib/python3.7/html/parser.py",
 line 111, in feed
self.goahead(0)
  File 
"/usr/local/Cellar/python/3.7.4/Frameworks/Python.framework/Versions/3.7/lib/python3.7/html/parser.py",
 line 179, in goahead
k = self.parse_html_declaration(i)
  File 
"/usr/local/Cellar/python/3.7.4/Frameworks/Python.framework/Versions/3.7/lib/python3.7/html/parser.py",
 line 264, in parse_html_declaration
return self.parse_marked_section(i)
  File 
"/usr/local/Cellar/python/3.7.4/Frameworks/Python.framework/Versions/3.7/lib/python3.7/_markupbase.py",
 line 159, in parse_marked_section
self.error('unknown status keyword %r in marked section' % rawdata[i+3:j])
  File 
"/usr/local/Cellar/python/3.7.4/Frameworks/Python.framework/Versions/3.7/lib/python3.7/_markupbase.py",
 line 34, in error
"subclasses of ParserBase must override error()")
NotImplementedError: subclasses of ParserBase must override error()

--
components: Library (Lib)
messages: 355287
nosy: yevgenyp
priority: normal
severity: normal
status: open
title: Not Implemented Error in stdLib HTMLParser
type: crash
versions: Python 3.7

___
Python tracker 

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



[issue38565] Expose the value passed of typed passed to functools.lru_cache

2019-10-24 Thread Manjusaka


Manjusaka  added the comment:

I think add new function would be a better way 

I will make a new PR

--

___
Python tracker 

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



[issue38565] Expose the value passed of typed passed to functools.lru_cache

2019-10-24 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue38565] Expose the value passed of typed passed to functools.lru_cache

2019-10-24 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

I'm fine with adding a new function:

   >>> f.cache_parameters()
   {'maxsize': 200, 'typed'=False}

--
assignee:  -> rhettinger

___
Python tracker 

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



[issue38565] Expose the value passed of typed passed to functools.lru_cache

2019-10-24 Thread Manjusaka


Manjusaka  added the comment:

I have already make a PR for this issue

but here's a problem. add a new field to cache_info maybe cause some special 
problem for the third-party libs what're dependent the cache_info

--

___
Python tracker 

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



  1   2   >