[issue35868] Support ALL_PROXY environment variable in urllib

2019-01-31 Thread SilentGhost


SilentGhost  added the comment:

This sounds like an extension of existing functionality and fairly minor at 
that, that's why we have "enhancement" type of issue, not everything needs to 
be a bug.

--
nosy: +SilentGhost

___
Python tracker 

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



[issue35866] concurrent.futures deadlock

2019-01-31 Thread Jakub Wilk


Jakub Wilk  added the comment:

You're right that sys.stdout.flush() is missing in my code; but on Linux it 
doesn't make a big difference, because multiprocessing flushes stdout before 
fork()ing.

And yes, it really hangs.

--

___
Python tracker 

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



[issue12822] NewGIL should use CLOCK_MONOTONIC if possible.

2019-01-31 Thread Matt Joiner


Change by Matt Joiner :


--
nosy:  -anacrolix

___
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-31 Thread Tobias Däullary

Tobias Däullary  added the comment:

Because sometimes when a process is implicitly started by some 3rd party 
library (i.e. COM via pythonwin here) the "old", unchanged environment is 
retained as the process itself doesn't care if os.environ was changed or not, 
the original environment cannot be modified.

This solution would give a lot of flexibility in that regard.

I think pythonwin is actually a special case as the problem here lies somewhere 
in the dispatch(.) call. The process creation should be handled somewhere 
within the COM interface, pywin does nothing there. 

But this solution effectively circumvents that issue.

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

___
Python tracker 

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



[issue35862] Change the environment for a new process

2019-01-31 Thread Josh Rosenberg


Change by Josh Rosenberg :


Removed 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-31 Thread Josh Rosenberg


Josh Rosenberg  added the comment:

Why is not having the target assign to the relevant os.environ keys before 
doing whatever depends on the environment not an option?

--
nosy: +josh.r

___
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-31 Thread Josh Rosenberg


Change by Josh Rosenberg :


Removed 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-31 Thread Josh Rosenberg


Change by Josh Rosenberg :


Removed 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-31 Thread Josh Rosenberg


Change by Josh Rosenberg :


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

___
Python tracker 

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



[issue35871] Pdb NameError in generator param and list comprehension

2019-01-31 Thread Jayanth Raman


Jayanth Raman  added the comment:

Thanks for the "interact" tip.

FWIW, I see this issue in 2.7.10 as well.  Although the list comprehension 
works.

$ python
Python 2.7.10 (default, Oct  6 2017, 22:29:07)
[GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.31)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> ^D

$ python /tmp/test2.py
> /tmp/test2.py(5)main()
-> for ii in range(nn):
(Pdb) n
> /tmp/test2.py(6)main()
-> num = sum(xx[jj] for jj in range(nn))
(Pdb) sum(xx[jj] for jj in range(nn))
*** NameError: global name 'xx' is not defined
(Pdb) [xx[jj] for jj in range(nn)]
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
(Pdb) c
('xx', [0, 1, 2, 3, 4, 5, 6, 7, 8, 9])

# test2.py

def main(nn=10):
xx = list(range(nn))
import pdb; pdb.set_trace()
for ii in range(nn):
num = sum(xx[jj] for jj in range(nn))
print('xx', xx)

if __name__ == '__main__':
main()

--

___
Python tracker 

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



[issue35866] concurrent.futures deadlock

2019-01-31 Thread Josh Rosenberg


Josh Rosenberg  added the comment:

I've only got 3.7.1 Ubuntu bash on Windows (also amd64) immediately available, 
but I'm not seeing a hang, nor is there any obvious memory leak that might 
eventually lead to problems (memory regularly drops back to under 10 MB shared, 
24 KB private working set). I modified your code to add a sys.stdout.flush() 
after the write so it would actually echo the dots as they were written instead 
of waiting for a few thousand of them to build up in the buffer, but otherwise 
it's the same code.

Are you sure you're actually hanging, and it's not just the output getting 
buffered?

--
nosy: +josh.r

___
Python tracker 

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



[issue35871] Pdb NameError in generator param and list comprehension

2019-01-31 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

Thanks for the report. This seems related to issue21161 and issue26072 that 
contain explanation about scope where exec is called with the code and patches 
that fix this issue. As a possible workaround in the issues you can use 
"interact" command to get to a REPL where you can evaluate and exit back to pdb.

--
nosy: +xdegaye, xtreak

___
Python tracker 

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



[issue34003] csv.DictReader can return basic dict instead of OrderedDict

2019-01-31 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
resolution:  -> not a bug
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



[issue34003] csv.DictReader can return basic dict instead of OrderedDict

2019-01-31 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
resolution: not a bug -> fixed

___
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-31 Thread R. David Murray


R. David Murray  added the comment:

The rules are: lines should be less than 78 characters; and that lines may be 
broken only at FWS (folding whitespace), not in the middle of words.  Putting 
these rules together, you get the result that the email library produces.  
"Conservative in what you send" means *following the RFC rules*, which is what 
the code does.  The failure here is on the Outlook side, which is supposed to 
be being "liberal in what you accept".  Which it is clearly not doing.

In case you want to read the RFCs, which I just reviewed, Content-ID is defined 
to have the same syntax as Message-ID, and Message-Id is defined as 
"Message-ID:" msg-id CRLF, while 'msg-id' is defined as:

msg-id  =   [CFWS] "<" id-left "@" id-right ">" [CFWS]

Which means that a fold is permitted before the id itself.

We could consider an "enhancement" request to cater to Outlook's deficiency, 
since email clients that are actually limited to 78 character lines are 
vanishingly rare these days.  The change would only be made in the new API 
folder, and I myself wouldn't have the time (or desire :) to work on it, but if 
you want to submit an issue as see what the other email team members think and 
produce a PR if the vote is positive, that's fine by me.

Do you know if it is all headers that Outlook has this problem with, or only 
some?  I will admit that it has been long enough since I implemented this that 
I can't confirm that I made sure it was legal to fold *every* header after the 
colon, but I'm pretty sure I did.

--

___
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-31 Thread Windson Yang


Windson Yang  added the comment:

Hello, jcrmatos. Maybe you can submit your idea to python-ideas mail-list.

--
nosy: +Windson Yang

___
Python tracker 

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



[issue35868] Support ALL_PROXY environment variable in urllib

2019-01-31 Thread Windson Yang


Windson Yang  added the comment:

This is not a bug, it would be better to submit your ideas to python-ideas 
mail-list

--
nosy: +Windson Yang

___
Python tracker 

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



[issue35846] Incomplete documentation for re.sub

2019-01-31 Thread Windson Yang


Windson Yang  added the comment:

I wonder if possible that c not in ASCIILETTERS when we get KeyError?

if c in ASCIILETTERS:
raise s.error('bad escape %s' % this, len(this))

--
nosy: +Windson Yang

___
Python tracker 

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



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

2019-01-31 Thread Chris Langton


Chris Langton  added the comment:

interestingly, while it is expected Process or Queue would actually close 
resource file descriptors and doesn't because a dev decided they prefer to 
defer to the user how to manage gc themselves, the interesting thing is if you 
'upgrade' your code to use a pool, the process fd will be closed as the pool 
will destroy the object (so it is gc more often);

Say you're limited to a little over 1000 fd in your o/s you can do this

###

import multiprocessing
import json


def process(data):
with open('/tmp/fd/%d.json' % data['name'], 'w') as f:
f.write(json.dumps(data))
return 'processed %d' % data['name']

if __name__ == '__main__':
pool = multiprocessing.Pool(1000)
try:
for _ in range(1000):
x = {'name': _}
pool.apply(process, args=(x,))
finally:
pool.close()
del pool

###

only the pool fd hangs around longer then it should, which is a huge 
improvement, and you might not find a scenario where you need many pool objects.

--

___
Python tracker 

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



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

2019-01-31 Thread Chris Langton


Chris Langton  added the comment:

@pitrou I am interested in a fix for Python 2.7 because in Python 3.x the 
manner in which arithmetic is output is not arbitrary precise.

So I will continue using Python 2.7 until another language I am familiar with 
that has superior arbitrary precise arithmetic compared to python 3.x reaches a 
point where the lib ecosystem is as mature as python 2.7

I heavily use multiprocessing and have many use cases where i work around this 
issue, because i encounter it almost every time i find i need multiprocessing, 
basically i decide i need multiprocessing when i have too many external 
resources being processed by 1 CPU, meaning that multiprocessing will be 
managing thousands of external resources on immediate use!

I work around this issue with this solution instead of the Queue with always 
failed!



#!/usr/bin/env python  

import multiprocessing, time

ARBITRARY_DELAY = 10

processes = []
for data in parse_file(zonefile_path, regex):
t = multiprocessing.Process(target=write_to_json, args=(data, ))
processes.append(t)

i = 0
for one_process in processes:
i += 1
if i % 1000 == 0:
time.sleep(ARBITRARY_DELAY)
one_process.start()

for one_process in processes:
one_process.join()



At the time (years ago) i don't think i knew enough about fd to be good enough 
to solve the root cause (or be elegant) and i've reused this code every time 
Queue failed me (every time i use Queue basically)

To be frank, i ask anyone and they say Queue is flawed.

Now, I am older, and I had some free time, I decided to fix my zonefile parsing 
scripts and use more elegant solutions, i finally looked at the old code i 
reused in many projects and identified it was actually a fd issue (yay for 
knowledge) and was VERY disappointed to see here that you didn't care to solve 
the problem for python 2.7.. very unprofessional..

Now i am disappointed to by unpythonic and add to my script gc... you're 
unprofessionalism now makes me be unprofessional

--
nosy: +Chris Langton

___
Python tracker 

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



[issue35871] Pdb NameError in generator param and list comprehension

2019-01-31 Thread Jayanth Raman


New submission from Jayanth Raman :

I get a NameError for a variable in the generator param of a function or in a 
list comprehension.  See example below.  The variable is available to the 
program, but not to the interactive Pdb shell.

# Test file:

def main(nn=10):
xx = list(range(nn))
breakpoint()
for ii in range(nn):
num = sum(xx[jj] for jj in range(nn))
print(f'xx={xx}')

if __name__ == '__main__':
main()


$ python3
Python 3.7.2 (default, Jan 13 2019, 12:50:15)
[Clang 10.0.0 (clang-1000.11.45.5)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>>

$ python3 /tmp/test.py
> /tmp/test.py(5)main()
-> for ii in range(nn):
(Pdb) n
> /tmp/test.py(6)main()
-> num = sum(xx[jj] for jj in range(nn))
(Pdb) sum(xx[jj] for jj in range(nn))
*** NameError: name 'xx' is not defined
(Pdb) [xx[jj] for jj in range(nn)]
*** NameError: name 'xx' is not defined
(Pdb) c
xx=[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]


FWIW python3 is a homebrew installation.  I had the same issue with 3.7.0 as 
well (also homebrew):
Python 3.7.0 (default, Sep 18 2018, 18:47:22)
[Clang 9.1.0 (clang-902.0.39.2)] on darwin

--
components: Interpreter Core
messages: 334639
nosy: jayanth
priority: normal
severity: normal
status: open
title: Pdb NameError in generator param and list comprehension
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



[issue35870] readline() specification is unclear

2019-01-31 Thread Martin Panter


Martin Panter  added the comment:

I agree that the documentation should be clearer about the first two points. 
Considering that the "input" function and by default the "str.splitlines" 
method both behave differently, I often had to re-learn this when I had less 
Python experience.

The expected behaviour as I understand is the line terminator is included if it 
was read. It is not included if the size limit or EOF was reached first. The 
Python 2 documentation 
 is clear about 
both the newline being included and EOF behaviour.

Regarding text files, if you mean the "TextIOWrapper.readline" method, I think 
it is reasonable to assume you get the translated line endings as specified by 
the constructor's "newline" argument: 
. Newline='' and 
newline='\r\n' would keep the '\r\n' terminators, and newline=None would 
translate them to '\n'.

--
nosy: +martin.panter

___
Python tracker 

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



[issue35780] Recheck logic in the C version of the lru_cache()

2019-01-31 Thread miss-islington


Change by miss-islington :


--
pull_requests: +11579, 11580

___
Python tracker 

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



[issue35780] Recheck logic in the C version of the lru_cache()

2019-01-31 Thread miss-islington


Change by miss-islington :


--
pull_requests: +11579, 11580, 11581

___
Python tracker 

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



[issue35780] Recheck logic in the C version of the lru_cache()

2019-01-31 Thread miss-islington


Change by miss-islington :


--
pull_requests: +11579

___
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-31 Thread Jon Ribbens


Jon Ribbens  added the comment:

It is not correct folding. It might not be explicitly forbidden, but it is 
clearly unwise, and is breaking 'conservative in what you send'. Outlook will 
not be the only program that fails to parse Python's output.

--

___
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-31 Thread R. David Murray


R. David Murray  added the comment:

Also note that you might want to switch to the new API, the folder it uses is 
smarter, although in this case I think it will produce the same result because 
it is the "best" rendering of the header under the circumstances.

--

___
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-31 Thread R. David Murray


R. David Murray  added the comment:

That is correct folding.  The word is too long to fit within the 78 character 
default if put on the same line as the label, but does fit on a line by itself.

If Outlook can't understand such a header it is even more broken than I thought 
it was :(  You can work around the outlook but by specifying a 
longer-than-standard (but still RFC compliant) line length when serializing the 
message.

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

___
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-31 Thread R. David Murray


Change by R. David Murray :


--
nosy:  -r.david.murray

___
Python tracker 

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



[issue35780] Recheck logic in the C version of the lru_cache()

2019-01-31 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
pull_requests: +11576, 11577

___
Python tracker 

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



[issue35780] Recheck logic in the C version of the lru_cache()

2019-01-31 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
pull_requests: +11576

___
Python tracker 

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



[issue35780] Recheck logic in the C version of the lru_cache()

2019-01-31 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
pull_requests: +11576, 11577, 11578

___
Python tracker 

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



[issue35431] Add a function for computing binomial coefficients to the math module

2019-01-31 Thread Jakub Wilk


Change by Jakub Wilk :


--
nosy: +jwilk

___
Python tracker 

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



[issue35870] readline() specification is unclear

2019-01-31 Thread Victor Porton


New submission from Victor Porton :

In https://docs.python.org/3/library/io.html it is forgotten to say whether 
'\n' is appened to the return value of readline().

It is also unclear what happens if the last line not terminated by '\n' is read.

It is also unclear what is returned if a text file (say with '\r\n' 
terminators) is read. Is it appended to the return value '\n', '\r\n' or 
nothing?

--
assignee: docs@python
components: Documentation
messages: 334634
nosy: docs@python, porton
priority: normal
severity: normal
status: open
title: readline() specification is unclear
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



[issue35773] test_bdb fails on AIX bot (regression)

2019-01-31 Thread Michael Felt


Michael Felt  added the comment:

Update:
buildbot@x064:[/home/buildbot/buildarea/3.x.aixtools-aix-power6/issue]./python 
-m test -v test_bdb
== CPython 3.8.0a0 (heads/master-dirty:0785889468, Jan 30 2019, 16:16:31) [C]
== AIX-1-00C291F54C00-powerpc-32bit big-endian
== cwd: 
/home/buildbot/buildarea/3.x.aixtools-aix-power6/issue/build/test_python_11862246
== CPU count: 8
== encodings: locale=ISO8859-15, FS=iso8859-15
Run tests sequentially
0:00:00 [1/1] test_bdb
test_down (test.test_bdb.StateTestCase) ... ok
...
test_step_at_return_with_no_trace_in_caller (test.test_bdb.IssuesTestCase) ... 
ok

==
FAIL: test_skip (test.test_bdb.StateTestCase)
--
Traceback (most recent call last):
  File 
"/home/buildbot/buildarea/3.x.aixtools-aix-power6/issue/Lib/test/test_bdb.py", 
line 731, in test_skip
tracer.runcall(tfunc_import)
  File 
"/home/buildbot/buildarea/3.x.aixtools-aix-power6/issue/Lib/test/test_bdb.py", 
line 448, in __exit__
self.test_case.fail(err_msg)
  File 
"/home/buildbot/buildarea/3.x.aixtools-aix-power6/issue/Lib/test/test_bdb.py", 
line 582, in fail
raise self.failureException(msg) from None
AssertionError: encoding with 'iso8859-15' codec failed (BdbNotExpectedError: 
Wrong event type at expect_set item 2, got 'call'
  Expected: ('line', 3, 'tfunc_import')
  Got:  ('call', 11, 'encode'), ('quit',),)

--

Ran 31 tests in 0.392s

Is this somehow related to "encoding" as in AIX is not using utf-8 as default?

--

___
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-31 Thread Raymond Hettinger


Change by Raymond Hettinger :


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



[issue35766] Merge typed_ast back into CPython

2019-01-31 Thread Guido van Rossum


Change by Guido van Rossum :


--
pull_requests: +11573, 11574, 11575

___
Python tracker 

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



[issue35766] Merge typed_ast back into CPython

2019-01-31 Thread Guido van Rossum


Change by Guido van Rossum :


--
pull_requests: +11573, 11574

___
Python tracker 

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



[issue35766] Merge typed_ast back into CPython

2019-01-31 Thread Guido van Rossum


Change by Guido van Rossum :


--
pull_requests: +11573

___
Python tracker 

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



[issue35869] io.BufferReader.read() returns None

2019-01-31 Thread Steve Palmer


Steve Palmer  added the comment:

The description of read in io.BufferedReader.read function states "Read and 
return size bytes, or if size is not given or negative, until EOF or if the 
read call would block in non-blocking mode."  This does mention the non-block 
mode scenario, but I can't parse this sentence.

--

___
Python tracker 

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



[issue35855] IDLE squeezer: improve unsqueezing and autosqueeze default

2019-01-31 Thread Tal Einat


Tal Einat  added the comment:

In my opinion, everything here is relatively minor compared to some other 
current issues with IDLE, e.g. some of those mentioned by Raymond Hettinger in 
his comments on #35196.

That being said, a few comments:

> E1. Add 'Expand' at the top of the context menu.  (I sometimes right click 
> instead of double-clicking the squeeze label.)  (And add 'Help' at the 
> bottom, to display an explanation of Squeezer.)

I agree. If you create an issue, I'll make a PR.

> E2. Add a hot key to expand when the text cursor is on the line with the 
> squeeze label.

This existed in previous versions of Squeezer, but I removed it to keep things 
simple. It can easily be added.

> U1. If the squeeze label is near the bottom of the window, only the top few 
> lines are made visible.

Scrolling the screen for the user should usually be avoided. With scrolling 
being easy these days (scroll wheels, native scrolling in touchpads, touch 
screens) I vote to leave this up to the user.

> U2. *Perhaps* we should put the text cursor at the beginning of the output, 
> instead of leaving it at the next prompt, so nagivation keys work.

This would be the case when done via keyboard as suggested in E2. I'm strongly 
against moving the cursor upon un-squeezing text in general.


Regarding A1-A3 and the rest, I fail to see the point, but have nothing 
constructive to say.

--

___
Python tracker 

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



[issue35869] io.BufferReader.read() returns None

2019-01-31 Thread Steve Palmer


New submission from Steve Palmer :

class io.BufferedIOBase states "In addition, those methods [read(), readinto() 
and write()] can raise BlockingIOError if the underlying raw stream is in 
non-blocking mode and cannot take or give enough data; unlike their RawIOBase 
counterparts, they will never return None."

However, class.io.BufferedReader (inheriting from io.BufferedIOBase) *does* 
return None in this case.  Admittedly, io.BufferedReader does says it is 
overriding the inherited method, but I'm surprised that change in behaviour 
declared for buffered objects, is reverted to the RarIOBase behaviour on a more 
specific class.

The attached file (a little long - sorry), simulates a slow non-blocking raw 
file, which it wraps in a BufferReader to test the behaviour defined in 
BufferedIOBase.

--
files: read2.py
messages: 334630
nosy: steverpalmer
priority: normal
severity: normal
status: open
title: io.BufferReader.read() returns None
type: behavior
versions: Python 3.7
Added file: https://bugs.python.org/file48091/read2.py

___
Python tracker 

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



[issue29995] re.escape() escapes too much

2019-01-31 Thread Salvo Tomaselli


Salvo Tomaselli  added the comment:

Aaaand this broke my unit tests when moving from 3.6 to 3.7!

--
nosy: +LtWorf

___
Python tracker 

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



[issue35868] Support ALL_PROXY environment variable in urllib

2019-01-31 Thread SilentGhost


Change by SilentGhost :


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



[issue27749] multprocessing errors on Windows: WriteFile() argument 1 must be int, not None; OSError: handle is closed

2019-01-31 Thread Michael Jacob


Michael Jacob  added the comment:

So, I'm experiencing the issue in the title, too. The pipe handle stays valid 
for between 5 and 60 minutes, then it goes None when written to.

I'm far from understanding that code, but this crude re-connect code seems to 
solve the issue for me:

In BaseProxy._callmethod, I changed:

conn.send((self._id, methodname, args, kwds))

to:

try:
conn.send((self._id, methodname, args, kwds))
except TypeError:
self._connect()
conn = self._tls.connection
conn.send((self._id, methodname, args, kwds))

--

___
Python tracker 

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



[issue35868] Support ALL_PROXY environment variable in urllib

2019-01-31 Thread Oleh Khoma


Change by Oleh Khoma :


--
components: +Library (Lib) -Extension Modules

___
Python tracker 

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



[issue35868] Support ALL_PROXY environment variable in urllib

2019-01-31 Thread Oleh Khoma


New submission from Oleh Khoma :

Please, add support for ALL_PROXY environment variable to urllib. When this 
environment variable is found, add same proxy for HTTP, HTTPS and FTP.

--
components: Extension Modules
messages: 334627
nosy: Oleh Khoma
priority: normal
severity: normal
status: open
title: Support ALL_PROXY environment variable in urllib
type: enhancement

___
Python tracker 

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



[issue27015] subprocess.CalledProcessError's repr changes based on kwargs, and doesn't unpickle

2019-01-31 Thread Nick Coghlan

Nick Coghlan  added the comment:

Reviewing Rémi's page made me realise that a big part of the root cause here is 
pickle support in exceptions predating the introduction of `__getnewargs__` and 
`__getnewargs_ex__`.

--
nosy: +ncoghlan

___
Python tracker 

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



[issue35867] NameError is not caught at Task execution

2019-01-31 Thread Sampsa Riikonen


New submission from Sampsa Riikonen :

- Create a cofunction that raises an Exception or an Error
- Schedule that cofunction as a task
- Exceptions are raised when the task is executed OK
- However, Errors (i.e. NameError, AssertionError, etc.) are raised only at 
task garbage collection..!

Please try this snippet:

```
import asyncio

class HevonPaskaa:

def __init__(self):
pass

async def goodfunc(self):
await asyncio.sleep(3)
print("Good function was called allright")
print("While it was sleeping, hevonpaska must have been executed")

async def hevonpaska(self):
"""When this cofunction is scheduled as a task:
- The NameError is not raised immediately .. !
- BaseException is raised immeadiately OK
"""
raise NameError # WARNING: This is catched only when the program 
terminates
# raise BaseException # WARNING: comment the previous line and 
uncomment this: this is catched immediately

async def cofunc2(self):
# # we'd like this to raise the NameError immediately:
self.task = asyncio.get_event_loop().create_task(self.hevonpaska())
self.good_task = asyncio.get_event_loop().create_task(self.goodfunc())
# # this raises NameError immediately because the task is garbage 
collected:
# self.task = None

async def cofunc1(self):
await self.cofunc2()
print("\nwaitin' : where-t-f is the NameError hiding!?")
await asyncio.sleep(6)
print("Wait is over, let's exit\n")

hv = HevonPaskaa()

asyncio.get_event_loop().run_until_complete(hv.cofunc1())
```

--
components: asyncio
messages: 334625
nosy: Sampsa Riikonen, asvetlov, yselivanov
priority: normal
severity: normal
status: open
title: NameError is not caught at Task execution
type: behavior
versions: Python 3.6

___
Python tracker 

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



[issue35766] Merge typed_ast back into CPython

2019-01-31 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c by Łukasz Langa (Guido 
van Rossum) in branch 'master':
bpo-35766: Merge typed_ast back into CPython (GH-11645)
https://github.com/python/cpython/commit/dcfcd146f8e6fc5c2fc16a4c192a0c5f5ca8c53c


--
nosy: +lukasz.langa

___
Python tracker 

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



[issue12822] NewGIL should use CLOCK_MONOTONIC if possible.

2019-01-31 Thread STINNER Victor


STINNER Victor  added the comment:

See also bpo-23428: "Use the monotonic clock for thread conditions on POSIX 
platforms".

--

___
Python tracker 

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



[issue27015] subprocess.CalledProcessError's repr changes based on kwargs, and doesn't unpickle

2019-01-31 Thread Nick Coghlan


Change by Nick Coghlan :


--
pull_requests:  -11260

___
Python tracker 

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



[issue27015] subprocess.CalledProcessError's repr changes based on kwargs, and doesn't unpickle

2019-01-31 Thread Nick Coghlan


Change by Nick Coghlan :


--
pull_requests:  -11261

___
Python tracker 

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



[issue34778] Memoryview for column-major (f_contiguous) arrays from bytes impossible to achieve

2019-01-31 Thread Nick Coghlan


Nick Coghlan  added the comment:

+1 for Antoine's comment - while our approach with memoryview has generally 
been "If you're doing serious work with n-dimensional data, you still need 
NumPy (or an equivalent)", we've also been open to borrowing more NumPy 
behaviours for memoryview as particular pain points arise, and I think that 
applies here.

--

___
Python tracker 

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



[issue12822] NewGIL should use CLOCK_MONOTONIC if possible.

2019-01-31 Thread INADA Naoki


INADA Naoki  added the comment:

ref: https://bugs.chromium.org/p/webrtc/issues/detail?id=9269
macOS and iOS don't support pthread_condattr_setclock yet.

--
components: +Interpreter Core -None
versions: +Python 3.8 -Python 3.2, Python 3.3

___
Python tracker 

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



[issue35866] concurrent.futures deadlock

2019-01-31 Thread SilentGhost


Change by SilentGhost :


--
nosy: +bquinlan, pitrou

___
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-31 Thread STINNER Victor


STINNER Victor  added the comment:

> If the intent is to use this issue to track the resolution of the original 
> issue (clang compilation broken) and cover the new PR (which just moves the 
> code from os detection to compiler detection), then it can remain open. 
> Otherwise it can be closed, as the original issue 'has' been fixed.

Ok, I close the issue.

On https://github.com/python/cpython/pull/5233 bapt asked "code changes", but I 
don't understand what exactly and I'm not interested to continue to work on 
these changes. If someone is interested, please open a new issue (pointing to 
this one).

--
resolution:  -> fixed
status: open -> closed

___
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-31 Thread Antoine Pitrou


Antoine Pitrou  added the comment:

Jeroen you're right.  Could you still give it a quick check?  Then I'll mark 
the PR for a 2.7 backport.

--

___
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-31 Thread Antoine Pitrou


Change by Antoine Pitrou :


--
status: closed -> open

___
Python tracker 

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



[issue35866] concurrent.futures deadlock

2019-01-31 Thread Jakub Wilk


New submission from Jakub Wilk :

The attached test program hangs eventually (it may need a few thousand of 
iterations).

Tested with Python v3.7.2 on Linux, amd64.

--
components: Library (Lib)
files: cf-deadlock.py
messages: 334618
nosy: jwilk
priority: normal
severity: normal
status: open
title: concurrent.futures deadlock
type: behavior
versions: Python 3.7
Added file: https://bugs.python.org/file48090/cf-deadlock.py

___
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-31 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
nosy:  -terry.reedy

___
Python tracker 

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



[issue35825] Py_UNICODE_SIZE=4 fails to link on Windows

2019-01-31 Thread INADA Naoki


Change by INADA Naoki :


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



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

2019-01-31 Thread Raymond Hettinger


Raymond Hettinger  added the comment:


New changeset 0bb4bdf0d93b301407774c4ffd6df54cff947df8 by Raymond Hettinger in 
branch 'master':
bpo-35864: Replace OrderedDict with regular dict in namedtuple() (#11708)
https://github.com/python/cpython/commit/0bb4bdf0d93b301407774c4ffd6df54cff947df8


--

___
Python tracker 

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



[issue35865] configparser document refers about random dict order

2019-01-31 Thread INADA Naoki


Change by INADA Naoki :


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



[issue35865] configparser document refers about random dict order

2019-01-31 Thread INADA Naoki


INADA Naoki  added the comment:


New changeset 59014449721966a7890f6323616431ad869ec7cc by Inada Naoki in branch 
'3.7':
bpo-35865: doc: Remove wrong note and directives (GH-11711)
https://github.com/python/cpython/commit/59014449721966a7890f6323616431ad869ec7cc


--

___
Python tracker 

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



[issue33504] configparser should use dict instead of OrderedDict in 3.7+

2019-01-31 Thread INADA Naoki


INADA Naoki  added the comment:


New changeset 0897e0c597c065f043e4286d01f16f473ab664ee by Inada Naoki in branch 
'master':
bpo-33504: fix wrong "versionchanged" (GH-11712)
https://github.com/python/cpython/commit/0897e0c597c065f043e4286d01f16f473ab664ee


--
nosy: +inada.naoki

___
Python tracker 

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



[issue33800] Fix default argument for parameter dict_type of ConfigParser/RawConfigParser

2019-01-31 Thread INADA Naoki


INADA Naoki  added the comment:

I'm sorry. bpo-35865 (GH-11711)

--

___
Python tracker 

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



[issue34003] csv.DictReader can return basic dict instead of OrderedDict

2019-01-31 Thread Raymond Hettinger


Raymond Hettinger  added the comment:


New changeset 9f3f0931cfc58498086d287226650599a97412bb by Raymond Hettinger 
(Michael Selik) in branch 'master':
bpo-34003: Use dict instead of OrderedDict in csv.DictReader (GH-8014)
https://github.com/python/cpython/commit/9f3f0931cfc58498086d287226650599a97412bb


--

___
Python tracker 

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



[issue35865] configparser document refers about random dict order

2019-01-31 Thread INADA Naoki


INADA Naoki  added the comment:

Also revert GH-7542 (bpo-33800) too.

--

___
Python tracker 

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



[issue33800] Fix default argument for parameter dict_type of ConfigParser/RawConfigParser

2019-01-31 Thread INADA Naoki


INADA Naoki  added the comment:

I revert this change in GH-35865.

--

___
Python tracker 

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



[issue33800] Fix default argument for parameter dict_type of ConfigParser/RawConfigParser

2019-01-31 Thread INADA Naoki


INADA Naoki  added the comment:

This should be reverted in 3.7.
bpo-33504 changed dict_type from 3.8+, not 3.7.

--
nosy: +inada.naoki

___
Python tracker 

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



[issue33504] configparser should use dict instead of OrderedDict in 3.7+

2019-01-31 Thread INADA Naoki


Change by INADA Naoki :


--
pull_requests: +11570, 11571, 11572

___
Python tracker 

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



[issue33504] configparser should use dict instead of OrderedDict in 3.7+

2019-01-31 Thread INADA Naoki


Change by INADA Naoki :


--
pull_requests: +11570

___
Python tracker 

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



[issue33504] configparser should use dict instead of OrderedDict in 3.7+

2019-01-31 Thread INADA Naoki


Change by INADA Naoki :


--
pull_requests: +11570, 11571

___
Python tracker 

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



[issue35865] configparser document refers about random dict order

2019-01-31 Thread INADA Naoki


Change by INADA Naoki :


--
keywords: +patch, patch, patch
pull_requests: +11567, 11568, 11569
stage:  -> patch review

___
Python tracker 

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



[issue35865] configparser document refers about random dict order

2019-01-31 Thread INADA Naoki


Change by INADA Naoki :


--
keywords: +patch, patch
pull_requests: +11567, 11568
stage:  -> patch review

___
Python tracker 

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



[issue35865] configparser document refers about random dict order

2019-01-31 Thread INADA Naoki


Change by INADA Naoki :


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

___
Python tracker 

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



[issue35865] configparser document refers about random dict order

2019-01-31 Thread INADA Naoki


New submission from INADA Naoki :

GH-6819 (bpo-33504) changed OrderedDict to dict, and removed note about 
randomness of dict order in dict.

But it is only for 3.8.  Python 3.7 document should remove the note too.

--
assignee: docs@python
components: Documentation
messages: 334609
nosy: docs@python, inada.naoki
priority: normal
severity: normal
status: open
title: configparser document refers about random dict order
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