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

module 'types' has no attribute 'UnionType' #1239

Closed
3 tasks done
Tiffinini opened this issue Apr 9, 2022 · 3 comments
Closed
3 tasks done

module 'types' has no attribute 'UnionType' #1239

Tiffinini opened this issue Apr 9, 2022 · 3 comments
Assignees
Labels
bug Something isn't working dependencies Pull requests that update a dependency file priority: high High Priority status: todo This issue needs work

Comments

@Tiffinini
Copy link

Tiffinini commented Apr 9, 2022

Summary

A conditional check in enums.py is causing Python versions <3.10 to crash.

Reproduction Steps

  1. Define a slash command with an option.
  2. Run.

Minimal Reproducible Code

In my case, this error occurs when defining any slash command using the Option parameter:

    @slash_command(guild_ids=globals.COMMAND_GUILD_ID_REGISTER_LIST)
    async def note(self, ctx, note: Option(str, "Add a note.")):

Expected Results

The code to run, as it did under b5.

Actual Results

Crash with:

module 'types' has no attribute 'UnionType'

Intents

All

System Information

  • Python v3.9.2-final
  • py-cord v2.0.0-beta
    • py-cord pkg_resources: v2.0.0b6
  • aiohttp v3.8.1
  • system info: Windows 8.1 6.3.9600

Checklist

  • I have searched the open issues for duplicates.
  • I have shown the entire traceback, if possible.
  • I have removed my token from display, if visible.

Additional Context

Line 672 of enums.py makes a check to see if datatype is of type: types.UnionType. UnionType is not part of the types built-in for Python versions below 3.10, causing: module 'types' has no attribute 'UnionType'.

Judging by the conditional check to begin with, I assume the intention is not to make 3.10+ a requirement to use this library.

@Tiffinini Tiffinini added the unconfirmed bug A bug report that needs triaging label Apr 9, 2022
@Dorukyum Dorukyum added bug Something isn't working and removed unconfirmed bug A bug report that needs triaging labels Apr 9, 2022
@EmmmaTech
Copy link
Contributor

Well, you beat me to making this issue. Congrats

@Lulalaby Lulalaby added priority: high High Priority status: todo This issue needs work dependencies Pull requests that update a dependency file labels Apr 9, 2022
@Lulalaby
Copy link
Member

Lulalaby commented Apr 9, 2022

Have fun emre

@EmmmaTech
Copy link
Contributor

Fixed by #1240

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working dependencies Pull requests that update a dependency file priority: high High Priority status: todo This issue needs work
Projects
Status: No status
Development

No branches or pull requests

4 participants