GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-99894: Ensure the local names don't collide with the test file in traceback suggestion error checking by pablogsal · Pull Request #99895 · python/cpython

Conversation

@pablogsal

@pablogsal pablogsal commented Nov 30, 2022 •
edited by bedevere-bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member
  • Issue: test_traceback: test_import_from_error_bad_suggestions_do_not_trigger_for_small_names() fails randomly on "wasm32-emscripten node (dynamic linking)" buildbot #99894

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@pablogsal
pythongh-99894: Ensure the local names don't collide with the test fi…
5612e56
…le in traceback suggestion error checking
@pablogsal
pablogsal requested a review from iritkatriel as a code owner November 30, 2022 11:22
@bedevere-bot bedevere-bot mentioned this pull request Nov 30, 2022
test_traceback: test_import_from_error_bad_suggestions_do_not_trigger_for_small_names() fails randomly on "wasm32-emscripten node (dynamic linking)" buildbot #99894
Closed
@bedevere-bot bedevere-bot added awaiting core review tests Tests in the Lib/test dir labels Nov 30, 2022
@pablogsal pablogsal added needs backport to 3.10 needs backport to 3.11 only security fixes labels Nov 30, 2022
@vstinner

vstinner commented Nov 30, 2022

Copy link
Copy Markdown
Member

This branch doesn't work for me:

vstinner@mona$ ./python -m test test_traceback -j20 -F -m test_import_from_error_bad_suggestions_do_not_trigger_for_small_names -v
(...)
0:00:07 load avg: 8.01 [ 36/1] test_traceback failed (1 failure)
test_import_from_error_bad_suggestions_do_not_trigger_for_small_names (test.test_traceback.CPythonSuggestionFormattingTests.test_import_from_error_bad_suggestions_do_not_trigger_for_small_names) ... 
  test_import_from_error_bad_suggestions_do_not_trigger_for_small_names (test.test_traceback.CPythonSuggestionFormattingTests.test_import_from_error_bad_suggestions_do_not_trigger_for_small_names) (name='py') ... FAIL
test_import_from_error_bad_suggestions_do_not_trigger_for_small_names (test.test_traceback.PurePythonSuggestionFormattingTests.test_import_from_error_bad_suggestions_do_not_trigger_for_small_names) ... ok

======================================================================
FAIL: test_import_from_error_bad_suggestions_do_not_trigger_for_small_names (test.test_traceback.CPythonSuggestionFormattingTests.test_import_from_error_bad_suggestions_do_not_trigger_for_small_names) (name='py')
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/vstinner/python/main/Lib/test/test_traceback.py", line 3172, in test_import_from_error_bad_suggestions_do_not_trigger_for_small_names
    self.assertNotIn("vvv", actual)
AssertionError: 'vvv' unexpectedly found in "ImportError: cannot import name 'py' from 'NkosMVLvvvpdqPze' (/tmp/test_python_xfxl02nj/tmp7l231ock/NkosMVLvvvpdqPze.py)"

$ git show
commit 5612e561a96f4da735e966f527e1e01265564ae1 (HEAD -> pr/99895)
Author: Pablo Galindo <[email protected]>
Date:   Wed Nov 30 11:22:49 2022 +0000

    gh-99894: Ensure the local names don't collide with the test file in traceback suggestion error checking
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@vstinner

vstinner commented Nov 30, 2022

Copy link
Copy Markdown
Member

Ah, this PR changes test_getattr_error_bad_suggestions_do_not_trigger_for_small_names(), but not test_import_from_error_bad_suggestions_do_not_trigger_for_small_names().

You should also change test_import_from_error_bad_suggestions_do_not_trigger_for_small_names(), no?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@pablogsal
fixup! pythongh-99894: Ensure the local names don't collide with the …
d159ac5
…test file in traceback suggestion error checking
@pablogsal

pablogsal commented Nov 30, 2022

Copy link
Copy Markdown
Member Author

Ah, this PR changes test_getattr_error_bad_suggestions_do_not_trigger_for_small_names(), but not test_import_from_error_bad_suggestions_do_not_trigger_for_small_names().

You should also change test_import_from_error_bad_suggestions_do_not_trigger_for_small_names(), no?

Done!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@vstinner

vstinner commented Nov 30, 2022

Copy link
Copy Markdown
Member

I ran ./python -m test test_traceback -j20 -F -m test_import_from_error_bad_suggestions_do_not_trigger_for_small_names -v for 9 min 24 sec: 3669 tests OK.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@vstinner

vstinner commented Nov 30, 2022

Copy link
Copy Markdown
Member

Another test: ./python -m test test_traceback -j20 -F -v ran for 4 min 50 sec: 52 tests OK.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@vstinner

vstinner commented Nov 30, 2022

Copy link
Copy Markdown
Member

Another test: ./python -m test test_traceback -j20 -F -m test_getattr_error_bad_suggestions_do_not_trigger_for_small_names -v ran for 9 min 28 sec: 5086 tests OK.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

vstinner
vstinner approved these changes Nov 30, 2022
View reviewed changes

@vstinner vstinner left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM: I tested functionnaly the change, it does fix #99894

I have a minor suggestion.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread Lib/test/test_traceback.py Outdated
@@ -2979,8 +2979,8 @@ class MyClass:
with self.subTest(name=name):
actual = self.get_suggestion(MyClass, name)
self.assertNotIn("you mean", actual)

@vstinner vstinner Nov 30, 2022

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe check for Did you mean? Same remark for the other test.

Other test_traceback tests check for this (a little bit longer) pattern.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@bedevere-bot bedevere-bot added awaiting merge and removed awaiting core review labels Nov 30, 2022
@kumaraditya303 kumaraditya303 added the skip news label Nov 30, 2022
vstinner
vstinner reviewed Nov 30, 2022
View reviewed changes
Comment thread Lib/test/test_traceback.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Lib/test/test_traceback.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

vstinner added 2 commits November 30, 2022 16:54
@vstinner
Update Lib/test/test_traceback.py
2287142
@vstinner
Update Lib/test/test_traceback.py
227b315
@vstinner

vstinner commented Dec 1, 2022

Copy link
Copy Markdown
Member

test_threading of "Address sanitizer" failed (env changed). I re-ran this CI job.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@vstinner
vstinner merged commit 0563be2 into python:main Dec 1, 2022
@bedevere-bot bedevere-bot removed the awaiting merge label Dec 1, 2022
@vstinner

vstinner commented Dec 1, 2022

Copy link
Copy Markdown
Member

Python 3.10 and 3.11 are not affected.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-bot

bedevere-bot commented Dec 1, 2022

Copy link
Copy Markdown

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot ARM Raspbian 3.x has failed when building commit 0563be2.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/all/#builders/424/builds/3060) and take a look at the build logs.
  4. Check if the failure is related to this commit (0563be2) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/all/#builders/424/builds/3060

Summary of the results of the build (if available):

== Tests result: ENV CHANGED ==

411 tests OK.

10 slowest tests:

  • test_venv: 12 min 28 sec
  • test_largefile: 8 min 51 sec
  • test_lib2to3: 6 min 28 sec
  • test_multiprocessing_spawn: 4 min 2 sec
  • test_concurrent_futures: 3 min 19 sec
  • test_asyncio: 3 min
  • test_tokenize: 2 min 5 sec
  • test_multiprocessing_forkserver: 1 min 56 sec
  • test_gdb: 1 min 42 sec
  • test_cppext: 1 min 39 sec

1 test altered the execution environment:
test_concurrent_futures

21 tests skipped:
test_check_c_globals test_devpoll test_idle test_ioctl test_kqueue
test_launcher test_msilib test_peg_generator test_perf_profiler
test_startfile test_tcl test_tix test_tkinter test_ttk
test_ttk_textonly test_turtle test_winconsoleio test_winreg
test_winsound test_wmi test_zipfile64

Total duration: 29 min 44 sec

Click to see traceback logs
remote: Enumerating objects: 9, done.        
remote: Counting objects:  11% (1/9)        
remote: Counting objects:  22% (2/9)        
remote: Counting objects:  33% (3/9)        
remote: Counting objects:  44% (4/9)        
remote: Counting objects:  55% (5/9)        
remote: Counting objects:  66% (6/9)        
remote: Counting objects:  77% (7/9)        
remote: Counting objects:  88% (8/9)        
remote: Counting objects: 100% (9/9)        
remote: Counting objects: 100% (9/9), done.        
remote: Compressing objects:  20% (1/5)        
remote: Compressing objects:  40% (2/5)        
remote: Compressing objects:  60% (3/5)        
remote: Compressing objects:  80% (4/5)        
remote: Compressing objects: 100% (5/5)        
remote: Compressing objects: 100% (5/5), done.        
remote: Total 5 (delta 4), reused 0 (delta 0), pack-reused 0        
From https://github.com/python/cpython
 * branch                  main       -> FETCH_HEAD
Note: switching to '0563be23a557917228a8b48cbb31bda285a3a815'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:

  git switch -c <new-branch-name>

Or undo this operation with:

  git switch -

Turn off this advice by setting config variable advice.detachedHead to false

HEAD is now at 0563be23a5 gh-99894: Ensure the local names don't collide with the test file in traceback suggestion error checking (#99895)
Switched to and reset branch 'main'

Objects/obmalloc.c:776:1: warning: ‘always_inline’ function might not be inlinable [-Wattributes]
  776 | arena_map_get(pymem_block *p, int create)
      | ^~~~~~~~~~~~~

make: *** [Makefile:1889: buildbottest] Error 3
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

carljm added a commit to carljm/cpython that referenced this pull request Dec 1, 2022
@carljm
Merge branch 'main' into fixinspect
12f7659
* main: (112 commits)
  pythongh-99894: Ensure the local names don't collide with the test file in traceback suggestion error checking (python#99895)
  pythongh-99612: Fix PyUnicode_DecodeUTF8Stateful() for ASCII-only data (pythonGH-99613)
  Doc: Add summary line to isolation_level & autocommit sqlite3.connect params (python#99917)
  pythonGH-98906 ```re``` module: ```search() vs. match()``` section should mention ```fullmatch()``` (pythonGH-98916)
  pythongh-89189: More compact range iterator (pythonGH-27986)
  bpo-47220: Document the optional callback parameter of weakref.WeakMethod (pythonGH-25491)
  pythonGH-99905: Fix output of misses in summarize_stats.py execution counts (pythonGH-99906)
  pythongh-99845: PEP 670: Convert PyObject macros to functions (python#99850)
  pythongh-99845: Use size_t type in __sizeof__() methods (python#99846)
  pythonGH-99877)
  Fix typo in exception message in `multiprocessing.pool` (python#99900)
  pythongh-87092: move all localsplus preparation into separate function called from assembler stage (pythonGH-99869)
  pythongh-99891: Fix infinite recursion in the tokenizer when showing warnings (pythonGH-99893)
  pythongh-99824: Document that sqlite3.connect implicitly open a transaction if autocommit=False (python#99825)
  pythonGH-81057: remove static state from suggestions.c (python#99411)
  Improve zip64 limit error message (python#95892)
  pythongh-98253: Break potential reference cycles in external code worsened by typing.py lru_cache (python#98591)
  pythongh-99127: Allow some features of syslog to the main interpreter only (pythongh-99128)
  pythongh-82836: fix private network check (python#97733)
  Docs: improve accuracy of socketserver reference (python#24767)
  ...
kadiwa4
kadiwa4 reviewed Dec 2, 2022
View reviewed changes
Comment thread Lib/test/test_traceback.py
self.assertNotIn("vvv", actual)
self.assertNotIn("mom", actual)
self.assertNotIn("Did you mean", actual)
self.assertNotIn("'vvv", actual)

@kadiwa4 kadiwa4 Dec 2, 2022

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know if this has any effect but there is a ' missing here

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@sobolevn sobolevn mentioned this pull request Dec 4, 2022
test_capi fails with "Maximum call stack size exceeded" on "wasm32-emscripten node (pthreads) 3.x" buildbot #99985
Closed
sobolevn added a commit to sobolevn/cpython that referenced this pull request Dec 28, 2022
@sobolevn
Revert "pythongh-99894: Ensure the local names don't collide with the…
ce557be
… test file in traceback suggestion error checking (python#99895)"

This reverts commit 0563be2.
@ZeroIntensity ZeroIntensity removed needs backport to 3.10 needs backport to 3.11 only security fixes labels Feb 17, 2025
@pablogsal
pablogsal deleted the gh-99894 branch September 24, 2026 17:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@vstinner vstinner vstinner approved these changes
@iritkatriel iritkatriel Awaiting requested review from iritkatriel
+1 more reviewer
@kadiwa4 kadiwa4 kadiwa4 left review comments
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

skip news tests Tests in the Lib/test dir

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

6 participants

@pablogsal @vstinner @bedevere-bot @kadiwa4 @ZeroIntensity @kumaraditya303
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.