Advise version incompatibility with Python 3.9.7 #93

Open
kuanhulio wants to merge 2 commits from kuanhulio/patch-1 into 2.0
kuanhulio commented 2021-10-06 02:08:13 +00:00 (Migrated from github.com)

Summary

Due to a bug in Python 3.9.7, code situations where we call an init function in a subclass will fail with a TypeError.

This is only a bug within the Python language and was patched out with Python 3.10 and this doesn't affect Python 3.9.6.

Here, we are advising the incompatibility.

You can view that bug report here on the Python Bugs site.

Checklist

  • If code changes were made then they have been tested.
    • I have updated the documentation to reflect the changes.
  • [] This PR fixes an issue.
  • [] This PR adds something new (e.g. new method or parameters).
  • [] This PR is a breaking change (e.g. methods or parameters removed/renamed)
  • This PR is not a code change (e.g. documentation, README, ...)
<!-- Pull requests that do not fill this information in will likely be closed --> ## Summary Due to a bug in Python 3.9.7, code situations where we call an __init__ function in a subclass will fail with a TypeError. This is only a bug within the Python language and was patched out with Python 3.10 and this doesn't affect Python 3.9.6. Here, we are advising the incompatibility. You can view that bug report [here on the Python Bugs site.](https://bugs.python.org/issue45121) ## Checklist <!-- Put an x inside [ ] to check it, like so: [x] --> - [x] If code changes were made then they have been tested. - [x] I have updated the documentation to reflect the changes. - [] This PR fixes an issue. - [] This PR adds something new (e.g. new method or parameters). - [] This PR is a breaking change (e.g. methods or parameters removed/renamed) - [x] This PR is **not** a code change (e.g. documentation, README, ...)
JDJGInc commented 2021-10-06 02:41:02 +00:00 (Migrated from github.com)

can you try updating your python 3.9.7 version to see if it fixes the issue or did they fix it in 3.9.8?

can you try updating your python 3.9.7 version to see if it fixes the issue or did they fix it in 3.9.8?
kuanhulio commented 2021-10-06 03:41:14 +00:00 (Migrated from github.com)

Hey there,

3.9.8 is not released yet, but I have not tested 3.9.6 nor 3.10. I'll give these a deployment in a few hours.

Hey there, 3.9.8 is not released yet, but I have not tested 3.9.6 nor 3.10. I'll give these a deployment in a few hours.
kuanhulio commented 2021-10-06 05:26:38 +00:00 (Migrated from github.com)

Per my tests, 3.9.6 and 3.10.0 seem unaffected. I reinstalled Python 3.9.7 and the same edge case error happened.

Per my tests, 3.9.6 and 3.10.0 seem unaffected. I reinstalled Python 3.9.7 and the same edge case error happened.
Gnome-py commented 2021-10-06 19:10:49 +00:00 (Migrated from github.com)

I feel like this should be left as a note in the affected places, instead of as a big notice at the top of the readme, on that note, where are the affected places? I have been running 3.9.7 for development since it came out on pacman and seem to have no problems.

I feel like this should be left as a note in the affected places, instead of as a big notice at the top of the readme, on that note, where are the affected places? I have been running 3.9.7 for development since it came out on `pacman` and seem to have no problems.
kuanhulio commented 2021-10-06 19:46:00 +00:00 (Migrated from github.com)

Well, on my hands, I'm working on Windows 10 with the 3.9.7 directly from python.org and it seemingly throws this error.

Affected areas would primarily be wherever a class derives from a Protocol and we call super().__init__(). I'm not really familiar with d.py codebase or the additions you guys have made, however, this specific error was called from discord/ext/commands/converter.py:116

Here's the full traceback:

Ignoring exception in command squads promote:
Traceback (most recent call last):
File "C:\Users\saltamimi\.virtualenvs\halobot-rewrite-O1Pbt8pO\lib\site-packages\discord\ext\commands\core.py", line 471, in _actual_conversion
  return await converter().convert(ctx, argument)
File "C:\Users\saltamimi\.virtualenvs\halobot-rewrite-O1Pbt8pO\lib\site-packages\discord\ext\commands\converter.py", line 116, in __init__
  super().__init__()
File "C:\Program Files\Python39\lib\typing.py", line 1083, in _no_init
  raise TypeError('Protocols cannot be instantiated')
TypeError: Protocols cannot be instantiated

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "C:\Users\saltamimi\.virtualenvs\halobot-rewrite-O1Pbt8pO\lib\site-packages\discord\ext\commands\bot.py", line 986, in invoke
  await ctx.command.invoke(ctx)
File "C:\Users\saltamimi\.virtualenvs\halobot-rewrite-O1Pbt8pO\lib\site-packages\discord\ext\commands\core.py", line 1361, in invoke
  await ctx.invoked_subcommand.invoke(ctx)
File "C:\Users\saltamimi\.virtualenvs\halobot-rewrite-O1Pbt8pO\lib\site-packages\discord\ext\commands\core.py", line 868, in invoke
  await self.prepare(ctx)
File "C:\Users\saltamimi\.virtualenvs\halobot-rewrite-O1Pbt8pO\lib\site-packages\discord\ext\commands\core.py", line 802, in prepare
  await self._parse_arguments(ctx)
File "C:\Users\saltamimi\.virtualenvs\halobot-rewrite-O1Pbt8pO\lib\site-packages\discord\ext\commands\core.py", line 710, in _parse_arguments
  transformed = await self.transform(ctx, param)
File "C:\Users\saltamimi\.virtualenvs\halobot-rewrite-O1Pbt8pO\lib\site-packages\discord\ext\commands\core.py", line 565, in transform
  return await self.do_conversion(ctx, converter, argument, param)
File "C:\Users\saltamimi\.virtualenvs\halobot-rewrite-O1Pbt8pO\lib\site-packages\discord\ext\commands\core.py", line 518, in do_conversion
  return await self._actual_conversion(ctx, converter, argument, param)
File "C:\Users\saltamimi\.virtualenvs\halobot-rewrite-O1Pbt8pO\lib\site-packages\discord\ext\commands\core.py", line 477, in _actual_conversion
  raise ConversionError(converter, exc) from exc
discord.ext.commands.errors.ConversionError: (<class 'discord.ext.commands.converter.MemberConverter'>, TypeError('Protocols cannot be instantiated'))

Now, again, I don't know where the specific spots are where this applies, all I know is this is a bug with Python 3.9.7 and from that, that's why I believe it's certainly easier to just block out 3.9.7 instead of making changes to the underlying codebase. This behavior was patched out on 3.10 and 3.9.6 is unaffected in my uses.

Well, on my hands, I'm working on Windows 10 with the 3.9.7 directly from python.org and it seemingly throws this error. Affected areas would primarily be wherever a class derives from a `Protocol` and we call `super().__init__()`. I'm not really familiar with d.py codebase or the additions you guys have made, however, this specific error was called from `discord/ext/commands/converter.py:116` Here's the full traceback: ```py Ignoring exception in command squads promote: Traceback (most recent call last): File "C:\Users\saltamimi\.virtualenvs\halobot-rewrite-O1Pbt8pO\lib\site-packages\discord\ext\commands\core.py", line 471, in _actual_conversion return await converter().convert(ctx, argument) File "C:\Users\saltamimi\.virtualenvs\halobot-rewrite-O1Pbt8pO\lib\site-packages\discord\ext\commands\converter.py", line 116, in __init__ super().__init__() File "C:\Program Files\Python39\lib\typing.py", line 1083, in _no_init raise TypeError('Protocols cannot be instantiated') TypeError: Protocols cannot be instantiated The above exception was the direct cause of the following exception: Traceback (most recent call last): File "C:\Users\saltamimi\.virtualenvs\halobot-rewrite-O1Pbt8pO\lib\site-packages\discord\ext\commands\bot.py", line 986, in invoke await ctx.command.invoke(ctx) File "C:\Users\saltamimi\.virtualenvs\halobot-rewrite-O1Pbt8pO\lib\site-packages\discord\ext\commands\core.py", line 1361, in invoke await ctx.invoked_subcommand.invoke(ctx) File "C:\Users\saltamimi\.virtualenvs\halobot-rewrite-O1Pbt8pO\lib\site-packages\discord\ext\commands\core.py", line 868, in invoke await self.prepare(ctx) File "C:\Users\saltamimi\.virtualenvs\halobot-rewrite-O1Pbt8pO\lib\site-packages\discord\ext\commands\core.py", line 802, in prepare await self._parse_arguments(ctx) File "C:\Users\saltamimi\.virtualenvs\halobot-rewrite-O1Pbt8pO\lib\site-packages\discord\ext\commands\core.py", line 710, in _parse_arguments transformed = await self.transform(ctx, param) File "C:\Users\saltamimi\.virtualenvs\halobot-rewrite-O1Pbt8pO\lib\site-packages\discord\ext\commands\core.py", line 565, in transform return await self.do_conversion(ctx, converter, argument, param) File "C:\Users\saltamimi\.virtualenvs\halobot-rewrite-O1Pbt8pO\lib\site-packages\discord\ext\commands\core.py", line 518, in do_conversion return await self._actual_conversion(ctx, converter, argument, param) File "C:\Users\saltamimi\.virtualenvs\halobot-rewrite-O1Pbt8pO\lib\site-packages\discord\ext\commands\core.py", line 477, in _actual_conversion raise ConversionError(converter, exc) from exc discord.ext.commands.errors.ConversionError: (<class 'discord.ext.commands.converter.MemberConverter'>, TypeError('Protocols cannot be instantiated')) ``` Now, again, I don't know where the specific spots are where this applies, all I know is this is a bug with Python 3.9.7 and from that, that's why I believe it's certainly easier to just block out 3.9.7 instead of making changes to the underlying codebase. This behavior was patched out on 3.10 and 3.9.6 is unaffected in my uses.
IAmTomahawkx commented 2021-10-06 21:50:26 +00:00 (Migrated from github.com)

A warning at the top of the readme is not appropriate for this kind of bug.
Honestly I don't see a reason to add this warning anywhere, we can simply point people to the python bug on the off chance that they come across this error. However if the others agree that they'd wish to add a notice, it'll have to be in strictly the affected area of the docs, not the top of the readme

A warning at the top of the readme is not appropriate for this kind of bug. Honestly I don't see a reason to add this warning anywhere, we can simply point people to the python bug on the off chance that they come across this error. However if the others agree that they'd wish to add a notice, it'll have to be in strictly the affected area of the docs, not the top of the readme
kuanhulio commented 2021-10-06 23:41:51 +00:00 (Migrated from github.com)

A warning at the top of the readme is not appropriate for this kind of bug. Honestly I don't see a reason to add this warning anywhere, we can simply point people to the python bug on the off chance that they come across this error. However if the others agree that they'd wish to add a notice, it'll have to be in strictly the affected area of the docs, not the top of the readme

This, I can respect. However, I'm unaware if there's more of these cases here. I'm fine with redoing it to the docs, but the question becomes where more instances like this happen with the codebases.

> A warning at the top of the readme is not appropriate for this kind of bug. Honestly I don't see a reason to add this warning anywhere, we can simply point people to the python bug on the off chance that they come across this error. However if the others agree that they'd wish to add a notice, it'll have to be in strictly the affected area of the docs, not the top of the readme This, I can respect. However, I'm unaware if there's more of these cases here. I'm fine with redoing it to the docs, but the question becomes where more instances like this happen with the codebases.
This pull request can be merged automatically.
You are not authorized to merge this pull request.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin kuanhulio/patch-1:kuanhulio/patch-1
git checkout kuanhulio/patch-1
Sign in to join this conversation.
No description provided.