Looping Functionality On Discord Bot Doesn't Work - python

Whenever I try to use this looping functionality, it gives me an error that has lines that are further than the end of my code. I am fairly new to python and coding in general, but I think this is part of a repository I downloaded. The error code looks like this
Traceback (most recent call last):
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/player.py", line 603, in run
self._do_run()
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/player.py", line 590, in _do_run
data = self.source.read()
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/player.py", line 543, in read
ret = self.original.read()
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/player.py", line 228, in read
ret = self._stdout.read(OpusEncoder.FRAME_SIZE)
AttributeError: 'NoneType' object has no attribute 'read'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/player.py", line 616, in _call_after
self.after(error)
File "main.py", line 242, in play_next_song
raise VoiceError(str(error))
VoiceError: 'NoneType' object has no attribute 'read'
My Entire code block is here. I am trying to host this discord bot in repl.it, if that has anything to do with it.
Any help would be appreciated, Thanks!

The relevant part of the stacktrace is actually the last one:
File "main.py", line 242, in play_next_song
raise VoiceError(str(error))
VoiceError: 'NoneType' object has no attribute 'read'
You cannot use the same FFmpegPCMAudio object twice. You have the create a new one.

Related

Python error vision-1.0.0-py3.10-nspkg.pth:

Whenever I run python I get this error message:
Error processing line 1 of D:\Users\RBS\AppData\Local\Programs\Python\Python310\lib\site-packages\vision-1.0.0-py3.10-nspkg.pth:
Traceback (most recent call last):
File "D:\Users\RBS\AppData\Local\Programs\Python\Python310\lib\site.py", line 186, in addpackage
exec(line)
File "", line 1, in
File "", line 568, in module_from_spec
AttributeError: 'NoneType' object has no attribute 'loader'
What is this error and how to fix it?
Sounds a lot like what I saw at: AttributeError: 'NoneType' object has no attribute 'loader'
Based on their comments what worked for me was going to C:\Users\"username"\anaconda3\envs\"Project name" then looking for a file called "vision-1.0.0-py3.7-nspkg.pth" and deleting it.
Ran into this post before having seen the other one, thought I'd share. Solved the error for me but not sure if removing the files would give any sort of problem later on.

"AttributeError: 'NoneType' object has no attribute 'thread'" Error while committing in Kaggle

I'm getting the following error when I try to commit on Kaggle.
Error in atexit._run_exitfuncs: Traceback (most recent call last): File "/opt/conda/lib/python3.6/logging/__init__.py", line 1944, in shutdown h.flush() File "/opt/conda/lib/python3.6/site-packages/absl/logging/__init__.py", line 882, in flush self._current_handler.flush() File "/opt/conda/lib/python3.6/site-packages/absl/logging/__init__.py", line 776, in flush self.stream.flush() File "/opt/conda/lib/python3.6/site-packages/ipykernel/iostream.py", line 341, in flush if self.pub_thread.thread.is_alive(): AttributeError: 'NoneType' object has no attribute 'thread'
Does anyone know how to solve this?
Thanks.
I think this is an ipykernel related issue that has an upstream fix which hasn't been packaged into a release yet. So you might have to wait.
You wrote something like y = x.thread or x.thread() The problem is, x was None. None doesn't have a member variable named "thread"

TypeError: 'str' object is not callable when trying to run a bot command

[Cont. of my last two posts]
After upgrading aiohttp and fixing the import issue with "main", I ran into another error while trying to run a command from the Discord bot. Is there any way to fix this?
Ignoring exception in command botcheck
Traceback (most recent call last):
File "C:\Users\Jeriel\AppData\Local\Programs\Python\Python36-32\lib\site-packa
ges\discord\ext\commands\core.py", line 50, in wrapped
ret = yield from coro(*args, **kwargs)
File "C:\Users\Jeriel\Desktop\JerryBot\run.py", line 15, in botcheck
await bot.say("I am up and running! {}".format(ctx.message.author.mention())
)
TypeError: 'str' object is not callable
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "C:\Users\Jeriel\AppData\Local\Programs\Python\Python36-32\lib\site-packa
ges\discord\ext\commands\bot.py", line 846, in process_commands
yield from command.invoke(ctx)
File "C:\Users\Jeriel\AppData\Local\Programs\Python\Python36-32\lib\site-packa
ges\discord\ext\commands\core.py", line 374, in invoke
yield from injected(*ctx.args, **ctx.kwargs)
File "C:\Users\Jeriel\AppData\Local\Programs\Python\Python36-32\lib\site-packa
ges\discord\ext\commands\core.py", line 54, in wrapped
raise CommandInvokeError(e) from e
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: Typ
eError: 'str' object is not callable
Just realized a typo was the issue. Oopsies..

AttributeError: '_GzipStreamFile' object has no attribute '_checkReadable

I am trying to setup commonsearch and i am the point where backend imports alexa1m data to rocksdb, but it die with error( error below ).
Traceback (most recent call last):
File "urlserver/import.py", line 21, in <module>
ds.import_dump()
File "./urlserver/datasources/__init__.py", line 62, in import_dump
for i, row in self.iter_dump():
File "./urlserver/datasources/__init__.py", line 102, in iter_dump
f = self.open_dump()
File "./urlserver/datasources/__init__.py", line 144, in open_dump
return GzipStreamFile(f)
File "/cosr/back/venv/src/gzipstream/gzipstream/gzipstreamfile.py", line 62, in __init__
super(GzipStreamFile, self).__init__(self._gzipstream)
File "/usr/lib64/python2.6/io.py", line 921, in __init__
raw._checkReadable()
AttributeError: '_GzipStreamFile' object has no attribute '_checkReadable'
have been fighting with this without progress for 2 days now.. if somebody could givme somekind of insight or advice i would be more than happy!
Found the solution, it was problem in the data parsed to the tool, not the tool itself.

GetItem(),ItemCount(),SubElements() functions not working in pywinauto

I'm trying to automate tasks for teamcenter using pywinauto python module.But I was not able to work properly with TreeViews. When ever I'm trying to use GetItem(),SubElements(),Item() and many other function under _treeview_element giving error.Please look into below errors.
I'm using python 2.7 and i also have pywin32 module installed
for i in range(tr.ItemCount()):
print tr.GetItem(i)
Traceback (most recent call last):
File "<pyshell#61>", line 2, in <module>
print tr.GetItem(i) File "C:\Users\patibj\Desktop\pywinauto-
master\pywinauto\controls\common_controls.py", line 1010, in GetItem
if isinstance(path[0], int):
TypeError: 'int' object has no attribute '__getitem__'
This is when i'm trying to use GetChild()
a[0] is <pywinauto.controls.common_controls._treeview_element object at 0x02EC11B0> a[0].GetChild((1))
Traceback (most recent call last):
File "<pyshell#49>", line 1, in <module>
a[0].GetChild((1))
File "C:\Users\patibj\Desktop\pywinauto- master\pywinauto\controls\common_controls.py", line 840, in GetChild
return self.Children()[index]
File "C:\Users\patibj\Desktop\pywinauto-master\pywinauto\controls\common_controls.py", line 739, in Children
if self.Item().cChildren not in (0, 1):
File "C:\Users\patibj\Desktop\pywinauto-master\pywinauto\controls\common_controls.py", line 539, in Item
return self._readitem()[0]
File "C:\Users\patibj\Desktop\pywinauto-master\pywinauto\controls\common_controls.py", line 904, in _readitem
raise ctypes.WinError() WindowsError: [Error 0] The operation completed successfully.
Please help me out .Thanks in advance.
TreeViewWrapper.GetItem() method gets path argument which should be the string starting with back-slash \\ symbol. Example:
app.Dialog.TreeView.GetItem('\\1st_level_item_name\\2ndlevelitem').Click()
For access by index use a list of integers:
app.Dialog.TreeView.GetItem([1, 0])
GetChild() works with explorer.exe TreeView:
>>> tree.GetItem([1]).GetChild(2).Text()
u'Computer'

Categories