okomestudio / mime-streamer Goto Github PK
View Code? Open in Web Editor NEWMIME content stream reader for Python
License: MIT License
MIME content stream reader for Python
License: MIT License
Currently, non-XOP response isn't gracefully handled when XOPResponseStreamer
is initialized with one:
xop = XOPResponseStreamer(resp)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <XOPResponseStreamer>, resp = <Response [500]>
def __init__(self, resp):
super(XOPResponseStreamer, self).__init__(resp)
> if self._ct_params['mime-type'].lower() != 'multipart/related':
E AttributeError: 'XOPResponseStreamer' object has no attribute '_ct_params'
../../../.virtualenvs/ingester/local/lib/python2.7/site-packages/mime_streamer/mime_response_streamer.py:110: AttributeError
Add more informative message when this happens.
This would be useful when flushing the read content is desired when an error is encountered while stream parsing the content. Perhaps add an optional argument to get_next_part
to switch the behavior within the context manager.
It's about time...
Also add instruction for running tests with Docker.
Multipart document can mix different newline sequence, e.g., the envelope assumes \r\n
as the canonical newline but content body embedded within a part can be multiline content delimited with \n
. In such a case, iter_lines
does not delimit on \n
, making stream-reading continue on until the full body is ready, which is a problem when the body is huge.
Fix it so that lines are constructed generically on any valid newline, but be careful to keep the newline actually used (i.e., do not assume all lines are delimited by \r\n
as in multipart message spec) and not to modify the actual byte sequence.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.