Skip to content
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

Fix: crash in case of not installed pytz #318

Merged
merged 4 commits into from
Aug 23, 2022

Conversation

dnikolayev
Copy link
Contributor

@dnikolayev dnikolayev commented Jul 2, 2022

This small change fixes the crash In case of not installed pytz.

Here is example errors traceback:
Traceback (most recent call last): File ".../main.py", line 14, in <module> import arq.cli File "....../venv/lib/python3.9/site-packages/arq/__init__.py", line 1, in <module> from .connections import ArqRedis, create_pool # noqa F401 File "....../venv/lib/python3.9/site-packages/arq/connections.py", line 18, in <module> from .jobs import Deserializer, Job, JobDef, JobResult, Serializer, deserialize_job, serialize_job File "....../venv/lib/python3.9/site-packages/arq/jobs.py", line 13, in <module> from .utils import ms_to_datetime, poll, timestamp_ms File "....../venv/lib/python3.9/site-packages/arq/utils.py", line 38, in <module> def get_tz() -> Optional[pytz.BaseTzInfo]: AttributeError: 'NoneType' object has no attribute 'BaseTzInfo'

@codecov
Copy link

codecov bot commented Jul 2, 2022

Codecov Report

Merging #318 (291fe95) into main (40c8803) will not change coverage.
The diff coverage is 100.00%.

❗ Current head 291fe95 differs from pull request most recent head 0224cec. Consider uploading reports for the commit 0224cec to get more accurate results

@@           Coverage Diff           @@
##             main     #318   +/-   ##
=======================================
  Coverage   98.86%   98.86%           
=======================================
  Files          11       11           
  Lines         973      973           
  Branches      165      165           
=======================================
  Hits          962      962           
  Misses          6        6           
  Partials        5        5           
Impacted Files Coverage Δ
arq/utils.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 40c8803...0224cec. Read the comment docs.

@dnikolayev dnikolayev changed the title Fix: no crash in case of not installed pytz Fix: crash in case of not installed pytz Jul 2, 2022
arq/utils.py Outdated Show resolved Hide resolved
dnikolayev and others added 3 commits July 3, 2022 11:48
@samuelcolvin samuelcolvin enabled auto-merge (squash) August 23, 2022 12:18
@samuelcolvin
Copy link
Owner

thanks so much.

@samuelcolvin samuelcolvin merged commit 9f89664 into samuelcolvin:main Aug 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants