Comments (5)
OK, you can make a PR.
the all in the init.py fails, because I think all in Cython is a unicode object, something Python 2 doesn't like. I'd advocate changing the init.py to explicitly import everything needed instead of doing a from .. import *. This way you are in full control of what's exposed in the public API.
Good.
assertRaisesRegex which is missing. It'd need to be backported, or the test rewritten
as the regexes used aren't complicated.
Ideally, I'd like to see assertRaisesRegex
ported. I'll be doing more development in httptools later (proper http protocol implementation etc), and I'm used to assertRaisesRegex
.
subTest, either backported or the test rewritten.
We can write a rudimentary version for py2.
I recommend a tool like tox so we can easily run the tests on both Pythons.
OK.
the Makefile is geared towards Python 3, but doesn't do all that much. I just called the build_ext command myself with Python 2.
I'd prefer to keep the Makefile as is. Or, you can add a few more targets with a '2' suffix.
from httptools.
BTW, there is this package: https://github.com/benoitc/http-parser/
It appears it uses the same C parser and supports Python 2.
from httptools.
@faassen Are you working on any PR? Because if not (of if you haven't got too far) I'd like to close this issue. Since there is another similar package for Python 2, I see no point in migrating this one.
from httptools.
assertRaisesRegex is provided by unittest2, and is only needed for Python <= 2.6
Python 2.7 already supports it: https://docs.python.org/2/library/unittest.html#unittest.TestCase.assertRaisesRegexp
It was renamed in Py3.2: https://docs.python.org/3.5/library/unittest.html#unittest.TestCase.assertRaisesRegex
Adding this to the top of the test (or py2 compatibility shim):
try:
unittest.TestCase.assertRaisesRegex
except AttributeError:
unittest.TestCase.assertRaisesRegex = unittest.TestCase.assertRaisesRegexp
Will make it just work.
from httptools.
Alright, I'm closing this PR.
from httptools.
Related Issues (20)
- API change from 0.0.13->0.1.1 HOT 2
- Deprecation warnings in Python 3.10 HOT 3
- Wheel support for linux aarch64 HOT 1
- provide wheel for python3.9 HOT 9
- Note: httptools 0.0.13 from PyPI is incompatible with Python 3.9
- PROXY protocol v1 / v2 support
- [Security] Potential Secret Leak HOT 1
- Silent fail of long url parsing HOT 2
- Git release/tag for 0.2.0 pypi version HOT 2
- Wheels for httptools 0.2.0 on Python 3.10 HOT 1
- CVE-2021-22959 & CVE-2021-22960
- Doesn't build against Python 3.11 HOT 3
- Fail to get wheel for python 3.9.5 when pip install
- llhttp critical CVE's HOT 4
- How to do an early stop? HOT 2
- . HOT 1
- with curl and https HOT 1
- Error installing httptools as a uvicorn dependency HOT 2
- Create wheel for Python 3.12 HOT 1
- Support Cython 3.0+ HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from httptools.