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

Pythonwin interactive window now gets tracebacks with python3.12, probably 3.11 too... #2240

Open
zarquon5 opened this issue Apr 9, 2024 · 1 comment

Comments

@zarquon5
Copy link

zarquon5 commented Apr 9, 2024

Expected behavior and actual behavior

When you start typing a function call in the interactive window of Pythonwin, it used to give you a "CallTip" that indicated the arguments to the function in question. Hoewever, the CallTips mechanism no longer works because it depends on a function, inspect.formatargspec(), that has apparently been deprecated since python 3.5, and removed in python 3.11. (See python/cpython#28618.)

This makes using the pythonwin interactive window very problematic.

Steps to reproduce the problem

  1. Open pythonwin 3.12.1
>>> import os
>>> os.path.join(

As soon as you hit the (, you get the traceback:

>>> Failed to format the args
Traceback (most recent call last):
  File "c:\ProgramData\conda\envs\myenv\lib\site-packages\pythonwin\pywin\idle\CallTips.py", line 133, in get_arg_text
    argText = inspect.formatargspec(*inspect.getfullargspec(fob))
              ^^^^^^^^^^^^^^^^^^^^^
AttributeError: module 'inspect' has no attribute 'formatargspec'. Did you mean: 'formatargvalues'?

(see GrahamDumpleton/wrapt#196 for a similar issue with wrapt that was then fixed.)

System information

Python version and distribution: 3.12.1, miniconda3.
pywin32 version: 305.1
Installed from PyPI

Windows Version: 10.0.17763 Build 17763

DLL locations:
c:\ProgramData\conda\envs\myenv\Lib\site-packages\pywin32_system32\pywintypes312.dll
c:\ProgramData\conda\envs\myenv\Lib\site-packages\pywin32_system32\pythoncom312.dll

@Avasam
Copy link
Collaborator

Avasam commented Apr 9, 2024

Hi @zarquon5 , could you try with pywin32==306 ? This should already have been fixed by #1975

formatargspec isn't used anywhere in the codebase anymore.

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

No branches or pull requests

2 participants