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

install issue ... installed code uses deprecated inspect.formatargspec #2020

Closed
scted opened this issue Feb 24, 2023 · 3 comments
Closed

install issue ... installed code uses deprecated inspect.formatargspec #2020

scted opened this issue Feb 24, 2023 · 3 comments

Comments

@scted
Copy link

scted commented Feb 24, 2023

line 133 in CallTips.py of my install uses deprecated 'inspect.formatargspec'

From interactive session

- failure happens as soon as I type the '(' in >>>Base(

PythonWin 3.11.2 (tags/v3.11.2:878ead1, Feb  7 2023, 16:38:35) [MSC v.1934 64 bit (AMD64)] on win32.
Portions Copyright 1994-2018 Mark Hammond - see 'Help/About PythonWin' for further copyright information.
>>> class Base:
... 	def __new__(cls, *args):
... 		return object.__new__(cls).__init__(*args)
... 	def __init__(self, *args):
... 		print(args)
... 		
>>> BaseFailed to format the args
Traceback (most recent call last):
  File "C:\Users\c32825\AppData\Local\Programs\Python\Python311\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'
(
@scted scted changed the title inspect.formatargspec is deprecated in 3.11 install issue ... installed code uses deprecated inspect.formatargspec Feb 24, 2023
@scted
Copy link
Author

scted commented Feb 24, 2023

This appears to be an issue with my install as the code in github has fixed the problem

I installed using pip ...
python -m pip install pywin32 --upgrade

from CallTips.py in my install

        if inspect.isfunction(fob) or inspect.ismethod(fob):
            try:
                argText = inspect.formatargspec(*inspect.getfullargspec(fob))
            except:
                print("Failed to format the args")
                traceback.print_exc()

from https://github.com/mhammond/pywin32/blob/main/Pythonwin/pywin/idle/CallTips.py

        if inspect.isfunction(fob) or inspect.ismethod(fob):
            try:
                argText = str(inspect.signature(fob))
            except:
                print("Failed to format the args")
                traceback.print_exc()
``

@scted scted closed this as completed Feb 25, 2023
@scted
Copy link
Author

scted commented Feb 25, 2023

after a condescending comment on stackoverflow, i was able to ascertain that my install was from blob305 (Nov 7, 2022) and the fix to CallTips.py was subsequent to that

@CristiFati
Copy link
Contributor

Duplicate of (fixed by): #1975.

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