We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
The tests
currently fail when running 'tox' on the main branch of opsdroid.
The error rises in this function (defined in opsdroid/connector/matrix/connector.py) for both tests:
async def _file_to_mxc_url(self, file_event): """Given a file event return the mxc url.""" uploaded = False mxc_url = None file_dict = None if file_event.url: url = urlparse(file_event.url) if url.scheme == "mxc": mxc_url = file_event.url if not mxc_url: encrypt_file = ( self._allow_encryption and file_event.target in self.connection.store.load_encrypted_rooms() ) upload_file = await file_event.get_file_bytes() mimetype = await file_event.get_mimetype() response = await self.connection.upload( lambda x, y: upload_file, content_type=mimetype, encrypt=encrypt_file ) response, file_dict = response
with this line throwing the error:
response, file_dict = response
E ValueError: not enough values to unpack (expected 2, got 0)
These errors rise for all versions of python tested by tox.
The text was updated successfully, but these errors were encountered:
Updated.txt
Sorry, something went wrong.
The above code will work without errors
async def _file_to_mxc_url(self, file_event):
"""Given a file event, return the mxc URL.""" uploaded = False mxc_url = None file_dict = None if file_event.url: url = urlparse(file_event.url) if url.scheme == "mxc": mxc_url = file_event.url if not mxc_url: encrypt_file = ( self._allow_encryption and file_event.target in self.connection.store.load_encrypted_rooms() ) upload_file = await file_event.get_file_bytes() mimetype = await file_event.get_mimetype() response = await self.connection.upload( lambda x, y: upload_file, content_type=mimetype, encrypt=encrypt_file ) if isinstance(response, tuple) and len(response) >= 2: response, file_dict = response else: response = None file_dict = None # Rest of your code...
No branches or pull requests
Description
The tests
currently fail when running 'tox' on the main branch of opsdroid.
Experienced Functionality
The error rises in this function (defined in opsdroid/connector/matrix/connector.py) for both tests:
with this line throwing the error:
E ValueError: not enough values to unpack (expected 2, got 0)
Versions
These errors rise for all versions of python tested by tox.
The text was updated successfully, but these errors were encountered: