Oren Milman added the comment: I considered doing that, but I had already opened another issue (http://bugs.python.org/issue27145) in which I had proposed to replace that in-place negate in long_sub with a call to _PyLong_Negate. But I guess I shouldn't worry about my patches colliding.
Anyway, the second assert would be 'assert(Py_SIZE(z) == 0 || Py_REFCNT(z) == 1);', because if someone does (in Python) 'x = (-2 ** PyLong_SHIFT) - (-2 ** PyLong_SHIFT)', x_sub would do 'return (PyLongObject *)PyLong_FromLong(0);'. The updated diff file and the new test output are attached. (No idea why test_netrc failed there. I ran it specifically five times right after that, and it passed all of them. Maybe some race condition? (To run the tests, I do 'python_d.exe -m test -j3'.) Anyway, here is the relevant output (I am not sure the last line is relevant): Warning -- files was modified by test_netrc test test_netrc failed -- Traceback (most recent call last): File "C:\Users\orenmn\cpython\lib\test\test_netrc.py", line 52, in test_password_with_trailing_hash """, 'pass#') File "C:\Users\orenmn\cpython\lib\test\test_netrc.py", line 41, in _test_passwords nrc = self.make_nrc(nrc) File "C:\Users\orenmn\cpython\lib\test\test_netrc.py", line 13, in make_nrc with open(temp_filename, mode) as fp: PermissionError: [Errno 13] Permission denied: '@test_3652_tmp' minkernel\crts\ucrt\src\appcrt\lowio\write.cpp(49) : Assertion failed: (_osfile(fh) & FOPEN) ) ---------- Added file: http://bugs.python.org/file43163/issue27073.diff _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue27073> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com