[issue39382] abstract_issubclass() doesn't take bases tuple item ref

2020-02-15 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Thank you for your report and patch. Agree that the code does not look safe. Do 
you mind to create a pull request?

Would be nice to add a test for it. The three references to the Python class 
are:

* the __dict__ descriptor
* the __weakref__ descriptor
* the __mro__ tuple

You can get rid of the first two by setting __slots__ = () in the class 
definition. But it is not so easy with the __mro__ tuple. I will try more.

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



[issue39646] compile warning in unicodeobject.c

2020-02-15 Thread hai shi


hai shi  added the comment:

I will create PR later.

--

___
Python tracker 

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



[issue39646] compile warning in unicodeobject.c

2020-02-15 Thread hai shi

New submission from hai shi :

Objects/unicodeobject.c: In function ‘PyUnicode_IsIdentifier’:
./Include/cpython/unicodeobject.h:396:38: warning: ‘data’ may be used 
uninitialized in this function [-Wmaybe-uninitialized]
 ((const Py_UCS4 *)(data))[(index)] \
  ^
Objects/unicodeobject.c:12211:11: note: ‘data’ was declared here
 void *data;
   ^
In file included from ./Include/unicodeobject.h:1026:0,
 from ./Include/Python.h:97,
 from Objects/unicodeobject.c:42:
./Include/cpython/unicodeobject.h:391:6: warning: ‘kind’ may be used 
uninitialized in this function [-Wmaybe-uninitialized]
 ((Py_UCS4) \
  ^
Objects/unicodeobject.c:12210:9: note: ‘kind’ was declared here
 int kind;
 ^

--
components: Interpreter Core
messages: 362048
nosy: shihai1991
priority: normal
severity: normal
status: open
title: compile warning in unicodeobject.c
type: compile error
versions: Python 3.9

___
Python tracker 

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



[issue39645] Expand concurrent.futures.Future's public API

2020-02-15 Thread Kyle Stanley


New submission from Kyle Stanley :

Based on the following python-ideas thread: 
https://mail.python.org/archives/list/python-id...@python.org/thread/LMTQ2AI6A7UXEFVHRGHKWD33H24FGM6G/#ICJKHZ4BPIUMOPIT2TDTBIW2EH4CPNCP.

In the above ML thread, the author proposed adding a new cf.SerialExecutor 
class, which seems to be not a great fit for the standard library (based on the 
current state of the discussion, as of writing this). But, Guido mentioned the 
following:

> IOW I'm rather lukewarm about this -- even if you (Jonathan) have found use 
> for it, I'm not sure how many other people would use it, so I doubt it's 
> worth adding it to the stdlib. (The only thing the stdlib might grow could be 
> a public API that makes implementing this feasible without overriding private 
> methods.)

Specifically, the OPs proposal should be reasonably possible to implement 
(either just locally for themselves or a potential PyPI package) with a few 
minor additions to cf.Future's public API:

1) Add a means of *publicly* accessing the future's state (future._state) 
without going through the internal condition's RLock.

This would allow the developer to implement their own condition or other 
synchronization primitive to access the state of the future. IMO, this would 
best be implemented as a separate ``future.state()`` and 
``future.set_state()``. 

2) Add a means of *publicly* accessing the future's result (future._result) 
without going through the internal condition's RLock.

This would be similar to the above, but since there's already a 
``future.result()`` and ``future.set_result()``, I think it would be best 
implemented as an optional *sync* parameter that defaults to True. When set to 
False, it directly accesses future._result without the condition; when set to 
True, it has the current behavior. 

3) Add public global constants for the different possible future states: 
PENDING, RUNNING, CANCELLED, CANCELLED_AND_NOTIFIED, and FINISHED. 

This would be useful to serve as a template of possible future states for 
custom implementations. I also find that ``fut.set_state(cf.RUNNING)`` looks 
better than ``fut.state("running")`` from an API design perspective. 

Optional addition: To make ``fut.state()`` and ``fut.set_state()`` more useful 
for general purposes, it could have a single *sync* boolean parameter (feel 
free to bikeshed over the name), which changes whether it directly accesses 
future._state or does so safely through the condition. Presumably, the 
documentation would explicitly state that with sync=False, the future's state 
will not be synchronized across separate threads or processes. This would also 
allow it to have the same API as ``future.result()`` and 
``future.set_result()``.

Also, as for my own personal motivation in expanding upon the public API for 
cf.Future, I've found that directly accessing the state of the future can be 
incredibly useful for debugging purposes. I made significant use of it while 
implementing the new *cancel_futures* parameter for executor.shutdown(). But, 
since future._state is a private member, there's no guarantee that it will 
continue to behave the same or that it can be relied upon in the long-term. 
This may not be a huge concern for quick debugging sessions, but could easily 
result in breakage when used in logging or unit tests.

--
assignee: aeros
components: Library (Lib)
messages: 362047
nosy: aeros, bquinlan, gvanrossum, pitrou
priority: normal
severity: normal
status: open
title: Expand concurrent.futures.Future's public API
type: enhancement
versions: Python 3.9

___
Python tracker 

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



[issue39644] Add Binary module.

2020-02-15 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

For binary addition and subtraction is it any different from 
https://docs.python.org/3/library/operator.html . Is there a PyPI package that 
implements these ideas to see how useful it already is?

--
nosy: +xtreak

___
Python tracker 

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



[issue39625] Traceback needs more details

2020-02-15 Thread SilentGhost


Change by SilentGhost :


--
components: +Interpreter Core
nosy: +vstinner
versions: +Python 3.9 -Python 3.8

___
Python tracker 

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



[issue39642] Behaviour of disabled widgets: widget.bind(func) -vs- w = widget(command=func)

2020-02-15 Thread SilentGhost


Change by SilentGhost :


--
nosy: +gpolo, serhiy.storchaka

___
Python tracker 

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



[issue39644] Add Binary module.

2020-02-15 Thread SilentGhost


Change by SilentGhost :


--
nosy: +Ananthakrishnan

___
Python tracker 

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



[issue39644] Add Binary module.

2020-02-15 Thread Ananthakrishnan


Change by Ananthakrishnan :


--
nosy: +mark.dickinson, serhiy.storchaka, tim.peters -Ananthakrishnan

___
Python tracker 

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



[issue39644] Add Binary module.

2020-02-15 Thread Ananthakrishnan


New submission from Ananthakrishnan :

Add binary module that has binary operations like:

binary addition.
binary subtracion.
binary multiplication.
binary division.
compliment.
1's complement.
2's complement.
cconverting to various number system.
converting to BCD.
converting to grey code.
K-Map function

and so on..

--
components: C API
messages: 362045
nosy: Ananthakrishnan
priority: normal
severity: normal
status: open
title: Add Binary module.
type: enhancement
versions: Python 3.9

___
Python tracker 

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



[issue39382] abstract_issubclass() doesn't take bases tuple item ref

2020-02-15 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue39643] Python calls newfstatat for "" in inspect

2020-02-15 Thread Ivan Babrou


New submission from Ivan Babrou :

I noticed that a program (SaltStack) is a lot slower under Python 3. After some 
stracing I was able to find that inspect module is to blame.

In strace output I can see a ton of calls like this:

05:31:56.698829 newfstatat(AT_FDCWD, "", 
0x76bc4cf0, 0) = -1 ENOENT (No such file or directory) <0.33>
05:31:56.699743 newfstatat(AT_FDCWD, "", 
0x76bc4b70, 0) = -1 ENOENT (No such file or directory) <0.61>
05:31:56.701328 newfstatat(AT_FDCWD, "", 
0x76bc4cf0, 0) = -1 ENOENT (No such file or directory) <0.37>
05:31:56.702171 newfstatat(AT_FDCWD, "", 
0x76bc4b70, 0) = -1 ENOENT (No such file or directory) <0.31>
05:31:56.703614 newfstatat(AT_FDCWD, "", 
0x76bc4cf0, 0) = -1 ENOENT (No such file or directory) <0.31>
05:31:56.704421 newfstatat(AT_FDCWD, "", 
0x76bc4b70, 0) = -1 ENOENT (No such file or directory) <0.28>
05:31:56.705751 newfstatat(AT_FDCWD, "", 
0x76bc4cf0, 0) = -1 ENOENT (No such file or directory) <0.39>
05:31:56.706691 newfstatat(AT_FDCWD, "", 
0x76bc4b70, 0) = -1 ENOENT (No such file or directory) <0.28>
05:31:56.708148 newfstatat(AT_FDCWD, "", 
0x76bc4cf0, 0) = -1 ENOENT (No such file or directory) <0.32>

This is the entrypoint from Salt:

* 
https://github.com/saltstack/salt/blob/9adc2214c3bb/salt/utils/decorators/__init__.py#L102

Execution with stock code:

$ time sudo salt-call --local test.ping
local:
True

real0m23.481s
user0m22.845s
sys 0m0.649s

Speedup after not calling into inspect.stack():

$ time sudo salt-call --local test.ping
local:
True

real0m3.661s
user0m3.253s
sys 0m0.423s

Stackoverflow suggests that frames with virtual importlib should be skipped:

* https://stackoverflow.com/questions/40945752/inspect-who-imported-me

--
messages: 362044
nosy: Ivan Babrou
priority: normal
severity: normal
status: open
title: Python calls newfstatat for "" in inspect
type: performance
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



[issue39382] abstract_issubclass() doesn't take bases tuple item ref

2020-02-15 Thread hai shi


Change by hai shi :


--
nosy: +nascheme

___
Python tracker 

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



[issue39642] Behaviour of disabled widgets: widget.bind(func) -vs- w = widget(command=func)

2020-02-15 Thread Clinton Hunter


New submission from Clinton Hunter :

Using the bind method, the event will still trigger when the widget is 
disabled.  However, if using "command=" it doesn't.  Wondering whether the 
behaviour between the two ways of setting up event handling should behave the 
same?  Not a major issue, easy enough to work around using an if.

Example:

Clicking the printBtn will still work despite being disabled.

self.printBtn = tkinter.Button(self.frame, text='Print')
self.printBtn['state'] = tkinter.DISABLED
self.printBtn.bind(sequence='', func=self.printBtn_onclick)
self.printBtn.pack()


Clicking on the save button, the event will not trigger (ie the disabled state 
attribute is honored)

self.saveBtn = tkinter.Button(self.frame, text='Save', 
command=self.saveBtn_onclick)
self.saveBtn['state'] = tkinter.DISABLED
self.saveBtn.pack()

--
components: Tkinter
messages: 362043
nosy: mrshr3d
priority: normal
severity: normal
status: open
title: Behaviour of disabled widgets:   widget.bind(func)  -vs-  w = 
widget(command=func)
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



[issue39641] concatenation of Tuples

2020-02-15 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

> The concatenation of two tuples into a third tuple, using the + command, 
> causes an error if every member of each of the two tuples is NOT a string!

Works for me:

py> ("Hello", 1, None) + (23, 19.5, "Goodbye")
('Hello', 1, None, 23, 19.5, 'Goodbye')

If you still think there is a bug here, please follow the advice given here

http://www.sscce.org/

before re-opening this ticket.

--
nosy: +steven.daprano
resolution:  -> works for me
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue17050] argparse.REMAINDER doesn't work as first argument

2020-02-15 Thread dHannasch


dHannasch  added the comment:

Okay. Would it be all right if I submit a fix to get it working at least in the 
subparser case?

--

___
Python tracker 

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



[issue39625] Traceback needs more details

2020-02-15 Thread szb512


szb512  added the comment:

I think it is the "C2" class. Traceback is probably refering to that class.

--
nosy: +sdcards

___
Python tracker 

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



[issue28859] os.path.ismount sometimes raises FileNotFoundError on Windows

2020-02-15 Thread szb512


szb512  added the comment:

I am going to think maybe it was the "os.path.ismount" command that is causing 
the issue. Does the file exist?

--
nosy: +sdcards

___
Python tracker 

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



[issue39641] concatenation of Tuples

2020-02-15 Thread Ammar Askar


Ammar Askar  added the comment:

Are you trying to concatenate a single string? If so keep in mind you need a 
trailing comma:

>>> (1, 2) + (3, 4) + ('a',)
(1, 2, 3, 4, 'a')
>>> (1, 2) + (3, 4) + ('a')
Traceback (most recent call last):
  File "", line 1, in 
TypeError: can only concatenate tuple (not "str") to tuple

--

___
Python tracker 

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



[issue39641] concatenation of Tuples

2020-02-15 Thread Ammar Askar


Change by Ammar Askar :


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

___
Python tracker 

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



[issue39641] concatenation of Tuples

2020-02-15 Thread Ammar Askar


Ammar Askar  added the comment:

tuple + tuple is NOT tuple concatenation. It adds each individual member of the 
tuple. So for example

(a, b) + (c, d)

results in

(a + c, b + d)

--
nosy: +ammar2

___
Python tracker 

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



[issue39641] concatenation of Tuples

2020-02-15 Thread bruce blosser


New submission from bruce blosser :

The concatenation of two tuples into a third tuple, using the + command, causes 
an error if every member of each of the two tuples is NOT a string!  This does 
not appear to be documented ANYWHERE, and really causes a whole lot of head 
scratching and more than enough foul language!  :)

So how does one "add" two tuples together, to create a third tuple, if the 
members are not all strings?

--
messages: 362036
nosy: bruceblosser
priority: normal
severity: normal
status: open
title: concatenation of Tuples
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



[issue12915] Add inspect.locate and inspect.resolve

2020-02-15 Thread Vinay Sajip


Change by Vinay Sajip :


--
pull_requests: +17895
pull_request: https://github.com/python/cpython/pull/18517

___
Python tracker 

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



[issue39633] venv does not include python. symlink by default

2020-02-15 Thread Lysandros Nikolaou


Lysandros Nikolaou  added the comment:

That's right. I'll do that then. Thanks for baring with me.

Should we update the docs to mentiom this or just close this issue?

On Sat, Feb 15, 2020, 22:33 Vinay Sajip  wrote:

>
> Vinay Sajip  added the comment:
>
> In general, people should be working in venvs. That means that libraries
> should assume they are being installed into venvs. Therefore makefiles
> should be invoking plain "python" rather than "pythonX.Y", as they can
> never be sure which exact interpreter they're running under (you might have
> a newer one than the one in the Makefile - that shouldn't fail). Why not
> raise this as an issue with these projects?
>
> --
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue39573] Make PyObject an opaque structure in the limited C API

2020-02-15 Thread Andy Lester


Andy Lester  added the comment:

I'm hoping that a goal here is to make

static inline int _Py_IS_TYPE(PyObject *ob, PyTypeObject *type)

actually be

static inline int _Py_IS_TYPE(const PyObject *ob, const PyTypeObject *type)

--

___
Python tracker 

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



[issue39573] Make PyObject an opaque structure in the limited C API

2020-02-15 Thread Andy Lester


Andy Lester  added the comment:

@vstinner would it be helpful if I went on a sweep looking for places we can 
use the new Py_IS_TYPE macro?

Getting away from Py_TYPE(op) would also mean a move to making the internals 
const-correct.

--
nosy: +petdance

___
Python tracker 

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



[issue39633] venv does not include python. symlink by default

2020-02-15 Thread Vinay Sajip


Vinay Sajip  added the comment:

In general, people should be working in venvs. That means that libraries should 
assume they are being installed into venvs. Therefore makefiles should be 
invoking plain "python" rather than "pythonX.Y", as they can never be sure 
which exact interpreter they're running under (you might have a newer one than 
the one in the Makefile - that shouldn't fail). Why not raise this as an issue 
with these projects?

--

___
Python tracker 

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



[issue39090] Document various options for getting the absolute path from pathlib.Path objects

2020-02-15 Thread Vedran Čačić

Vedran Čačić  added the comment:

If we want something mnemonic, I'm sure nothing beats __abs__. (Hey, we have 
__truediv__ already!;)

--
nosy: +veky

___
Python tracker 

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



[issue31116] base85 z85 variant encoding

2020-02-15 Thread SilentGhost


Change by SilentGhost :


--
nosy: +pitrou
versions: +Python 3.9 -Python 3.7

___
Python tracker 

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



[issue39640] fall back os.fdatasync() to fsync() on POSIX systems without fdatasync() support

2020-02-15 Thread George Melikov


George Melikov  added the comment:

I want to add that it's a usual practice:
- 
https://github.com/libuv/libuv/pull/1580/files/bdd987a9b4347164e31e22d2d5ce06fbb5ebc859
- 
https://rev.ng/gitlab/revng/qemu/commit/6f1953c4c14566d3303709869fd26201828b3ccf

--

___
Python tracker 

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



[issue39640] fall back os.fdatasync() to fsync() on POSIX systems without fdatasync() support

2020-02-15 Thread George Melikov


George Melikov  added the comment:

If there is a way not to sync data - you should use neither fdatasync nor fsync.

So IMHO if someone wants to sync data and want to use fdatasync - I see the 
only way on MacOS is to use fsync().

> Note also that this change will not help to run code with fdatasync() on 
> MacOS without fallbacks in Python code until you drop support of all Python 
> versions older than 3.9.

I agree, but I propose to make this change in 3.9 to get it somewhere in future.

--

___
Python tracker 

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



[issue39640] fall back os.fdatasync() to fsync() on POSIX systems without fdatasync() support

2020-02-15 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

fsync() may be slower than fdatasync(). There may be cases in which you prefer 
to not call fsync() or call it less often if POSIX fdatasync() is not 
available. To do this you should know whether Python fdatasync() calls POSIX 
fdatasync() or fsync(). The simplest way to provide this information to user is 
to not provide os.fdatasync() in the underlying system call is not available.

Note also that this change will not help to run code with fdatasync() on MacOS 
without fallbacks in Python code until you drop support of all Python versions 
older than 3.9.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue31116] base85 z85 variant encoding

2020-02-15 Thread Derek Wilson


Derek Wilson  added the comment:

z85 avoids all of:

` \ " ' _ , ;

Backtick and semicolon increase the number of places that z85 can be used
without issue over b85. All of these might not be as big an issue in python
as in other tools/languages but interoperability would still be improved
through the addition of z85.

- Derek

On Fri, Feb 14, 2020, 09:18 Dobatymo  wrote:

>
> Dobatymo  added the comment:
>
> base64.b85encode does not use ", ' or \ as well.
>
> That's the _b85alphabet
>
> _b85alphabet = (b"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"
> b"abcdefghijklmnopqrstuvwxyz!#$%&()*+-;<=>?@^_`{|}~")
>
> --
> nosy: +Dobatymo
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue39640] fall back os.fdatasync() to fsync() on POSIX systems without fdatasync() support

2020-02-15 Thread George Melikov


Change by George Melikov :


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

___
Python tracker 

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



[issue39640] fall back os.fdatasync() to fsync() on POSIX systems without fdatasync() support

2020-02-15 Thread George Melikov


New submission from George Melikov :

POSIX fdatasync() is similar to fsync() but it tries not to sync non-needed 
metadata. If POSIX OS doesn't have it - it's safe to use fsync() (If we need to 
sync data to disk - we have to use one of these functions).

This change will help to run code with fdatasync() on MacOS without fallbacks 
in Python code.

I'll propose a PR soon.

--
components: IO
messages: 362025
nosy: gmelikov
priority: normal
severity: normal
status: open
title: fall back os.fdatasync() to fsync() on POSIX systems without fdatasync() 
support

___
Python tracker 

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



[issue39633] venv does not include python. symlink by default

2020-02-15 Thread Lysandros Nikolaou


Lysandros Nikolaou  added the comment:

You're right! That could be very confusing. But isn't this risk already there, 
since this could happen if one runs `python3.8 -m venv venv` and then 
`python3.7` with the venv activated?

--

___
Python tracker 

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



[issue39638] Keep ASDL signatures for AST nodes

2020-02-15 Thread Batuhan Taskaya


Change by Batuhan Taskaya :


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

___
Python tracker 

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



[issue12915] Add inspect.locate and inspect.resolve

2020-02-15 Thread Vinay Sajip


Vinay Sajip  added the comment:

To be more precise, one could use

^(?!\d)(\w+)(\.(?!\d)(\w+))* for _DOTTED_WORDS and use the re.U flag when 
compiling the pattern. That should match any packages where segments start with 
a letter and continue with alphanumerics. Do you agree?

--

___
Python tracker 

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



[issue12915] Add inspect.locate and inspect.resolve

2020-02-15 Thread Vinay Sajip


Vinay Sajip  added the comment:

> The regex looks too strict. Python 3 accepts non-ASCII module names.

Would adding the re.U flag be enough, or are you thinking of other 
possibilities?

--

___
Python tracker 

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



[issue39633] venv does not include python. symlink by default

2020-02-15 Thread Vinay Sajip


Vinay Sajip  added the comment:

Except that if there's a global other pythonX.Y of the different version, that 
would get run ... potentially even more confusing.

--

___
Python tracker 

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



[issue4080] unittest: display time used by each test case

2020-02-15 Thread Giampaolo Rodola'


Change by Giampaolo Rodola' :


--
versions: +Python 3.9 -Python 3.8

___
Python tracker 

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



[issue39636] Can't change Treeview row color in Tkinter

2020-02-15 Thread Олег Париев

Олег Париев  added the comment:

I noticed that the background does not change, but the foreground changes well

--

___
Python tracker 

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



[issue39635] One paragraph of the doc is not translated in French

2020-02-15 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

Translation related issues are tracked under separate GitHub repo. Please 
report at https://github.com/python/python-docs-fr

--
nosy: +mdk, xtreak

___
Python tracker 

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



[issue39639] Remove Suite node from AST

2020-02-15 Thread hai shi


hai shi  added the comment:

I am not sure there have any relation with jython's python.asdl?

https://github.com/jythontools/jython/blob/master/ast/Python.asdl#L10

--
nosy: +shihai1991

___
Python tracker 

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



[issue39637] Probably incorrect message after failed import

2020-02-15 Thread Rick van Rein


Change by Rick van Rein :


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



[issue39637] Probably incorrect message after failed import

2020-02-15 Thread Rick van Rein


Rick van Rein  added the comment:

Thanks for explaining.  It is indeed confusing, even though I'm quite 
experienced with Python.

--

___
Python tracker 

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



[issue34822] Simplify AST for slices

2020-02-15 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Updated the PR.

I can obviously be biased about my changes, so I need an approval of other core 
developer to merge them.

I created several PRs to popular third-party projects which work with AST to 
support both old and new AST schemes.

--
versions: +Python 3.9 -Python 3.8

___
Python tracker 

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



[issue32892] Remove specific constant AST types in favor of ast.Constant

2020-02-15 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
pull_requests: +17891
pull_request: https://github.com/python/cpython/pull/18514

___
Python tracker 

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



[issue39639] Remove Suite node from AST

2020-02-15 Thread Batuhan Taskaya


Change by Batuhan Taskaya :


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

___
Python tracker 

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



[issue39637] Probably incorrect message after failed import

2020-02-15 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

> Shouldn't that say that "'environ' is not a package" instead?

No. The os module is special, so I'll talk about the usual case first.

Normally, for `import spam.eggs` to succeed, *spam* has to be a package, and 
*eggs* has to be either a sub-module inside that package, or a sub-package. So 
the general error message is correct. You can't normally use the dotted import 
syntax to import functions from a module.

But the `os` module is special: it is very old, pre-dating the invention of 
packages, and the `os` module fakes a pretend package for `os.path` by doing 
this:

sys.modules['os.path'] = path


So even though `os` is not a package, you can still use dotted package syntax 
to import `os.path`.

I guess this was intended as a convenience, without considering how this could 
be confusing.

--
nosy: +steven.daprano

___
Python tracker 

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



[issue39639] Remove Suite node from AST

2020-02-15 Thread Batuhan Taskaya


Change by Batuhan Taskaya :


--
priority: normal -> low
title: Remote Suite node from AST -> Remove Suite node from AST

___
Python tracker 

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



[issue39639] Remote Suite node from AST

2020-02-15 Thread Batuhan Taskaya


New submission from Batuhan Taskaya :

AST is containing a node from past that is explained as "not really an actual 
node but useful in Jython's typesystem.". There is no usage of it anywhere in 
the CPython repo, just some code in ast_optimizer, symbol table and compiler to 
forbid it from running. If there is not any specific reason to keep it, we can 
just remove and clean some code.

--
components: Library (Lib)
messages: 362014
nosy: BTaskaya, benjamin.peterson, brett.cannon, pablogsal, yselivanov
priority: normal
severity: normal
status: open
title: Remote Suite node from AST
versions: Python 3.9

___
Python tracker 

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



[issue39537] Change line number table format

2020-02-15 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Every bytecode is generated from some AST node which has an associated range of 
lines. So there should not be bytecodes that have no line number.

If for some reasons you generate bytecodes that have no line number, you can 
just set lineno > end_lineno for them.

--

___
Python tracker 

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



[issue39638] Keep ASDL signatures for AST nodes

2020-02-15 Thread Batuhan Taskaya


New submission from Batuhan Taskaya :

It would be super convenient to keep ASDL declarations in AST nodes. There are 
multiple benefits of it;

1 -> When debugging or playing with the AST, time to time you may require to 
know what kind of things a field gets or is that field an optional one. 

2 -> The AST nodes are pretty limited on what can they do by default. For 
extending their scope, 3rd party tools often copy python's ASDL to their source 
and build custom AST nodes from that. And with knowing what every field gets 
they can automatically generate autotransformer codes from that ASDL spec which 
takes python's standard AST and convert it to their own AST nodes. 

We can either create a new attribute or keep this in the docstring. I think 
keeping this in the docstring can at least give some info about the node rather 
than None so it makes more sense to me. If the feature wanted, I can propose a 
PR.

--
components: Library (Lib)
messages: 362012
nosy: BTaskaya, benjamin.peterson, pablogsal
priority: low
severity: normal
status: open
title: Keep ASDL signatures for AST nodes
type: enhancement
versions: Python 3.9

___
Python tracker 

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



[issue39637] Probably incorrect message after failed import

2020-02-15 Thread Rick van Rein


New submission from Rick van Rein :

The following error message surprises me:

>>> import os.environ
Traceback (most recent call last):
  File "", line 1, in 
ModuleNotFoundError: No module named 'os.environ'; 'os' is not a package

Shouldn't that say that "'environ' is not a package" instead?

After all, 'os' will support

>>> import os.path
>>> 

This is confusing :)

--
components: Interpreter Core
messages: 362011
nosy: vanrein
priority: normal
severity: normal
status: open
title: Probably incorrect message after failed import
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



[issue39636] Can't change Treeview row color in Tkinter

2020-02-15 Thread Олег Париев

New submission from Олег Париев :

Good afternoon! Cannot change the color of a Treeview string in Python version 
3.8.x. The same problem would be in Python version 3.7.3, but a solution for it 
does not help. You can see the question by reference: 
https://bugs.python.org/issue36468

PS Sorry for the clumsy English

--
components: Tkinter
messages: 362010
nosy: gpolo, serhiy.storchaka, Олег Париев
priority: normal
severity: normal
status: open
title: Can't change Treeview row color in Tkinter
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



[issue39635] One paragraph of the doc is not translated in French

2020-02-15 Thread Frédéric Danna

New submission from Frédéric Danna :

In the French doc of the 3.8 version, 
https://docs.python.org/fr/3/tutorial/interpreter.html, there is an entire 
parapragph which is still writtent in Englush (not translated in French):
> On Windows machines where you have installed Python from the
> Microsoft Store, the python3.8 command will be available. If you have
> the py.exe launcher installed, you can use the py command. See
> Digression : Définition des variables d'environnement for other ways
> to launch Python.
```
(See the screenshot attached.)

--
assignee: docs@python
components: Documentation
files: ksnip_20200215-115221.png
messages: 362009
nosy: Frédéric Danna, docs@python
priority: normal
severity: normal
status: open
title: One paragraph of the doc is not translated in French
versions: Python 3.8
Added file: https://bugs.python.org/file48897/ksnip_20200215-115221.png

___
Python tracker 

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



[issue20184] Derby #16: Convert 50 sites to Argument Clinic across 9 files

2020-02-15 Thread hai shi


hai shi  added the comment:

Looks like `builtins.vars` and `builtins.dir` should be migrated to AC too, so 
I create PR18512.

--
nosy: +shihai1991

___
Python tracker 

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



[issue20184] Derby #16: Convert 50 sites to Argument Clinic across 9 files

2020-02-15 Thread hai shi


Change by hai shi :


--
pull_requests: +17889
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/18512

___
Python tracker 

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



[issue12915] Add inspect.locate and inspect.resolve

2020-02-15 Thread STINNER Victor


STINNER Victor  added the comment:

The regex looks too strict. Python 3 accepts non-ASCII module names.

Should existing functions be modified to reuse the new function?

--
nosy: +vstinner

___
Python tracker 

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