[issue35196] IDLE text squeezer is too aggressive and is slow

2019-01-29 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

I think any further work on IDLE print speed should look at the entire path 
from print('x') to 'x' appearing in IDLE's Shell.  Where does the time go, what 
might be sped up?

I no longer think auto-squeezing should consider more than a single output 
string.

To continue this issue, I opened squeezer index issue #35855.  It describes 
what I think are the 2 main uses of auto-squeezing and several possible 
squeezer or related improvements, labeled for easy reference.

Some existing and new issues related to some of the off-topic messages:
#21261: Dict key tab completion.
#22121: Start in $HOME.
#24776: Configdialog font tab user interface -- add comment.
#25522: Save-as warning -- include unimportable names.
#28775: Set start-up directory
#32761: Modern Mac Keyset.
#33397: Change font size with cntl +- (text view first).

#35763: Calltips: make positional note smaller.
#35768: Detecting monospaced fonts with font sample -- automeasure.
#35769: ''Untitled" to "untitled" (fixed).

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



[issue35842] A potential bug about use of uninitialised variable

2019-01-29 Thread rongxin


rongxin  added the comment:

Josh Rosenberg, thanks for your useful comments.

--

___
Python tracker 

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



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

2019-01-29 Thread Eryk Sun


Eryk Sun  added the comment:

> Actually, it seems like venv symlinks are so far from working 
> that they haven't worked (on Windows) since 3.5 or possibly 
> earlier.

I use venv with --symlinks prior to 3.7.2. It works fine as far as I can tell. 
Perhaps you could elaborate. I assumed you removed it because it's not 
compatible with the Microsoft Store release for some reason. 

The loader doesn't resolve links, so it should work as long as the python.exe, 
python3x.dll, python3.dll, and vcruntime140.dll files are linked together in 
the Scripts directory. 

>>> hPython3 = ctypes.WinDLL('python3')._handle
>>> hVcruntime140 = ctypes.WinDLL('vcruntime140')._handle
>>> for h in (0, sys.dllhandle, hPython3, hVcruntime140):
... print(_winapi.GetModuleFileName(h), '->')
... print('\t', os.readlink(_winapi.GetModuleFileName(h)))
...
C:\Temp\env36\scripts\python.exe ->
 C:\Program Files\Python36\python.exe
C:\Temp\env36\scripts\python36.dll ->
 C:\Program Files\Python36\python36.dll
C:\Temp\env36\scripts\python3.dll ->
 C:\Program Files\Python36\python3.dll
C:\Temp\env36\scripts\VCRUNTIME140.dll ->
 C:\Program Files\Python36\vcruntime140.dll

>>> print(sys.executable)
C:\Temp\env36\scripts\python.exe

>>> print(*sys.path, sep='\n')

C:\Temp\env36\scripts\python36.zip
C:\Program Files\Python36\DLLs
C:\Program Files\Python36\lib
C:\Program Files\Python36
C:\Temp\env36
C:\Temp\env36\lib\site-packages

--

___
Python tracker 

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



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

2019-01-29 Thread Steve Pryde


New submission from Steve Pryde :

When python prints or returns a stacktrace, it displays the appropriate line 
from the *current file on disk*, which may have changed since the program was 
run. It should instead show the lines from the file as it was when the code was 
executed.

Steps to reproduce:
1. Save the following code to a file and run it in a terminal.

import time 

time.sleep(600)

2. While it is running, insert a line before "time.sleep(600)", type some 
random characters, and save the file. The "time.sleep" should now be on line 4, 
and some random characters on line 3.

3. Now go back to the terminal and press Ctrl+C (to generate a stacktrace).


Expected output:

^CTraceback (most recent call last):
  File "py1.py", line 3, in 
time.sleep(600)
KeyboardInterrupt


Actual output:

^CTraceback (most recent call last):
  File "py1.py", line 3, in 
some random characters
KeyboardInterrupt

--
components: Interpreter Core
messages: 334544
nosy: Steve Pryde
priority: normal
severity: normal
status: open
title: Stacktrace shows lines from updated file on disk, not code actually 
running
type: behavior
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



[issue35856] bundled pip syntaxwarning

2019-01-29 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

This needs to be updated in vendor files for pip repo and then updating the 
files in CPython. The upstream issue on requests is fixed.

--
nosy: +dstufft, ncoghlan, xtreak

___
Python tracker 

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



[issue35856] bundled pip syntaxwarning

2019-01-29 Thread Dima Tisnek

New submission from Dima Tisnek :

It seems that `pip` vendored/bundled with Python3.8 doesn't conform to 3.8 
syntax:

… ~> /usr/local/bin/python3.8 -m ensurepip
/.../tmp.../pip-18.1-py2.py3-none-any.whl/pip/_vendor/requests/status_codes.py:3:
 SyntaxWarning: invalid escape sequence \o
/.../tmp.../pip-18.1-py2.py3-none-any.whl/pip/_vendor/requests/status_codes.py:3:
 SyntaxWarning: invalid escape sequence \o
Looking in links: /.../tmp...
Requirement already satisfied: setuptools in 
/usr/local/lib/python3.8/site-packages (40.6.2)
Requirement already satisfied: pip in /usr/local/lib/python3.8/site-packages 
(18.1)

Python 3.8.0a0 (bafa8487f77fa076de3a06755399daf81cb75598) built from source

--
components: Library (Lib)
messages: 334542
nosy: Dima.Tisnek
priority: normal
severity: normal
status: open
title: bundled pip syntaxwarning
type: behavior
versions: Python 3.8

___
Python tracker 

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



[issue35855] IDLE squeezer: improve unsqueezing and autosqueeze default

2019-01-29 Thread Terry J. Reedy


New submission from Terry J. Reedy :

This issue continues #35196, which fixed some bugs (inconsistencies) in 
auto-squeezing and sped the scan of output strings for possible auto-squeezing. 
 This issue has two parts:
1. Make unsqueezing faster and easier for the user.  Details discussed below.
2. Reconsider the parameters and protocol for auto-squeezing.
2a. Increase the default setting for the minimum number of number of lines to 
squeeze.  The best setting depends on the result of part 1.
2b. Other changes?

(Some of the work might be done on separate PRs on issues that are dependencies 
of this one.)

If users ask for a big blob of text, they presumably want to read at least some 
of it, usually from the beginning, and possibly scan up and down.  The most 
common example is output from help(object), defined in the pydoc and 
_sitebuiltins modules.

Help first computes a single output string, whether 2 lines (list.append), 600 
(itertools) or over 2 (tkinter).  For modules, one most likely want to see 
the module docstring.  Those for itertools are about 40 and 80 lines 
respectively and both list the functions/classes in the module.

With standard interactive python on a text terminal/console, help output is run 
through a pager.  If more than a full screen, output is paused with a prompt.  
I consider both 'more' on Windows and 'less' on Mac to be overall 
unsatisfactory, especially for naive beginners, and hope we can do overall 
better on IDLE.

On Windows, the prompt is "-- More --", with no hint of what to do.  One can 
experiment and discover that Enter means 'display one more line' and Space 
means 'display one more screenful'.  Or one can guess to enter "more /h" at a 
console command prompt.  Either way, paging a thousand times to get the entire 
output for tkinter is not practical.

As far as I can tell from the 'more /h' output, there is no 'dump remaining 
text' command other than 'p '.  What is worse, 
a Windows console only holds the last N lines displayed, where N defaults to 
300 and can be increased to at most . So scrolling back is limited.  This 
is terrible, especially at the default setting.

On Mac Terminal, the pager is 'less', the prompt is ':', Space and Enter do the 
same, scrolling is only partially possible and weird, P goes to the top, a 
number N after space goes down N lines, to an 'END' prompt. As near as I could 
discover, less refuses to exit until one hits 'q', at which point the help text 
disappears.  This is true even for the 2-line help for list.append.  Terrible.

On IDLE, without squeezer, the entire text is displayed followed by a fresh 
'enter code' prompt ('>>>').  However, for multi-screen text, the user 
immediately sees only the last lines, not the first.  This is bad, But at least 
there is a possibility of scrolling up and trying to find the beginning of the 
text, although this may take several seconds.

When squeezer unsqueezes, it makes the first line, not the last line, visible.  
For a long enough output string, the easier way to get to the first line to 
start reading, other than scrolling, is to squeeze and unsqueeze.  (This 
applies to open_file.read() also.)  Absent anything better, I now consider this 
the primary justification for auto-squeezing.

The following should make triggering expansion of a squeeze label easier and 
faster, in terms of user actions, regardless of how the  label came about.

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

E2. Add a hot key to expand when the text cursor is on the line with the 
squeeze label.  After typing 'help(xyz)' and getting a squeeze label, I would 
prefer to hit   and perhaps use navigation keys instead of 
immediately having to grab the mouse.

E3. Stop the false (or at least out-dated) and confusing warning about many 
normal text lines causing problems.  The 2 lines of tkinter help is not an 
issue on either my years-old Windows desktop and slower years-old MacbookAir.  
I once printed over half a million lines , about 40 chars as I remember, on 
Windows IDLE without issue.

Long lines are a different issue.  'a'*1 is okay on Windows, but not on 
Mac.  On the latter, after unsqueezing, and scrolling down to the new prompt, 
trying to scroll back up results in the OS twirly pause icon for a few seconds. 
 The natureal response of adding more keys presses and mouse clicks trying to 
get a response probably made the experience worse.  This reminds me of my 
previous Windows machine a decade ago.  

A line length warning needs data both on the machine and the max lines of the 
text.  The latter might be gathered fast enough by checking line lengths in an 
after loop.


Once the text is expanded, it could be more immediately useful.

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

[issue35853] Extend the functools module with more higher order function combinators

2019-01-29 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

I believe each of these has been discussed and individually rejected before.  
They don't apply as neatly to Python as one would hope.  Identity is usually 
inefficient in Python and we use a func=None as a substitute.  Identity also 
had issues with returning scalars versus an args tuple and issues with keyword 
arguments.   Compose wasn't found to be generally useful in typical Python 
programming and its application order was deemed to be confusing relative to a 
simple nested function call or a simple lambda.  Compose also had challenges 
with chaining multi-argument functions together in an intuitive way.  For both, 
there were also error message issues and other challenges to making code that 
is easily debuggable when there is a failure.  We did accept partial() because 
it was a good fit with the language, it was easy to reason about, and it had a 
number of known use cases in real code.   FWIW, it is not the aspiration of the 
functools module to emulate a straight functional programmin
 g environment.  It is more a generic set of tools that that have function-like 
behavior rather than class-like behavior.   Please also take a look a various 
posts from Guido van Rossum on why didn't push the language more in the 
direction of functional programming.

Thank for the suggestion, but this isn't the first time it has crossed our 
minds.  If there had been a good case for these constructs, it would have 
happened long ago :-)

--
nosy: +rhettinger
resolution:  -> rejected
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



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

2019-01-29 Thread Steve Dower


Change by Steve Dower :


--
keywords: +patch, patch, patch
pull_requests: +11548, 11549, 11550
stage:  -> patch review

___
Python tracker 

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



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

2019-01-29 Thread Steve Dower


Change by Steve Dower :


--
keywords: +patch, patch
pull_requests: +11548, 11549
stage:  -> patch review

___
Python tracker 

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



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

2019-01-29 Thread Steve Dower


Change by Steve Dower :


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

___
Python tracker 

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



[issue35853] Extend the functools module with more higher order function combinators

2019-01-29 Thread Tobias Pleyer


Change by Tobias Pleyer :


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

___
Python tracker 

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



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

2019-01-29 Thread Steve Dower


Steve Dower  added the comment:

Actually, it seems like venv symlinks are so far from working that they haven't 
worked (on Windows) since 3.5 or possibly earlier.

I'm just going to make that option ignored and mark it as such in the docs.

--

___
Python tracker 

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



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

2019-01-29 Thread Steve Dower


New submission from Steve Dower :

The change to pull the redirector executables as part of scripts was... perhaps 
too clever. There exists code out there that uses EnvBuilder to create 
environments _without_ copying scripts, which now results in an environment 
that does not include python.exe.

It also undid symlink support, as scripts are never symlinked.

I'll restore both.

--
assignee: steve.dower
components: Windows
keywords: 3.7regression
messages: 334537
nosy: eryksun, paul.moore, steve.dower, tim.golden, vinay.sajip, zach.ware
priority: normal
severity: normal
status: open
title: EnvBuilder and venv symlinks do not work on Windows on 3.7.2
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



[issue35853] Extend the functools module with more higher order function combinators

2019-01-29 Thread Tobias Pleyer


New submission from Tobias Pleyer :

The partial function is a typical example of a higher order function: It takes 
a function as argument and returns a function. As the name of the functools 
module suggests its purpose is to provide tools for working with  functions. 
This should, in my opinion, include a much bigger set of higher order function 
combinators as they are known from functional programming.
As a start I suggest to add the following functions:

identity: The identity function which returns its input
compose: Create a function pipeline (threaded computation)
sequence: Use compose without binding it to a variable

--
components: Library (Lib)
messages: 334536
nosy: tpleyer
priority: normal
severity: normal
status: open
title: Extend the functools module with more higher order function combinators
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



[issue35847] RISC-V needs CTYPES_PASS_BY_REF_HACK

2019-01-29 Thread miss-islington


miss-islington  added the comment:


New changeset 10354cbb5067b4719ba1c2d51d22314a644ed3e5 by Miss Islington (bot) 
in branch '3.7':
bpo-35847: RISC-V needs CTYPES_PASS_BY_REF_HACK (GH-11694)
https://github.com/python/cpython/commit/10354cbb5067b4719ba1c2d51d22314a644ed3e5


--

___
Python tracker 

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



[issue35823] Use vfork() in subprocess on Linux

2019-01-29 Thread Alexey Izbyshev


Alexey Izbyshev  added the comment:

Thank you for the review and your thoughts, Gregory.

> With this in place we may want to make the _use_posix_spawn() logic in 
> subprocess.py stricter?  That could be its own followup PR.

Yes, I think we can always use vfork() on Linux unless we find some issues. 
(Victor Stinner doesn't seem to be against: 
https://github.com/python/cpython/pull/11668#issuecomment-457637207). Though C 
libraries are in a better position to provide safe vfork/exec, by using our 
implementation we will:
* avoid breaking QEMU user-mode (and preserve existing subprocess behavior)
* automatically support fast process creation on musl (which has a good 
posix_spawn, but doesn't have easy means (macros) on detect that we're on musl 
and thus avoid unacceptable posix_spawn).
* avoid having different code paths (and thus potential surprises) depending on 
arguments of subprocess.Popen()

> This is a scary issue.  But I think a reasonable approach could be to never 
> use vfork when running as whatever we choose to define a "privileged user" to 
> be.

> getuid() or geteuid() return 0?  don't use vfork.

I thought about something like this, but initially dismissed it because I 
(mistakenly) decided that an application may concurrently switch between 
arbitrary uids back and forth, so that checking getuid() becomes useless (if 
we're already talking about an exotic app that calls setuid() concurrently with 
spawning children, why stop there?). But now I realize that an app may use 
*arbitrary* uids only if one of its real, effective or saved uids is zero (that 
is, if we don't take capabilities into account), so at least we could call 
getresuid() to get all 3 uids in a race-free way and check whether the app is 
*definitely* privileged...

> the concept of "privileged user" can obviously mean a lot more than that and 
> likely goes beyond what we should attempt to ascertain ourselves.

...but you're making a good point here. So I'm not sure that we want such 
checks, but if we do, we'd probably need to allow users to disable them -- what 
if some heavy privileged daemon wants a faster subprocess?

> How about also providing a disable-only global setting so that someone 
> writing code they consider to have elevated privileges can prevent its use 
> entirely.  subprocess.disable_use_of_vfork() and 
> subprocess.is_vfork_enabled() calls perhaps (just setting/reading a static 
> int vfork_disallowed = 0 flag within _posixsubprocess.c).

I think it's reasonable. I'll look into it when I'm done with current issues.

> True setuid vs vfork attack security would suggest code needs to opt-in to 
> vfork() or posix_spawn() rather than opt-out.  Which would destroy the 
> benefit for most users (who won't bother) for the sake of an issue that just 
> is not what most code ever does (setuid/setgid/etc. calls are very uncommon 
> for most software).

Agree, especially since we're not talking about "just" using setuid() but 
rather about using setuid() *in a multithreaded process in a racy manner while 
spawning children*. Honestly, I'm not sure such apps can blame Python if they 
get a security hole :)

--

___
Python tracker 

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



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

2019-01-29 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

Thanks Steve for the details. I am adding io module maintainers to the issue 
who will have better context on whether to clarify the docs or to change the 
implementation to raise UnsupportedOperation.

--
nosy: +benjamin.peterson, stutzbach, xtreak

___
Python tracker 

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



[issue35837] smtpd PureProxy breaks on mail_options keyword argument

2019-01-29 Thread R. David Murray


R. David Murray  added the comment:

I'm closing this in favor of #35799 because someone has to first make a 
remove-or-fix decision, which is mentioned there.

--
resolution:  -> duplicate
stage: patch review -> resolved
status: open -> closed
superseder:  -> fix or remove smtpd.PureProxy
type:  -> behavior

___
Python tracker 

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



[issue35799] fix or remove smtpd.PureProxy

2019-01-29 Thread R. David Murray


R. David Murray  added the comment:

I'm neutral on fixing versus removing philosophically. Since fixing is actually 
the least effort in this case, I think practically I favor fixing.

--

___
Python tracker 

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



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

2019-01-29 Thread Steve Palmer


Steve Palmer  added the comment:

I agree with Karthikeyan that the method does not apply in the io.TextIOBase 
class context.  I'm sorry that I didn't spot the note in the description of 
io.TextIOBase - though I think that it is easy to miss.

I'd suggest that there are two ways to clear this up:

1. change only the documentation to read "Even though IOBase does not declare 
read() or write() because their signatures will vary, implementations and 
clients should consider those methods part of the interface."  (deleting 
reference to readinto())

2. change the standard library for io.TextIOBase to add a method readinto which 
will raise an UnsupportedOperation.

With option 1, the descriptions for io.RawIOBase and io.BufferedIOBase both 
include description of the readinto method, so nothing is lost by removing 
mention of it at the io.IOBase level of the hierarchy.  In any case, readinto() 
is not defined on the io.IOBase class.

>>> 'readinto' not in dir(io.IOBase)
True

With option 2, it feels like this is closer to the design intent of a common 
interface over similar but distinguished classes.  It also avoids removing 
things from the documentation in case someone already has some expectations of 
the behaviour.

--

___
Python tracker 

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



[issue35852] Fixed tests regenerating using CRLF when running it on Windows

2019-01-29 Thread Roundup Robot


Change by Roundup Robot :


--
keywords: +patch, patch
pull_requests: +11544, 11545
stage:  -> patch review

___
Python tracker 

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



[issue35852] Fixed tests regenerating using CRLF when running it on Windows

2019-01-29 Thread Roundup Robot


Change by Roundup Robot :


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

___
Python tracker 

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



[issue35852] Fixed tests regenerating using CRLF when running it on Windows

2019-01-29 Thread Addons Zz


New submission from Addons Zz :

When generating the file on Windows by running
```
python test/test_profile.py -r
```

The file has its line ending converted from LF to CRLF, creating noise on the 
git diff.

--
components: Library (Lib), Tests
messages: 334529
nosy: addons_zz
priority: normal
severity: normal
status: open
title: Fixed tests regenerating using CRLF when running it on Windows
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



[issue35847] RISC-V needs CTYPES_PASS_BY_REF_HACK

2019-01-29 Thread miss-islington


Change by miss-islington :


--
pull_requests: +11543

___
Python tracker 

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



[issue35847] RISC-V needs CTYPES_PASS_BY_REF_HACK

2019-01-29 Thread miss-islington


miss-islington  added the comment:


New changeset 742d768656512a469ce9571b1cbd777def7bc5ea by Miss Islington (bot) 
(Andreas Schwab) in branch 'master':
bpo-35847: RISC-V needs CTYPES_PASS_BY_REF_HACK (GH-11694)
https://github.com/python/cpython/commit/742d768656512a469ce9571b1cbd777def7bc5ea


--
nosy: +miss-islington

___
Python tracker 

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



[issue35769] IDLE: change new file name from ''Untitled" to "untitled"

2019-01-29 Thread Cheryl Sabella


Change by Cheryl Sabella :


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



[issue35851] Make search result in online docs keep their position when search finishes

2019-01-29 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

I have minimum experience with CSS but this seems to be a Sphinx level 
enhancement that needs to be made. The text is set after search completion at 
[0]. The element [1] to which the text is added has no fixed height and is 
empty at the beginning so adding a fixed height might ensure the text doesn't 
push it down. But the relevant file is part of sphinx repo and doesn't have an 
id associated with it so I am not sure how feasible it is to customize this as 
part of Python doc distribution.

[0] 
https://github.com/sphinx-doc/sphinx/blob/97d99f830258a4612a6c77f5be084819634dcbad/sphinx/themes/basic/static/searchtools.js#L299
[1] 
https://github.com/sphinx-doc/sphinx/blob/97d99f830258a4612a6c77f5be084819634dcbad/sphinx/themes/basic/static/searchtools.js#L133

--
nosy: +mdk, xtreak
versions:  -Python 2.7, Python 3.4, Python 3.5, Python 3.6

___
Python tracker 

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



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

2019-01-29 Thread Rémi Lapeyre

Change by Rémi Lapeyre :


--
versions: +Python 3.8 -Python 3.7

___
Python tracker 

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



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

2019-01-29 Thread Rémi Lapeyre

Rémi Lapeyre  added the comment:

I checked and io.TextIOBase is the only io.IOBase subclass to lack one of read, 
readinto or write:


>>> import io, inspect
>>> for name, obj in inspect.getmembers(io, predicate=inspect.isclass):
... missing = {'read', 'readinto', 'write'} - {name for name, _ in 
inspect.getmembers(obj)}
... if issubclass(obj, io.IOBase) and missing:
...  print(obj, missing, issubclass(obj, io.TextIOBase))

 {'write', 'read', 'readinto'} False
 {'readinto'} True
 {'readinto'} True
 {'readinto'} True

I can open a PR to fix the conflicts between the two parts of the 
documentation. I think it's appropriate to change TextIOBase to raise 
UnsupportedOperation when calling readinto and to change the documentation 
accordingly.

--
components: +IO -Documentation
nosy: +remi.lapeyre -docs@python, xtreak
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



[issue35851] Make search result in online docs keep their position when search finishes

2019-01-29 Thread Roel Schroeven


New submission from Roel Schroeven :

Search in the online documentation shows results while the search continues in 
the background, which is very nice.

Only problem is: when the search finishes, a line with the text "Search 
finished, found x page(s) matching the search query." appears which pushes all 
the search results down a bit. When the result you were looking for was already 
displayed, you suddenly have to aim the mouse cursor at a new position, or it 
can happen that you accidentally open the wrong link because of the results not 
staying in their place.

Is it possible to allocate space for the "Search finished, ..." line from the 
beginning, so that search results stay in the same place the whole time?

--
assignee: docs@python
components: Documentation
messages: 334525
nosy: docs@python, roelschroeven
priority: normal
severity: normal
status: open
title: Make search result in online docs keep their position when search 
finishes
type: enhancement
versions: Python 2.7, Python 3.4, 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



[issue34148] Fatal read error on socket transport

2019-01-29 Thread SilentGhost


Change by SilentGhost :


--
nosy: +asvetlov, yselivanov
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



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

2019-01-29 Thread Karthikeyan Singaravelan

Karthikeyan Singaravelan  added the comment:

https://docs.python.org/3/library/io.html#io.TextIOBase

> Base class for text streams. This class provides a character and line based 
> interface to stream I/O. There is no readinto() method because Python’s 
> character strings are immutable. It inherits IOBase. There is no public 
> constructor.

io.TextIOBase docs say there is no readinto method in the documentation.

--
nosy: +xtreak

___
Python tracker 

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



[issue35810] Object Initialization Bug with Heap-allocated Types

2019-01-29 Thread Petr Viktorin

Petr Viktorin  added the comment:

I would very much like to see this fixed.

Yes, it can make some extension types immortal, but I believe those types were 
relying on buggy behavior, and need to be fixed to prevent memory leaks.

I think this is a big enough change to be mentioned in What’s New.


> Any ideas for reducing the chance of breakage or increasing the chance of 
> detecting it in user code would help.

I'd recommend that all C extensions have leak detection as part of their test 
suite. I don't think we can do much better :(

> leaking types is unlikely to have a big enough memory impact in most 
> application to be easily detected.

Indeed, it's not a big enough problem in most applications.

--
nosy: +petr.viktorin

___
Python tracker 

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



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

2019-01-29 Thread SilentGhost


Change by SilentGhost :


--
assignee:  -> docs@python
components: +Documentation -IO
nosy: +docs@python
stage:  -> needs patch
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



[issue35849] Added thousands separators to Lib/pstats.py final report

2019-01-29 Thread SilentGhost


SilentGhost  added the comment:

Hi, your change breaks some test, most of the breakage is related to the change 
in whitespace separators. This breakages should be fixed before your PR can be 
considered for inclusion. You can see the status of the tests within discussion 
on github.

--
nosy: +SilentGhost

___
Python tracker 

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



[issue35500] Align expected and actual calls on mock.assert_called_with error message

2019-01-29 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

Cheryl, this is a good first issue for new contributor. I was waiting for 
suggestion and I am not sure if there is a consensus over the format. I would 
like to go with the below format as per suggestion from Mario and Terry.

AssertionError: expected call not found.
Expected: mock(2, 3)
Actual: mock(1, 2)

test_assert_called_with_failure_message has to be fixed as a result of this 
change. Feel free to mark it as an easy issue.

Thanks

--

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


Antoine Pitrou  added the comment:

I think feature creep is ok if it stems from user needs.

Slighty related, but simpler, is https://bugs.python.org/issue35845

--

___
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-29 Thread Stefan Krah


Stefan Krah  added the comment:

CC Antoine and Nick.

I think we can do it, but we'd need cast(shape=[2,3], order='F')
to allow casting back.

The only practical objections are feature creep. To preserve
symmetry with tobytes(), we'd need to add tobytes('F') (and
tobytes('A')).

--
nosy: +ncoghlan, pitrou

___
Python tracker 

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



[issue35850] CKAN installation went on script error

2019-01-29 Thread Christian Heimes


Christian Heimes  added the comment:

ckan is a 3rd party package and not maintain by Python core developers. Please 
report the issue with the authors of that package.

--
nosy: +christian.heimes
resolution:  -> third party
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue35850] CKAN installation went on script error

2019-01-29 Thread Previn Kutty


New submission from Previn Kutty :

Command : paster make-config ckan development.ini

was showing the following error

(ckan) C:\applns\ckan-master>paster make-config ckan test.ini
Distribution already installed:
  ckan 2.8.2 from 
c:\users\x179706\envs\ckan\lib\site-packages\ckan-2.8.2-py3.7.egg
Traceback (most recent call last):
  File "C:\applns\Python37-32\Lib\runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
  File "C:\applns\Python37-32\Lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
  File "C:\Users\x179706\Envs\ckan\Scripts\paster.exe\__main__.py", line 9, in 

  File "c:\users\x179706\envs\ckan\lib\site-packages\paste\script\command.py", 
line 102, in run
invoke(command, command_name, options, args[1:])
  File "c:\users\x179706\envs\ckan\lib\site-packages\paste\script\command.py", 
line 141, in invoke
exit_code = runner.run(args)
  File 
"c:\users\x179706\envs\ckan\lib\site-packages\paste\script\appinstall.py", line 
66, in run
return super(AbstractInstallCommand, self).run(new_args)
  File "c:\users\x179706\envs\ckan\lib\site-packages\paste\script\command.py", 
line 236, in run
result = self.command()
  File 
"c:\users\x179706\envs\ckan\lib\site-packages\paste\script\appinstall.py", line 
293, in command
self.distro, self.options.ep_group, self.options.ep_name)
  File 
"c:\users\x179706\envs\ckan\lib\site-packages\paste\script\appinstall.py", line 
232, in get_installer
'paste.app_install', ep_name)
  File 
"c:\users\x179706\envs\ckan\lib\site-packages\pkg_resources\__init__.py", line 
2728, in load_entry_poin
t

===
Python version : 3.7.2
CKAN version : 2.8.2 -> https://github.com/ckan/ckan

--
components: Library (Lib), Windows
messages: 334517
nosy: Previn Kutty, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: CKAN installation went on script error
versions: Python 3.7

___
Python tracker 

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



[issue35500] Align expected and actual calls on mock.assert_called_with error message

2019-01-29 Thread Cheryl Sabella


Cheryl Sabella  added the comment:

@xtreak, were you going to submit a pull request for this or do you think this 
would be a 'good first issue' for a new contributor?

--
nosy: +cheryl.sabella

___
Python tracker 

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



[issue32834] test_gdb fails with Posix locale in 3.7

2019-01-29 Thread Nick Coghlan


Nick Coghlan  added the comment:

Added Dave Malcolm to the nosy list, as the more recent tracebacks are actually 
throwing an exception in the gdb hooks, rather than just failing the expected 
output comparison in the test suite.

--
nosy: +dmalcolm

___
Python tracker 

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



[issue29235] Allow profile/cProfile to be used as context managers

2019-01-29 Thread Cheryl Sabella


Cheryl Sabella  added the comment:

Closing as these changes have been merged for a few months.

msg285538 mentions that the pure-Python profiler doesn't have `enable` and 
`disable`, which is already opened in issue 32017.

--
nosy: +cheryl.sabella
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



[issue35849] Added thousands separators to Lib/pstats.py final report

2019-01-29 Thread Roundup Robot


Change by Roundup Robot :


--
keywords: +patch, patch, patch
pull_requests: +11539, 11540, 11541
stage:  -> patch review

___
Python tracker 

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



[issue35849] Added thousands separators to Lib/pstats.py final report

2019-01-29 Thread Addons Zz


New submission from Addons Zz :

Instead of doing:
```
 10056.0 function calls in 0.006 seconds

   Ordered by: internal time

   ncalls  tottime  percall  cumtime  percall filename:lineno(function)
 1.00.0020.0020.0060.006 
benchmark_tests.py:121(logging_mod_log_debuglog_off)
  5000.00.0020.0000.0040.000 
F:\Python\lib\logging\__init__.py:1362(debug)
  5000.00.0010.0000.0010.000 
F:\Python\lib\logging\__init__.py:1620(isEnabledFor)
```

Do:
```
 10,056.0 function calls in 0.006 seconds

   Ordered by: internal time

   ncalls  tottime  percall  cumtime  percall filename:lineno(function)
  1.00.0020.0020.0060.006 
benchmark_tests.py:121(logging_mod_log_debuglog_off)
  5,000.00.0020.0000.0040.000 
F:\Python\lib\logging\__init__.py:1362(debug)
  5,000.00.0010.0000.0010.000 
F:\Python\lib\logging\__init__.py:1620(isEnabledFor)
```

--
components: Library (Lib)
messages: 334513
nosy: addons_zz
priority: normal
severity: normal
status: open
title: Added thousands separators to Lib/pstats.py final report
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



[issue35849] Added thousands separators to Lib/pstats.py final report

2019-01-29 Thread Roundup Robot


Change by Roundup Robot :


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

___
Python tracker 

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



[issue35849] Added thousands separators to Lib/pstats.py final report

2019-01-29 Thread Roundup Robot


Change by Roundup Robot :


--
keywords: +patch, patch
pull_requests: +11539, 11540
stage:  -> patch review

___
Python tracker 

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



[issue35841] Datetime strftime() does not return correct week numbers for 2019

2019-01-29 Thread Emmanuel Arias


Emmanuel Arias  added the comment:

> I believe this ticket can be closed.

Yes, I think so. How you say, on 35535 there is a detailed explanation about 
the behavior.

--
nosy: +eamanu

___
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-29 Thread Jeroen Demeyer


Jeroen Demeyer  added the comment:

> it seems that Jeroen's analysis is right.

So would you be willing to merge the PR then?

--

___
Python tracker 

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



[issue35841] Datetime strftime() does not return correct week numbers for 2019

2019-01-29 Thread Tommy Rowland


Tommy Rowland  added the comment:

Hi Paul,

Thank you for the clarification. I can see that %V does indeed return the
correct week number. It seems that when calling strftime, it is possible to
use this in conjunction with %y, but when calling strptime, it is not. Is
this also intended behaviour?

Best regards,

Tommy

On Mon, Jan 28, 2019 at 4:44 PM Paul Ganssle  wrote:

>
> Paul Ganssle  added the comment:
>
> I think this is not a bug. bpo-35535 is probably also intended behavior,
> but that is less certain.
>
> The misunderstanding here is that %W does not give you the ISO week
> number, from the documentation:
>
> %W: Week number of the year (Monday as the first day of the week) as a
> decimal number.
> All days in a new year preceding the first Monday are considered
> to be in week 0.
>
>
> If you want the ISO week number, I think you need %V, which *is* the ISO
> week:
>
> >>> datetime(2018, 12, 31).strftime("%V %W")
>
> '01 53'
>
> I believe this ticket can be closed.
>
> --
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue35707] time.sleep() should support objects with __float__

2019-01-29 Thread Jeroen Demeyer


Jeroen Demeyer  added the comment:

> You've got a reference leak in your __index__ based paths.

Thanks for pointing that out. I fixed that now.

--

___
Python tracker 

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



[issue35847] RISC-V needs CTYPES_PASS_BY_REF_HACK

2019-01-29 Thread Andreas Schwab


Change by Andreas Schwab :


--
keywords: +patch, patch, patch
pull_requests: +11536, 11537, 11538
stage:  -> patch review

___
Python tracker 

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



[issue35847] RISC-V needs CTYPES_PASS_BY_REF_HACK

2019-01-29 Thread Andreas Schwab


Change by Andreas Schwab :


--
keywords: +patch, patch
pull_requests: +11536, 11537
stage:  -> patch review

___
Python tracker 

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



[issue35847] RISC-V needs CTYPES_PASS_BY_REF_HACK

2019-01-29 Thread Andreas Schwab


Change by Andreas Schwab :


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

___
Python tracker 

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



[issue12731] python lib re uses obsolete sense of \w in full violation of UTS#18 RL1.2a

2019-01-29 Thread Henry S. Thompson

Henry S. Thompson  added the comment:

This issue is also implicated in a failure of isalpha and friends.
Easy way to see this is to compare
>>> isalpha('İ')
True
>>> isalpha('İ'.lower())
False

This results from the use of a combining character to encode lower-case Turkish 
dotted i:
>>> len('İ'.lower())
2
>>> unicodedata.category('İ'.lower()[1])
'Mn'

--
nosy: +HThompson

___
Python tracker 

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



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

2019-01-29 Thread Steve Palmer


New submission from Steve Palmer :

class io.IOBase states "Even though IOBase does not declare read(), readinto(), 
or write() because their signatures will vary, implementations and clients 
should consider those methods part of the interface. Also, implementations may 
raise a ValueError (or UnsupportedOperation) when operations they do not 
support are called."  However, even though class io.TextIOBase is described as 
inheriting from io.IOBase, a call to readinto method returns AttributeError 
exception indicating no readinto attribute, inconsistent with the documentation.

--
components: IO
messages: 334507
nosy: steverpalmer
priority: normal
severity: normal
status: open
title: readinto is not a method on io.TextIOBase
type: behavior
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



[issue35843] importlib.util docs for namespace packages innaccurate

2019-01-29 Thread Ronald Oussoren


Ronald Oussoren  added the comment:

See also #35673.

--
nosy: +ronaldoussoren

___
Python tracker 

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



[issue35847] RISC-V needs CTYPES_PASS_BY_REF_HACK

2019-01-29 Thread Andreas Schwab


New submission from Andreas Schwab :

==
FAIL: test_pass_by_value (ctypes.test.test_structures.StructureTestCase)
--
Traceback (most recent call last):
  File 
"/home/abuild/rpmbuild/BUILD/Python-3.7.2/Lib/ctypes/test/test_structures.py", 
line 416, in test_pass_by_value
self.assertEqual(s.first, 0xdeadbeef)
AssertionError: 195948557 != 3735928559

--

--
components: ctypes
messages: 334505
nosy: schwab
priority: normal
severity: normal
status: open
title: RISC-V needs CTYPES_PASS_BY_REF_HACK
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



[issue35846] Incomplete documentation for re.sub

2019-01-29 Thread Pascal Bugnion


New submission from Pascal Bugnion :

The documentation for `re.sub` states that "Unknown escapes such as ``\&`` are 
left alone.". This is only true for escapes which are not ascii characters, as 
far as I can tell (c.f. source on 
https://github.com/python/cpython/blob/master/Lib/sre_parse.py#L1047).

Would there be value in amending that documentation to either remove that 
sentence or to clarify it? If so, I'm happy to submit a PR on GitHub.

--
components: Regular Expressions
messages: 334504
nosy: ezio.melotti, mrabarnett, pbugnion
priority: normal
severity: normal
status: open
title: Incomplete documentation for re.sub
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