Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spyder "Autocompletion / Go to definition" fails on Windows when an import folder is named "array" #22091

Open
8 tasks done
wlter opened this issue May 17, 2024 · 1 comment
Open
8 tasks done

Comments

@wlter
Copy link

wlter commented May 17, 2024

Issue Report Checklist

  • Searched the issues page for similar reports
  • Read the relevant sections of the Spyder Troubleshooting Guide and followed its advice
  • Reproduced the issue after updating with conda update spyder (or pip, if not using Anaconda)
  • [N/A] Could not reproduce inside jupyter qtconsole (if console-related)
  • Tried basic troubleshooting (if a bug/error)
    • Restarted Spyder
    • Reset preferences with spyder --reset
    • Reinstalled the latest version of Anaconda
    • [N/A] Tried the other applicable steps from the Troubleshooting Guide
  • Completed the Problem Description, Steps to Reproduce and Version sections below

Problem Description

What steps reproduce the problem?

  1. Install the current anaconda with spyder on Windows (Anaconda3-2024.02-1-Windows-x86_64)
  2. Create a repository which contains a folder named "array"
  • Create a folder to be integrated as repository, lets call it "testrepo". Add that folder in the pythonpath manager.
  • Create some subfolder e.g. "pathdebug" and add an empty init.py.
  • Create a subfolders in testrepo/pathdebug named "array".
  • Inside that, add an empty init.py and a simple python file that can be imported from, e.g. test.py with some definition of an empty function.
  1. Open an empty python file in spyder and start to type 'from pathdebug.array.test import...'

What is the expected output? What do you see instead?

This happens and this is expected: After the first dot i.e. 'from pathdebug.' the autcompletion pops up an suggests 'array' as a followup package.
Then this happens and this is not expected: after the second dot 'from pathdebug.array.' no autocompletion pops up and it cannot be forced to pop up even with Ctrl+Space. Also, right click on 'array' and "go to definition" will not open the init of the folder.

You may then continue to import the empty function from inside the array folder, but "Go to definition" will not work.

This seems to be directly related to the name "array". Renaming the folder to something else e.g. "notArray" solves the problem. Then autocompletion works and goto definition works again.

We have seen this issue on two windows machines, but could not see it on a linux setup (possibly a different version of spyder though).

Versions

  • Spyder version: 5.5.1 (conda)
  • Python version: 3.11.7 64-bit
  • Qt version: 5.15.2
  • PyQt5 version: 5.15.10
  • Operating System: Windows-10-10.0.19045-SP0
@ccordoba12
Copy link
Member

Hey @wlter, thanks for reporting and the detailed description to reproduce the problem. We'll try to take a look at this after we release Spyder 6.0 next month.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants