Comments (3)
To add more detail - this is seen on the same host (VM) running Ubuntu 20.04. For both Python 2 and 3 I have a virtualenv with pip install convertdate
. convertdate
version is 2.2.1
for both of them.
from convertdate.
The short explanation is that the behavior of the Hebrew calendar isn't defined prior to the start of the universe.
The long explanation is that this is due to the differences between division in Python 2 and 3. One of the supporting functions (hebrew.delay_1
) performs a calculation that looks like this:
from math import trunc
trunc((235 * year - 234) / 19)
When year is positive, the result in Python2 and 3 is the same. When year is negative, they behave differently. The solution is to add from __future__ import division
to the top of the file. The other, perhaps more apt, solution would be to raise an error when year
is less than 1.
I'm going to mark this is low priority, since it involves making a change for an invalid calculation in a EOL'd version of the language.
from convertdate.
@fitnr I think it's reasonable for you to close this one, given that python2 was EOL January 1, 2020!
from convertdate.
Related Issues (20)
- Additional Hebrew Calendar Holidays HOT 2
- install fails with pytz 2020.1 HOT 4
- Confusing example in README HOT 1
- Some US Federal holidays are incorrect and/or incomplete. HOT 1
- Incorrect conversion in Bahá'í calendar for Ayyám-i-Há
- Ordinal is wrong for December 31st HOT 2
- Hebrew Calendar should include method to return date where Tishrei is 1 HOT 7
- hebrew.to_jd_gregorianyear(...) cannot unpack non-iterable float object HOT 5
- Julian Date converstion wrong for astronomical years less than -4716 HOT 2
- Islamic Julian Day conversion incorrect for julian day < 1948085.5 HOT 2
- indian_civil.from_gregorian() wrong for gregorian dates before November 25th, 4714 BCE HOT 1
- julian.leap() always truthy for BC years HOT 1
- Human Era support HOT 1
- Add Buddhist Calendar support HOT 1
- Add Babylonian Calendar support HOT 1
- Migrate CI to github workflows
- LGPL-3.0 dependency HOT 1
- Possibly incorrect results for hebrew calendar if years are small HOT 1
- hebrew.monthcalendar returns a 6-day week HOT 1
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 convertdate.