Comments (12)
from check-jsonschema.
@balihb I have seen OverflowError
pop up with datetime operations on Windows when it's a 32-bit version of Python. Would you run the following to help identify whether this is 32-bit or 64-bit Python?
python -c "import sys; print(sys.version)"
That should help focus the troubleshooting effort, by either identifying -- or eliminating -- one possible cause for that OverflowError
. Thanks!
from check-jsonschema.
from check-jsonschema.
ok, I have two solution:
def _lastmod_from_response(self, response: requests.Response) -> float:
if "last-modified" in response.headers:
return time.mktime(
time.strptime(
response.headers.get("last-modified"),
self._LASTMOD_FMT,
)
)
else:
return time.mktime(time.gmtime(2*86400)) - 2*86400
but I think this should be enough:
def _lastmod_from_response(self, response: requests.Response) -> float:
if "last-modified" in response.headers:
return time.mktime(
time.strptime(
response.headers.get("last-modified"),
self._LASTMOD_FMT,
)
)
else:
return 0
from check-jsonschema.
Thanks for the bug report!
I wasn't able to reproduce this. In fact, I'm not able to use that schema at all, as it does not appear to be a valid JSON Schema. Checking it with --check-metaschema
fails with a long list of errors.
Maybe the schema has changed between the time of your report and my test? I don't have a lot of bandwidth to look into this right now, but if the schema is valid, that would mean something is wrong with the validation currently done under --check-metaschema
.
from check-jsonschema.
from check-jsonschema.
I was trying on Windows. might it be a problem with platform support?
It shouldn't be, but also it shouldn't fail at all so I'm remaining open-minded. 😉
Could you post the results of running one of the failing commands with --traceback-mode full
?
My current suspicion is that something is amiss with the handling of Last-Modified
times for file downloads, but it's not something I've seen before, so I need a bit more info to track it down.
from check-jsonschema.
Thanks @balihb, and have a great weekend!
from check-jsonschema.
similar issue I've found:
neo4j/neo4j-python-driver#302
also from the time doc:
The earliest date for which it can generate a time is platform-dependent.
from check-jsonschema.
using dateutils might also be a good option:
https://dateutil.readthedocs.io/en/stable/parser.html#dateutil.parser.parse
https://stackoverflow.com/a/52157795
from check-jsonschema.
Thanks for running this issue down and sharing your research!
@kurtmckee and I chatted about this a little bit, and I'm going to take a slightly different approach to fixing this, using try-except
to handle a few different cases.
I'll post a PR shortly, so you'll be able to see the fix with tests, but the additional scenarios we wanted to handle include:
Last-Modified
was present but malformed (unparseable)Last-Modified
was present with a value which triggers the OverflowError
@balihb, I'll make sure to credit you for your work in the changelog! 👍
from check-jsonschema.
This should be fixed in v0.23.2 which I just released.
Please let me know if you still see this problem or run into other issues!
from check-jsonschema.
Related Issues (20)
- Support for choosing a `jsonschema.validator` HOT 4
- Validating a deeply nested schema using custom "strict" draft 2020 metaschema can be very slow HOT 3
- --verbose doesn't seem to be anymore verbose than without it HOT 3
- Validation fails when expression is used in `matrix.include` HOT 4
- Support loading of GitLab `!reference` data during validation HOT 1
- Update to use the `referencing` implementation of ref resolution from `jsonschema` HOT 1
- Ref resolve failure when using custom metaschema HOT 13
- FailedDownloadError HOT 4
- Version 0.24.0 Failure resolving $ref within schema HOT 7
- Make the default regex mode use `regress` for JS-flavor regex format validation HOT 4
- GitLab CI yaml vaiarbles failing HOT 7
- Feature request: Allow validation of $schema specified in JSON file HOT 6
- version 0.26.1 is failing
- Output of all validated files if verbose: true HOT 4
- Bug with field named 'type' definition in '$defs' HOT 2
- Scipt hanging with json input not complying with schema HOT 2
- Support verbose output in pre-commit hook HOT 2
- Q: equivalent to old CLI syntax? HOT 3
- Warn when using schema features annotated with `"deprecated": true` 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 check-jsonschema.