SylvainDe / DidYouMean-Python

Module to have suggestions in case of errors (NameError, AttributeError, etc).
MIT License
120 stars 15 forks source link

Continuous Integration on nightly (Python 3.9): No exception thrown with "1 <> 2" #46

Closed SylvainDe closed 4 years ago

SylvainDe commented 4 years ago

First failure: #1922 https://travis-ci.org/github/SylvainDe/DidYouMean-Python/builds/678869608 https://travis-ci.org/github/SylvainDe/DidYouMean-Python/jobs/678869630

$ python -VV
Python 3.9.0a5+ (heads/master:ee40e4b, Apr 23 2020, 05:15:16) 
[GCC 5.4.0 20160609]
$ python -c "import sys; print(sys._git)" || true
('CPython', 'heads/master', 'ee40e4b')
...
======================================================================
FAIL: test_old_comparison (didyoumean_sugg_tests.SyntaxErrorTests)
<> comparison is removed, != always works.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/travis/build/SylvainDe/DidYouMean-Python/didyoumean/didyoumean_sugg_tests.py", line 2158, in test_old_comparison
    self.throws(old_code, INVALIDSYNTAX, sugg, after, 'cpython')
  File "/home/travis/build/SylvainDe/DidYouMean-Python/didyoumean/didyoumean_sugg_tests.py", line 418, in throws
    self.assertFalse(exc is None, "No exc thrown." + details)
AssertionError: True is not false : No exc thrown.Running following code :
---
1 <> 2
---
----------------------------------------------------------------------
Ran 368 tests in 1.488s
FAILED (failures=1)

Last success: #1921 https://travis-ci.org/github/SylvainDe/DidYouMean-Python/builds/678439749 https://travis-ci.org/github/SylvainDe/DidYouMean-Python/jobs/678439780

$ python -VV
Python 3.9.0a5+ (heads/master:df8913f, Apr 20 2020, 04:59:36) 
[GCC 5.4.0 20160609]
$ python -c "import sys; print(sys._git)" || true
('CPython', 'heads/master', 'df8913f')
SylvainDe commented 4 years ago
$ git log --oneline df8913f..ee40e4b
ee40e4b856 bpo-40334: Don't downcast from Py_ssize_t to int (GH-19671)
0b7829e089 Compile extensions in test_peg_generator with C99 (GH-19668)
1def7754b7 bpo-40334: Rename PyConfig.use_peg to _use_peg_parser (GH-19670)
a25f3c4c8f bpo-40334: Fix builds outside the source directory and regenerate autoconf files (GH-19667)
ce0eacb19c Add @pablogsal as code owner for pegen-related files (GH-19665)
458004bf79 bpo-40334: Fix errors in parse_string.c with old compilers (GH-19666)
3f8a58b7ef PEP 617: Only run the CI with the new parser (GH-19664)
c5fc156852 bpo-40334: PEP 617 implementation: New PEG parser for CPython (GH-19503)
a81849b031 bpo-39939: Add str.removeprefix and str.removesuffix (GH-18939)
39652cd8bd bpo-40260: Remove unnecessary newline in compile() call (GH-19641)
4454057269 bpo-39562: Prevent collision of future and compiler flags (GH-19230)
9b49893900 bpo-40214: Fix ctypes WinDLL test with insecure flags (GH-19652)
9bee32b34e bpo-40138: Fix Windows os.waitpid() for large exit code (GH-19637)
bcc136ba89 bpo-38329: python.org macOS installers now update Current symlink (GH-19650)
b310700976 bpo-38360: macOS: support alternate form of -isysroot flag (GH-16480)
3a69f3caee bpo-38439: Add 256px IDLE icon (GH-17473)
783a673f23 bpo-40164: Update macOS installer builds to use OpenSSL 1.1.1g. (GH-19642)
75bedbe2ed bpo-40327: Improve atomicity, speed, and memory efficiency of the items() loop (GH-19628)
d3a8d616fa Small improvements to the recipes and examples. (GH-19635)
9c82ea7868 bpo-34037: Add Python API whatsnew for loop.shutdown_default_executor() (#19634)
11a7f158ef bpo-40335: Correctly handle multi-line strings in tokenize error scenarios (GH-19619)
6a9e80a931 bpo-40313: speed up bytes.hex() (GH-19594)
bba760e9b6 Fix uninitialized struct member (GH-19589)
a25a04fea5 bpo-39942:Fix failure in `TypeVar` when missing `__name__` (GH-19616)
eba9f6155d bpo-40330: Fix utf-8 size check in ShareableList (GH-19606)
5dd21f5d1c bpo-39849: Enable assertions in _testcapimodule.c and _testinternalcapi.c (GH-19623)
9b0b5d2bae bpo-40260: Revert breaking changes made in modulefinder (GH-19595)
SylvainDe commented 4 years ago

git bisect (assuming "good" means SyntaxError)

$ git bisect good
c5fc15685202cda73f7c3f5c6f299b0945f58508 is the first bad commit
commit c5fc15685202cda73f7c3f5c6f299b0945f58508
Author: Pablo Galindo <Pablogsal@gmail.com>
Date:   Wed Apr 22 23:29:27 2020 +0100

    bpo-40334: PEP 617 implementation: New PEG parser for CPython (GH-19503)

    Co-authored-by: Guido van Rossum <guido@python.org>
    Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>

https://github.com/python/cpython/commit/c5fc15685202cda73f7c3f5c6f299b0945f58508

SylvainDe commented 4 years ago

Just to be sure

With:

$ git diff
diff --git a/Lib/test/test_binop.py b/Lib/test/test_binop.py
index 299af09c49..15a53af80e 100644
--- a/Lib/test/test_binop.py
+++ b/Lib/test/test_binop.py
@@ -436,5 +436,14 @@ class FallbackBlockingTests(unittest.TestCase):
         self.assertFalse(e != xn)
         self.assertRaises(TypeError, ne, xn, e)

+    def test_toto(self):
+        self.assertTrue(1 == 1)
+        self.assertFalse(1 == 2)
+        self.assertTrue(1 != 2)
+        self.assertFalse(1 != 1)
+        self.assertTrue(1 <> 2)
+        self.assertFalse(1 <> 1)
+
+
 if __name__ == "__main__":
     unittest.main()

Then

$ git checkout c5fc15685202cda73f7c3f5c6f299b0945f58508 && make clean && make && make test TESTOPTS="-v test_binop"

gives

Ran 13 tests in 0.005s

OK

== Tests result: SUCCESS ==

1 test OK.

Total duration: 373 ms
Tests result: SUCCESS

but

$ git checkout a81849b031 && make clean && make && make test TESTOPTS="-v test_binop"

gives

  File "cpython/Lib/test/test_binop.py", line 444
    self.assertTrue(1 <> 2)
                       ^
SyntaxError: invalid syntax

1 test failed again:
    test_binop

== Tests result: FAILURE then FAILURE ==

1 test failed:
    test_binop

1 re-run test:
    test_binop

Total duration: 363 ms
Tests result: FAILURE then FAILURE
make: *** [Makefile:1147: test] Error 2
SylvainDe commented 4 years ago

Will ask more details in: https://github.com/we-like-parsers/cpython/issues/113

SylvainDe commented 4 years ago

Issue linked above is fixed - the workaround can be reverted in the next days.

SylvainDe commented 4 years ago

From https://travis-ci.org/github/SylvainDe/DidYouMean-Python/jobs/680384462

$ python -VV
Python 3.9.0a5+ (heads/master:caf1aad, Apr 27 2020, 05:22:36) 
[GCC 5.4.0 20160609]
$ python -c "import sys; print(sys._git)" || true
('CPython', 'heads/master', 'caf1aad')

This does not contain the patch yet - waiting for another day before reverting workaround.

SylvainDe commented 4 years ago

From https://travis-ci.org/github/SylvainDe/DidYouMean-Python/jobs/680838647

$ python -VV
Python 3.9.0a5+ (heads/master:3d53d87, Apr 28 2020, 07:11:39) 
[GCC 5.4.0 20160609]
$ python -c "import sys; print(sys._git)" || true
('CPython', 'heads/master', '3d53d87')

This does contain the patch - the workaround can be reverted.

SylvainDe commented 4 years ago

Everything is back to normal!