-
Notifications
You must be signed in to change notification settings - Fork 70
uurequests: Compatibility with CPython #49
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
Comments
"method", "path" and "host" are all variables of regular string type, which doesn't interpolate well into bytestrings. This change will resolve pfalcon#49.
"method", "path" and "host" are all variables of regular string type, which doesn't interpolate well into bytestrings. This change will resolve pfalcon#49.
There's no problem here. Pycopy is a simpler implementation than Python, and due to this, also offers useful efficiency shortcuts. In particular, in Pycopy, strings explicitly use utf-8 encoding. This allows to intermix them with All this is not a problem for modules like |
Dear Paul, we haven't meant to outline a problem here, but rather an improvement. We are conceiving a CPython-based test harness for our Terkin Datalogger, which might also spark your interest [1]. Thus, we have a strong need to invoke MicroPython programs on CPython. As others are also looking at MicroPython/CPython compatibility, we thought it would be a good idea to contribute such improvements to the community. The full changes to make this work can be investigated at [2]. The outcome where this is used can be inspected at [3]. With kind regards, [1] https://github.com/hiveeyes/terkin-datalogger/tree/master/test |
Thanks for sharing info about your development, I appreciate that (both the info and development). I also fully agree that for some modules of Pycopy ecosystem, compatibility with CPython is useful and/or important. An obvious example of that is https://github.com/pfalcon/picotui/ , which is supported for both Pycopy and CPython (and by extension, with any Python implementation compatible with CPython). But again,
That sounds interesting, but even more interesting would be implementing a Pycopy-based self-hosted solution. Because otherwise, there're very many solutions available for CPython, which you can use right away. |
Sure. Do you know whether |
Another note for others coming here: If you need a CPython-compatible |
Currently, pycopy-lib offers 2 test modules:
I doubt that any big CPython project can be just run under Pycopy. For ScratchABlock, I did a reasonable amount of adding missing functionality to Pycopy, and I'm happy to report that I was able to do that by putting my actions where my ideas/words are, and add most of the needed functionality in pure Python, on the pycopy-lib side, instead of patching C code. But that's because I'm the author of ScratchABlock, and I know that it's written utilizing Python as a "generic object-oriented language with functional programming elements", not as "bag of dirty tricks", which is sadly how a lot of Python software is written. |
Dear Paul, thanks for sharing these insights about the state of testing within Pycopy. I will try to stay on my path of using With kind regards, |
Uh oh!
There was an error while loading. Please reload this page.
Hi there,
when invoking the
uurequests
module on CPython, it will croak withwhen starting to write to the socket stream:
This has also been reported on adafruit/Adafruit_CircuitPython_Requests#10 and was fixed by adafruit/Adafruit_CircuitPython_Requests#11.
With kind regards,
Andreas.
The text was updated successfully, but these errors were encountered: