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

Formats allowed to be sent #5

Open
uhlhosting opened this issue Jul 29, 2018 · 1 comment
Open

Formats allowed to be sent #5

uhlhosting opened this issue Jul 29, 2018 · 1 comment

Comments

@uhlhosting
Copy link

tried to send an archive, what formats are supported only .txt?

Revenger:~ cosmicsound$ patter -c town-square -f Archive.zip 
Traceback (most recent call last):
  File "/usr/local/bin/patter", line 60, in <module>
    patter.send_message()
  File "/usr/local/lib/python3.7/site-packages/patter/patter.py", line 83, in send_message
    attached_file_id = self._attach_file(self.filename, channel_id)
  File "/usr/local/lib/python3.7/site-packages/patter/patter.py", line 193, in _attach_file
    files={"files": (filename, open(filename))}
  File "/usr/local/lib/python3.7/site-packages/mattermostdriver/endpoints/files.py", line 11, in upload_file
    files=files
  File "/usr/local/lib/python3.7/site-packages/mattermostdriver/client.py", line 169, in post
    return self.make_request('post', endpoint, options=options, params=params, data=data, files=files).json()
  File "/usr/local/lib/python3.7/site-packages/mattermostdriver/client.py", line 137, in make_request
    files=files
  File "/usr/local/lib/python3.7/site-packages/requests/api.py", line 112, in post
    return request('post', url, data=data, json=json, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/requests/api.py", line 58, in request
    return session.request(method=method, url=url, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/requests/sessions.py", line 498, in request
    prep = self.prepare_request(req)
  File "/usr/local/lib/python3.7/site-packages/requests/sessions.py", line 441, in prepare_request
    hooks=merge_hooks(request.hooks, self.hooks),
  File "/usr/local/lib/python3.7/site-packages/requests/models.py", line 312, in prepare
    self.prepare_body(data, files, json)
  File "/usr/local/lib/python3.7/site-packages/requests/models.py", line 500, in prepare_body
    (body, content_type) = self._encode_files(files, data)
  File "/usr/local/lib/python3.7/site-packages/requests/models.py", line 159, in _encode_files
    fdata = fp.read()
  File "/usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/lib/python3.7/codecs.py", line 322, in decode
    (result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb4 in position 11: invalid start byte
Revenger:~ cosmicsound$ patter -c town-square -f ~/.ssh/config 
Revenger:~ cosmicsound$ 

@Brodan
Copy link
Owner

Brodan commented Aug 2, 2018

Hey @uhlhosting, not sure why that isn't working. The ability to attach files is pretty new and I guess I only test it with .txt files. I'll start looking into ASAP.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants