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

WHOIS uses deprecated @asyncio.coroutine #161

Closed
Rixxan opened this issue Dec 29, 2021 · 0 comments · Fixed by #163
Closed

WHOIS uses deprecated @asyncio.coroutine #161

Rixxan opened this issue Dec 29, 2021 · 0 comments · Fixed by #163

Comments

@Rixxan
Copy link
Contributor

Rixxan commented Dec 29, 2021

Currently, @asyncio.coroutine is deprecated and is removed in Python3.10. Unfortunately, a few things in Pydle still use this, which means currently warnings are thrown by some test libraries as well as locking Pydle-based projects to 3.9 or lower.

One such example can be viewed here: https://github.com/Shizmob/pydle/blob/9798eb3db6665622fdd1391cdb563ebdb3014c6c/pydle/features/account.py#L24-L30

Expected Behavior

When called, this function should return the information about a user, without errors or warnings.

Current Behavior

When run with Python 3.10, this function fails. When run with Python 3.8, a warning is thrown that the type is deprecated.

Possible Solution

On my own testing, in Python 3.8, the following code appears to drop-in work as intended, however I don't know enough to completely validate it.

    ## IRC API.
    async def whois(self, nickname):
        info = await super().whois(nickname)
        info.setdefault('account', None)
        info.setdefault('identified', False)
        return info

Context (Environment)

OS: Windows 10
Python Version: Python 3.8.6
Pydle version: 0.9.4

Rixxan added a commit to Rixxan/pydle that referenced this issue Mar 22, 2022
theunkn0wn1 added a commit that referenced this issue Mar 25, 2022
[#161] Remove Deprecated Marker from WHOIS
@theunkn0wn1 theunkn0wn1 mentioned this issue Jun 19, 2022
bmwiedemann pushed a commit to bmwiedemann/openSUSE that referenced this issue Sep 30, 2022
https://build.opensuse.org/request/show/1007087
by user mia + RBrownFactory
- Update to version 1.0.0
  Major changes:
  * API change, monitor and unmonitor are now async def functions
    gh#shizmob/pydle#144
  * Drop support for Python < 3.5
    gh#shizmob/pydle#165
  Bug fixes:
  * Fix parsing IRCv3 tags with missing/empty values
    gh#shizmob/pydle#149
  * Fixup irccat.py example
    gh#shizmob/pydle#152
  * WHOIS uses deprecated @asyncio.coroutine
    Backward compatable as the interface did not effectively change
    gh#shizmob/pydle#161
  * Fix Missing Awaits in various files
    Some internal methods were made async. As these methods are
    internal, they are not covered by SEMVER.
    gh#shizmob/pydle#164
  * Add Missing awaits in coroutine calls
    gh#shizmob/pydle#170
  Features:
  * Enable RplWhoisHostSupport implementation
    gh#shizmob/pydle#156
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

Successfully merging a pull request may close this issue.

1 participant