Code does not run when there is a __pycache__ folder
Summary
The code wont run when the pycache folder is in the cogs folder.
Reproduction Steps
Run the existing code with pycord 2.0.0. The code wont run unless the pycache folder is deleted. This needs to be done everytime the code is run.
Minimal Reproducible Code
for cog in listdir(path.join(path.dirname(path.abspath(__file__)), "cogs")):
if cog.endswith(".py"):
client.load_extension(f"cogs.{cog[:-3]}")
else:
print(f'unable to load {cog[:-3]}') #loads in all the cogs in the specified folder
Expected Results
The expected result is for it to load in all the cogs, and display the message "unable to load __pycach"(last 3 characters cut off because of the code).
Actual Results
The actual result is this error message:
Traceback (most recent call last):
File "c:\Users\prath\Desktop\Python\Projects\discord bot\DiscordBot.py", line 32, in
Intents
intents = discord.Intents.all()
System Information
- Python v3.9.6-final
- pycord v2.0.0-alpha
- pycord pkg_resources: v0.0.1
- aiohttp v3.7.4.post0
- system info: Windows 10 10.0.22000
Checklist
- [X] I have searched the open issues for duplicates.
- [X] I have shown the entire traceback, if possible.
- [X] I have removed my token from display, if visible.
Additional Context
No response
Not a bug, there is something wrong with your code logic.
it works sometimes, sometimes it doesnt. i'll check my code once
Not a bug, there is something wrong with your code logic.
It is a bug. Someone removed ExtensionFailed from commands.errors. And didn't fix it with commands.Bot.
Oh ok
But still though, why does it work sometimes, and doesnt work at others?
Not a bug, there is something wrong with your code logic.
It is a bug. Someone removed ExtensionFailed from commands.errors. And didn't fix it with commands.Bot.
That is a known bug. I was talking about the ExtensionFailed error, not the AttributeError.
#109 pull request fixes it.