Replies: 1 comment 3 replies
-
I believe this is a bug in the async version of Microdot's |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I really like Microdot (which greatly resembles Sinatra, which I've used a lot in Ruby).
I'm using the latest version of Microdot-asyncio on an ESP32.
I would like to pre-compile my static files into frozen strings (and use
pkg_resources.resource_stream('static', 'filename')
).I've tried both that method (which returns an
io.BytesIO
object), and serving these files from my filesystem.I've tried returning an opened file handle in the
Response
, as well as usingsend_file()
.In all of the above cases, what I get is a
RuntimeError: generator raised StopIteration
exception:Templates (using
utemplate
) and static strings work fine in theResponse
s.Here's how I'm trying to return an opened file:
Using
send_file()
:Sending from compiled resources:
or sending from compiled resources using
send_file()
:Any suggestions?
Beta Was this translation helpful? Give feedback.
All reactions