[issue36144] Dictionary union. (PEP 584)

2020-03-28 Thread Guido van Rossum


Guido van Rossum  added the comment:

I'm guessing this can be closed?

--
stage: resolved -> patch review

___
Python tracker 

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



[issue40099] modify code format of json library for pep7,8

2020-03-28 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Sorry, we usually don't accept these kinds of changes.  Minor pep 7 and 8 
updates cause code churn, aren't substantive, and are sometimes upto the 
judgment of the original implementer (for example, whether to add blank lines 
or whether to put parentheses around an expression.  We usually make little 
improvements while actually doing substantive work on a module.

Please do continue to contribute and aim your efforts towards fixing real bugs 
or implementing feature requests.

--
nosy: +rhettinger
resolution:  -> rejected
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue40099] modify code format of json library for pep7,8

2020-03-28 Thread Karthikeyan Singaravelan


New submission from Karthikeyan Singaravelan :

PEP 8 changes and cosmetic changes PR are discouraged since they will make git 
history less useful.

--
nosy: +xtreak

___
Python tracker 

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



[issue40018] test_ssl fails with OpenSSL 1.1.1e

2020-03-28 Thread Benjamin Peterson


Change by Benjamin Peterson :


--
resolution:  -> wont fix
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



[issue40099] modify code format of json library for pep7,8

2020-03-28 Thread gaoxinge


Change by gaoxinge :


--
components: Library (Lib)
nosy: gaoxinge
priority: normal
pull_requests: 18575
severity: normal
status: open
title: modify code format of json library for pep7,8
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



[issue40077] Convert static types to PyType_FromSpec()

2020-03-28 Thread Dong-hee Na


Dong-hee Na  added the comment:

> Can you try to measure the _abc._abc_instancecheck() and 
> _abc._abc_subclasscheck()

I 've submitted the benchmark :)

--

___
Python tracker 

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



[issue40077] Convert static types to PyType_FromSpec()

2020-03-28 Thread Dong-hee Na


Change by Dong-hee Na :


Added file: https://bugs.python.org/file49008/bench_subclass_check.py

___
Python tracker 

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



[issue40077] Convert static types to PyType_FromSpec()

2020-03-28 Thread Dong-hee Na


Change by Dong-hee Na :


Added file: https://bugs.python.org/file49007/bench_isinstance_check.py

___
Python tracker 

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



[issue40077] Convert static types to PyType_FromSpec()

2020-03-28 Thread Dong-hee Na


Dong-hee Na  added the comment:

It shown 1% slower for performance.

+--+-++
| Benchmark| master-subclass | bpo-40077-subclass |
+==+=++
| bench _abc_subclasscheck | 295 ns  | 300 ns: 1.01x slower (+1%) |
+--+-++

+--+---++
| Benchmark| master-isinstance | bpo-40077-isinstance   |
+==+===++
| bench _abc_instancecheck | 229 ns| 232 ns: 1.01x slower (+1%) |
+--+---++

--

___
Python tracker 

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



[issue40088] list.reverse(): slow sublist reverse

2020-03-28 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Thanks for the suggestion, but the need isn't common enough to warrant an API 
expansion.  If this were a popular operation, it might be worth optimizing, the 
need almost never arises.

--
resolution:  -> rejected
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue39982] FreeBSD: SCTP tests of test_socket fails on AMD64 FreeBSD Shared 3.x

2020-03-28 Thread Kubilay Kocak


Kubilay Kocak  added the comment:

koobs-freebsd-564d (CURRENT) BB has been updated past 
https://svnweb.freebsd.org/base?view=revision=359302

test_socket is no longer failing

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

___
Python tracker 

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



[issue39780] Add HTTP Response code 103

2020-03-28 Thread Dong-hee Na


Change by Dong-hee Na :


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



[issue32692] [3.6] test_threading.test_set_and_clear fails in AppVeyor CI

2020-03-28 Thread Kubilay Kocak


Kubilay Kocak  added the comment:

Seeing the following on the freebsd CURRENT bb:

==
FAIL: test_set_and_clear (test.test_threading.EventTests)
--
Traceback (most recent call last):
  File 
"/usr/home/buildbot/python/3.8.koobs-freebsd-9e36.nondebug/build/Lib/test/lock_tests.py",
 line 418, in test_set_and_clear
self.assertEqual(results, [True] * N)
AssertionError: Lists differ: [False, False, False, True, True] != [True, True, 
True, True, True]
First differing element 0:
False
True
- [False, False, False, True, True]
+ [True, True, True, True, True]
--
Ran 168 tests in 29.254s
FAILED (failures=1)
test test_threading failed

Full log attached

--
nosy: +koobs
Added file: 
https://bugs.python.org/file49006/freebsd-current-non-debug-3.8-build-176.txt

___
Python tracker 

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



[issue40090] The referenced RFC for the json module should be corrected to rfc8259

2020-03-28 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

The header for 8259 says "Obsoletes: 7159" (December 2017) and the header for 
7159 agrees: "Obsoleted by: 8259".  But... to the extent that there is any 
difference, which document better describes the behavior of our json module?  
Does it need to be updated along with a doc change?

--
nosy: +ezio.melotti, rhettinger, terry.reedy

___
Python tracker 

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



[issue40088] list.reverse(): slow sublist reverse

2020-03-28 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

The previous issue was also about .sort and Raymond's rejection was mostly 
about .sort.  I will let him comment about whether the speedup moves him at all.

Yury, please say something about your use case.

--
nosy: +terry.reedy

___
Python tracker 

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



[issue40087] How to Uninstall Python3.7.3 using cmd?

2020-03-28 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

This tracker is for improving future releases of CPython.  Questions about 
using current python should be directed elsewhere, such as python-list.  You 
already did that and got Windows-specific answers.

--
nosy: +terry.reedy
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



[issue40075] _tkinter PythonCmd fails to acquire GIL

2020-03-28 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue40056] more user-friendly turtledemo

2020-03-28 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Enhancements are not usually backported.

1. The underscores are in entries such as 'minimal_hanoi' in the Examples 
drop-down submenu.  Changing to spaces should not hurt anything.

2. Already possible (maybe): Help => Turtledemo help has
  (2) How to add your own demos to the demo repository
which discusses requirements for turtle code run in the demo framework.   
(However, users may not be able to add files to the turtledemo directory -- 
Demo/turtle in 2.x, Lib/turtledemo in 3.x.)  Any alternative should direct 
users to these requirements.

What is your proposed alternative mechanism?  Why is it better than a user 
copying __main__.py and turtle.cfg into their own directory of turtle scripts?  
(Perhaps this option should also be mentioned as
  (3) How to add turtledemo to your directory.)

--
nosy: +terry.reedy
versions:  -Python 3.6, Python 3.7, Python 3.8

___
Python tracker 

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



[issue40097] Queue.Empty issue - Python3.8

2020-03-28 Thread Guy Kogan


Guy Kogan  added the comment:

Thanks Tim Peters and Raymond Hettinger, the issue has been resolved.

Have a nice day!

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



[issue40051] Dead link in help(lib2to3/idlelib/turtledemo/tkinter.sub/test_*/?)

2020-03-28 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Lib/lib2to3 is a directory with __init__.py containing
   ### empty
Unlike most python-coded modules, there is no Doc/library/lib2to3.rst and hence 
no generated lib2to3.html.  Instead, there is a 2to3.rst and 2to3.html.  In the 
module index, module xyz is usually linked to .../library/xyz.html#module-xyz.  
But lib2to3 is somewhere linked instead to .../library/2to3.html#module-lib2to3.

As implied by the changed title, this issue is not at all unique to lib2to3.  
Just as lib2to3 implements the command line app 2to3, with 2to3.rst, idlelib 
implements IDLE with idle.rst.  Turtle demo is domumented within turtle.rst.  
Most tkinter submodule have no doc other than a mention within tkinter.rst.  
These could perhaps have a # module-tkinter.xyz target added.  (I am not 
familiar with exactly how.)   But there are also the numerous test modules that 
have no doc, and the generated doc for these is less useful than the code 
itself.  

Possible solutions framed in terms of lib2to3:

1. Manual redirection: add lib2to3.rst and hence lib2to3.html with the correct 
url, possibly with additional text.  But this is not the only module documented 
within a file with another name, and would not work for things like test files 
that should not be documented.

2. Auto redirection: persuade whoever manages docs.python.org to add
a redirection for lib2to3.  Fragile.

3. Hardcode the exception in the help output generation.  The latter is 
generated by pydoc.help.  The module doc location under MODULE REFERENCE is 
generated by pydoc.Doc.getdocloc.  This function already has a couple of 
(probably obsolete) tuples of exceptions, so adding more seems OK.

The oddity is that .html is added if and only if the doc location does not 
start with 'http'.  lines 414-417.I think that this is backwards. It only works 
because docs.python.org adds missing .html, even to 
"https://docs.python.org/3.8/library/2to3#module-lib2to3;, which is why the 
bug? has not been noticed.  Note that by default, docloc starts with 
'https://', so by default, .html is omitted.

Skip, David, and Martin, you have all modified this part of the code.  Do any 
of you disagree that there is a bug?

--
components:  -2to3 (2.x to 3.x conversion tool)
nosy: +martin.panter, r.david.murray, skip.montanaro, terry.reedy
stage:  -> needs patch
title: Dead link in help(lib2to3) -> Dead link in 
help(lib2to3/idlelib/turtledemo/tkinter.sub/test_*/?)
type: performance -> behavior
versions: +Python 3.7, Python 3.9

___
Python tracker 

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



[issue40097] Queue.Empty issue - Python3.8

2020-03-28 Thread Tim Peters


Tim Peters  added the comment:

> ... so the _intended_ "queue.Queue" still works.

Oops.  Of course that should have said:

> ... so the _intended_ "queue.Empty" still works.

--

___
Python tracker 

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



[issue40097] Queue.Empty issue - Python3.8

2020-03-28 Thread Tim Peters


Tim Peters  added the comment:

Raymond is talking about the cause of this error in what you showed:

AttributeError: 'Queue' object has no attribute 'Empty'

The exception you're _trying_ to catch is "queue.Empty", where "queue" is the 
queue _module_.  But you rebound the name "queue" to an instance of the 
queue.Queue class.  As the AttributeError message says, an instance of that 
class has no "Empty" attribute.

You need to change this line:

  queue = queue.Queue()

Pick a different name, so the _intended_ "queue.Queue" still works.

--
nosy: +tim.peters

___
Python tracker 

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



[issue40097] Queue.Empty issue - Python3.8

2020-03-28 Thread Guy Kogan


Guy Kogan  added the comment:

I still dont understand what do you mean? 

Can you please elaborate?

--

___
Python tracker 

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



[issue40095] Incorrect st_ino returned for ReFS on Windows 10

2020-03-28 Thread Martynas Brijunas


Martynas Brijunas  added the comment:

Hi Steve, Eryk,

thank you very much for looking into this. I was looking into "st_ino"
as a potential substitute of a full path of a file when it comes to
uniquely identifying that file in a database.

> ReFS uses a 128-bit file ID, which I gather consists of a 64-bit directory ID 
> and a 64-bit relative ID. (Take this with a grain of salt. AFAIK, Microsoft 
> hasn't published a spec for ReFS.) The latter is 0 for the directory itself 
> and increments by 1 for each file created in the directory, with no reuse of 
> previous values if a file is deleted or moved. If that's correct, and if 
> "test.jpg" was created in "\test", then the directory ID of "\test" is 
> 0x29d5, and the relative file ID is 0x4ae.

This assumption seems to be correct. All files within the same
directory have identical first half of their ID, as reported by
"fsutil".

U:\test>fsutil file queryfileid test.jpg
File ID is 0x29d504ae

U:\test>fsutil file queryfileid test.nef
File ID is 0x29d50483

U:\test>fsutil file queryfileid test.ARW
File ID is 0x29d50484

U:\test>fsutil file queryfileid test.db
File ID is 0x29d50495

>
> > >>> from pathlib import Path
> > >>> hex(Path('U:/test/test.jpg').stat().st_ino)
> > '0x44ae29d5'
>
> os.stat calls WINAPI GetFileInformationByHandle, which returns a 64-bit file 
> ID. It appears that ReFS generates this ID by concatenating the relative ID 
> and directory ID in a way that is "not guaranteed to be unique" according to 
> the BY_HANDLE_FILE_INFORMATION [1] docs.

The feedack from "st_ino" appears to be in total sync with "fsutil".
The only real difference (apart for the for the missing leading zeros
in each half) is the inclusion of a hex "4" at the very beginning of
the hex sequence. But even that is consistent as the "4" is present in
all cases.

>>> hex(Path('U:/test/test.jpg').stat().st_ino)
'0x44ae29d5'
>>> hex(Path('U:/test/test.nef').stat().st_ino)
'0x448329d5'
>>> hex(Path('U:/test/test.arw').stat().st_ino)
'0x448429d5'
>>> hex(Path('U:/test/test.db').stat().st_ino)
'0x449529d5'

--

___
Python tracker 

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



[issue40098] dir() does not return the list of valid attributes for the object

2020-03-28 Thread Serhiy Storchaka


New submission from Serhiy Storchaka :

Due to the difference in the code of __getattr__ and __dir__ for object and 
type dir() does not return the list of valid attributes for the object. It can 
return a name which is not a valid attribute and miss a name of the valid 
attribute.

1. It does not support metaclasses.

class M(type):
x = 1

class A(metaclass=M):
pass

assert hasattr(A, 'x')
assert 'x' not in dir(A)

2. It does not use __mro__, but uses __bases__ recursively.

class M(type):
def mro(cls):
if cls.__name__ == 'A':
return cls, B
return cls,

class B(metaclass=M):
x = 1

class A(metaclass=M):
pass

assert hasattr(A, 'x')
assert 'x' not in dir(A)

3. It uses the __dict__ attribute instead of the instance dict (they can be 
different).

class A:
@property
def __dict__(self):
return {'x': 1}

assert not hasattr(A(), 'x')
assert 'x' in dir(A())

4. It uses the __class__ attribute instead of type().

class B:
y = 2

class A:
x = 1
@property
def __class__(self):
return B

assert hasattr(A, 'x')
assert not hasattr(A, 'y')
assert hasattr(A(), 'x')
assert not hasattr(A(), 'y')
assert 'x' in dir(A)
assert 'y' not in dir(A)
assert 'x' not in dir(A())
assert 'y' in dir(A())

4.1. As a side effect dir() creates an instance dictionary if it was not 
initialized yet (for memory saving).

It is possible to make these implementations of __dir__() returning exactly 
what the corresponding __getattr__() accepts, not more and not less. The code 
will even be much simpler. But is it what we want?

--
components: Interpreter Core
messages: 365227
nosy: gvanrossum, serhiy.storchaka, tim.peters
priority: normal
severity: normal
status: open
title: dir() does not return the list of valid attributes for the object
type: behavior

___
Python tracker 

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



[issue40097] Queue.Empty issue - Python3.8

2020-03-28 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

There's an error in your code:

import queue  # loads the standard library queue module

...

queue = queue.Queue() # reassign queue to an instance of Queue

...

except queue.Empty:   # expects "queue" the module, not the instance

--
nosy: +rhettinger

___
Python tracker 

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



[issue40097] Queue.Empty issue - Python3.8

2020-03-28 Thread Guy Kogan


New submission from Guy Kogan :

Python 3.8 Queue module is unable to handle the expection: 

error: 

Exception in thread Thread-5:
Traceback (most recent call last):
  File "FTP_multithreading.py", line 17, in run
new_connection = self.queue.get(timeout=2)
  File "/usr/local/lib/python3.8/queue.py", line 178, in get
raise Empty
_queue.Empty

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/threading.py", line 932, in _bootstrap_inner
self.run()
  File "FTP_multithreading.py", line 18, in run
except queue.Empty:
AttributeError: 'Queue' object has no attribute 'Empty'
b'220 ns.iren.ru FTP server (Version wu-2.6.2(1) Fri Sep 12 08:50:43 IRKST 
2008) ready.\r\n'
Exception in thread Thread-4:
Traceback (most recent call last):
  File "FTP_multithreading.py", line 17, in run
new_connection = self.queue.get(timeout=2)
  File "/usr/local/lib/python3.8/queue.py", line 178, in get
raise Empty
_queue.Empty


When the Last task is done the exception queue.Empty should occur while 
handling the exception another exception is occurred.

--
files: FTP_Code_queue.py
messages: 365225
nosy: Python_dev_IL
priority: normal
severity: normal
status: open
title: Queue.Empty issue - Python3.8
type: crash
versions: Python 3.8
Added file: https://bugs.python.org/file49005/FTP_Code_queue.py

___
Python tracker 

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



[issue23574] datetime: support leap seconds

2020-03-28 Thread Maximilian Nöthe

Maximilian Nöthe  added the comment:

Could this be revisited?

Especially now that datetime supports `fromisoformat`, as there are valid 
ISO8601 timestamps in UTC out there, that contain the leap seconds, e.g. files 
describing when those occured or will occur.

E.g. the NTP Leap second file:
https://kb.meinbergglobal.com/kb/time_sync/ntp/configuration/ntp_leap_second_file

This get's synced on linux to `/usr/share/zoneinfo/leapseconds` and could even 
be used by python to lookup when leap seconds occured.

The datetime also gained a fold argument, which if it is not wanted to support 
second values of 60 to at least be able to parse those.

The 60th second of a minute is a reality with our current civil time keeping, 
so python should be able to handle it.

--
nosy: +maxnoe

___
Python tracker 

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



[issue15987] Provide a way to compare AST nodes for equality recursively

2020-03-28 Thread Batuhan Taskaya


Change by Batuhan Taskaya :


--
pull_requests: +18574
pull_request: https://github.com/python/cpython/pull/19211

___
Python tracker 

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



[issue39943] Meta: Clean up various issues in C internals

2020-03-28 Thread Andy Lester


Change by Andy Lester :


--
pull_requests: +18573
pull_request: https://github.com/python/cpython/pull/19210

___
Python tracker 

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



[issue39943] Meta: Clean up various issues in C internals

2020-03-28 Thread Andy Lester


Change by Andy Lester :


--
pull_requests: +18572
pull_request: https://github.com/python/cpython/pull/19209

___
Python tracker 

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



[issue40094] Add os.status_to_exitcode() function

2020-03-28 Thread STINNER Victor


STINNER Victor  added the comment:

Hum, I changed my mind and I think that it's worth it to make the function 
public. Moreover, I prefer "exitcode", since it is closer to "WEXITSTATUS" name 
than "returncode". So I renamed the function os.status_to_exitcode().

Advantages of the new new function compared to exiting code:

* the function guarantee that result >= 0 means that the process exited and 
result < 0 means that the process exited due to a signal (was killed by a 
signal)
* the function raises a well defined exception (ValueError) if the WIFSTOPPED() 
is true or if the status is unknown: it prevents to misuse WIFSTOPPED()

--
title: Add os._wait_status_to_returncode() helper function -> Add 
os.status_to_exitcode() function

___
Python tracker 

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



[issue38002] 'ModifiedInterpreter' object has no attribute 'interp'

2020-03-28 Thread miss-islington


miss-islington  added the comment:


New changeset cb758011ce39678fb03e8ac3e924d9084252e1ad by Miss Islington (bot) 
in branch '3.7':
bpo-38002: Use False/True for IDLE pyshell bools (GH-19203)
https://github.com/python/cpython/commit/cb758011ce39678fb03e8ac3e924d9084252e1ad


--

___
Python tracker 

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



[issue38002] 'ModifiedInterpreter' object has no attribute 'interp'

2020-03-28 Thread miss-islington


miss-islington  added the comment:


New changeset 8c3ab189ae552401581ecf0b260a96d80dcdae28 by Miss Islington (bot) 
in branch '3.8':
bpo-38002: Use False/True for IDLE pyshell bools (GH-19203)
https://github.com/python/cpython/commit/8c3ab189ae552401581ecf0b260a96d80dcdae28


--

___
Python tracker 

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



[issue40077] Convert static types to PyType_FromSpec()

2020-03-28 Thread STINNER Victor


STINNER Victor  added the comment:

> Should we stop the work until the overhead is measured?

Can you try to measure the _abc._abc_instancecheck() and 
_abc._abc_subclasscheck() functions performance before/after your change? 
Functions like register() are rarely call, so I don't care much of their 
performance (I expect a small overhead or no overhead).

--

___
Python tracker 

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



[issue38002] 'ModifiedInterpreter' object has no attribute 'interp'

2020-03-28 Thread miss-islington


Change by miss-islington :


--
pull_requests: +18571
pull_request: https://github.com/python/cpython/pull/19208

___
Python tracker 

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



[issue38002] 'ModifiedInterpreter' object has no attribute 'interp'

2020-03-28 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 2.0 -> 3.0
pull_requests: +18570
pull_request: https://github.com/python/cpython/pull/19207

___
Python tracker 

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



[issue38002] 'ModifiedInterpreter' object has no attribute 'interp'

2020-03-28 Thread Terry J. Reedy


Terry J. Reedy  added the comment:


New changeset 34a49aa3e4d023b5f9e9029f4f1ec68f1a8a8120 by Terry Jan Reedy in 
branch 'master':
bpo-38002: Use False/True for IDLE pyshell bools (GH-19203)
https://github.com/python/cpython/commit/34a49aa3e4d023b5f9e9029f4f1ec68f1a8a8120


--

___
Python tracker 

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



[issue33129] Add kwarg-only option to dataclass

2020-03-28 Thread Michael Lee


Michael Lee  added the comment:

Hello! I've submitted a PR based on this issue, since it seemed the most 
relevant from my searching of the backlog.

Here's a link: https://github.com/python/cpython/pull/19206

--

___
Python tracker 

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



[issue33129] Add kwarg-only option to dataclass

2020-03-28 Thread Michael Lee


Change by Michael Lee :


--
nosy: +michael.lee
nosy_count: 5.0 -> 6.0
pull_requests: +18569
pull_request: https://github.com/python/cpython/pull/19206

___
Python tracker 

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



[issue40024] Add PyModule_AddType helper function

2020-03-28 Thread Dong-hee Na


Dong-hee Na  added the comment:

@vstinner

IMHO, we can close this issue after PR 19205 is merged.
Most of use cases are replaced to PyModule_AddType.

--

___
Python tracker 

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



[issue40024] Add PyModule_AddType helper function

2020-03-28 Thread Dong-hee Na


Change by Dong-hee Na :


--
title: Add _PyModule_AddType private helper function -> Add PyModule_AddType 
helper function

___
Python tracker 

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



[issue40086] test_etree is skipped in test_typing due to cElementTree removal

2020-03-28 Thread Furkan Onder


Furkan Onder  added the comment:

@xtreak You're welcome :)

--

___
Python tracker 

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



[issue40024] Add _PyModule_AddType private helper function

2020-03-28 Thread Dong-hee Na


Change by Dong-hee Na :


--
pull_requests: +18568
pull_request: https://github.com/python/cpython/pull/19205

___
Python tracker 

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



[issue15987] Provide a way to compare AST nodes for equality recursively

2020-03-28 Thread Batuhan Taskaya


Batuhan Taskaya  added the comment:

The solution to hashing used in PR 14970 was just using the default hashing 
function which is kind of a workaround to the real problem. I now concur with 
your comments. Will try to draft out an `ast.compare` function.

--
nosy: +BTaskaya

___
Python tracker 

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



[issue40095] Incorrect st_ino returned for ReFS on Windows 10

2020-03-28 Thread Eryk Sun


Eryk Sun  added the comment:

> C:\Users>fsutil file queryfileid u:\test\test.jpg
> File ID is 0x29d504ae

ReFS uses a 128-bit file ID, which I gather consists of a 64-bit directory ID 
and a 64-bit relative ID. (Take this with a grain of salt. AFAIK, Microsoft 
hasn't published a spec for ReFS.) The latter is 0 for the directory itself and 
increments by 1 for each file created in the directory, with no reuse of 
previous values if a file is deleted or moved. If that's correct, and if 
"test.jpg" was created in "\test", then the directory ID of "\test" is 0x29d5, 
and the relative file ID is 0x4ae. 

> >>> from pathlib import Path
> >>> hex(Path('U:/test/test.jpg').stat().st_ino)
> '0x44ae29d5'

os.stat calls WINAPI GetFileInformationByHandle, which returns a 64-bit file 
ID. It appears that ReFS generates this ID by concatenating the relative ID and 
directory ID in a way that is "not guaranteed to be unique" according to the 
BY_HANDLE_FILE_INFORMATION [1] docs. 

I haven't checked whether this 64-bit file ID can even be used successfully 
with OpenFileById [2]. It could be that ReFS simply fails an open-by-ID request 
unless it includes the full 128-bit ID (i.e. ExtendedFileIdType).

You can request the 128-bit ID as a FILE_ID_128 record (an array of 16 bytes) 
via GetFileInformationByHandleEx: FileIdInfo [3][4]. Maybe os.stat should try 
to query the 128-bit ID and use it as st_ino (or st_ino_128) if it's available. 
However, looking into my crystal ball, I don't see this happening, unless 
someone makes a strong case in its favor.

> The problem does *not* exist on an NTFS volume:
> 
> C:\Users>fsutil file queryfileid o:\OneDrive\test\test.jpg
> File ID is 0x00030001be39

NTFS uses a 64-bit file ID, which consists of a 48-bit MFT record number and a 
16-bit sequence number. The latter gets incremented when an MFT record is 
reused in order to detect stale references. In the above case, the 48-bit 
record number is 0x0001be39, and the sequence number is 0x0003.

[1]: 
https://docs.microsoft.com/en-us/windows/win32/api/fileapi/ns-fileapi-by_handle_file_information
[2]: 
https://docs.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-openfilebyid
[3]: 
https://docs.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-getfileinformationbyhandleex
[4]: 
https://docs.microsoft.com/en-us/windows/win32/api/winbase/ns-winbase-file_id_info

--
nosy: +eryksun

___
Python tracker 

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



[issue15987] Provide a way to compare AST nodes for equality recursively

2020-03-28 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

I am not sure that implementing a rich comparison of AST nodes is the right 
way. There are too much options (compare attributes or not, compare recursively 
or not, compare types or not) and __eq__ does not support options. In addition, 
it requires implementing compatible __hash__, but how do you implement a hash 
of mutable object? In addition, recursive comparison can introduce a regression 
in existing code -- instead of fast returning False the comparison will spent a 
nontrivial amount of time.

If implement a comparison of AST nodes, it should be a separate function which 
support multiple options. Would be nice also to have examples where this 
feature can be used before implementing it.

See also issue37792.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue8901] Windows registry path not ignored with -E option

2020-03-28 Thread Zackery Spytz


Zackery Spytz  added the comment:

Steve, I've updated the pull request with the requested change.  Please take a 
look.

--
nosy: +ZackerySpytz
versions: +Python 3.9 -Python 3.5

___
Python tracker 

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



[issue39966] mock 3.9 bug: Wrapped objects without __bool__ raise exception

2020-03-28 Thread R. David Murray


R. David Murray  added the comment:

My guess is that it isn't so much that __bool__ is special, as that the 
evaluation of values in a boolean context is special.  What you have to do to 
make a mock behave "correctly" in the face that I'm not sure (I haven't 
investigated).  And I might be wrong.

--

___
Python tracker 

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



[issue40086] test_etree is skipped in test_typing due to cElementTree removal

2020-03-28 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

Thanks @furkanonder for the patch.

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

___
Python tracker 

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



[issue40086] test_etree is skipped in test_typing due to cElementTree removal

2020-03-28 Thread Ivan Levkivskyi

Ivan Levkivskyi  added the comment:


New changeset 34b0598295284e3ff6cedf5c05e159ce1fa54d60 by Furkan Önder in 
branch 'master':
bpo-40086: Update/fix test_etree test case in test_typing (GH-19189)
https://github.com/python/cpython/commit/34b0598295284e3ff6cedf5c05e159ce1fa54d60


--
nosy: +levkivskyi

___
Python tracker 

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



[issue40096] Support _Py_NO_RETURN on XLC

2020-03-28 Thread Batuhan Taskaya


Change by Batuhan Taskaya :


--
nosy: +Michael.Felt

___
Python tracker 

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



[issue40096] Support _Py_NO_RETURN on XLC

2020-03-28 Thread Batuhan Taskaya


Change by Batuhan Taskaya :


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

___
Python tracker 

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



[issue40096] Support _Py_NO_RETURN on XLC

2020-03-28 Thread Batuhan Taskaya


New submission from Batuhan Taskaya :

Like clang and gcc, __attribute__(noreturn) can be used in xlc too for AIX.

--
messages: 365208
nosy: BTaskaya
priority: normal
severity: normal
status: open
title: Support _Py_NO_RETURN on XLC
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



[issue40095] Incorrect st_ino returned for ReFS on Windows 10

2020-03-28 Thread Steve Dower


Steve Dower  added the comment:

There's no guarantee that st_ino will be the same as any other queryable value. 
Only that it will (hopefully) be unique on that disk.

stat() on Windows is just an approximation of stat() from POSIX - it's not a 
reliable way of reading Windows-specific filesystems.

If you can generate a collision, it may be worth investing in a solution. 
Otherwise, if you have a specific need to get the same file ID as fsutil, you 
should probably go to the native API yourself.

--

___
Python tracker 

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



[issue40095] Incorrect st_ino returned for ReFS on Windows 10

2020-03-28 Thread Eryk Sun


Change by Eryk Sun :


--
components: +Windows
nosy: +paul.moore, steve.dower, tim.golden, zach.ware
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



[issue40095] Incorrect st_ino returned for ReFS on Windows 10

2020-03-28 Thread Martynas Brijunas


New submission from Martynas Brijunas :

On a Windows 10 volume formatted with ReFS, pathlib.Path.stat() returns an 
incorrect value for "st_ino".

The correct value returned by the OS:

C:\Users>fsutil file queryfileid u:\test\test.jpg
File ID is 0x29d504ae

An incorrect value obtained with pathlib.Path.stat():

Python 3.8.2 (tags/v3.8.2:7b3ab59, Feb 25 2020, 23:03:10) [MSC v.1916 64 bit 
(AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> from pathlib import Path
>>> hex(Path('U:/test/test.jpg').stat().st_ino)
'0x44ae29d5'

The problem does *not* exist on an NTFS volume:

C:\Users>fsutil file queryfileid o:\OneDrive\test\test.jpg
File ID is 0x00030001be39

>>> hex(Path('O:/OneDrive/test/test.jpg').stat().st_ino)
'0x30001be39'

--
components: Library (Lib)
messages: 365206
nosy: mbri...@gmail.com
priority: normal
severity: normal
status: open
title: Incorrect st_ino returned for ReFS on Windows 10
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



[issue38002] 'ModifiedInterpreter' object has no attribute 'interp'

2020-03-28 Thread Terry J. Reedy


Change by Terry J. Reedy :


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

___
Python tracker 

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