diff --git a/lms/djangoapps/instructor/tests/test_api.py b/lms/djangoapps/instructor/tests/test_api.py index 21663faf40..08a27a0619 100644 --- a/lms/djangoapps/instructor/tests/test_api.py +++ b/lms/djangoapps/instructor/tests/test_api.py @@ -3550,7 +3550,7 @@ class TestInstructorSendEmail(SiteMixin, SharedModuleStoreTestCase, LoginEnrollm self.full_test_message['schedule'] = "Blub Glub" self.full_test_message['browser_timezone'] = "America/New_York" expected_messages = [ - "Error occurred while attempting to create a scheduled bulk email task: Unknown string format: Blub Glub", + "Error occurred while attempting to create a scheduled bulk email task: unknown string format", ] url = reverse('send_email', kwargs={'course_id': str(self.course.id)}) diff --git a/openedx/core/djangoapps/content/block_structure/block_structure.py b/openedx/core/djangoapps/content/block_structure/block_structure.py index f51f2ce599..a8d10c4d81 100644 --- a/openedx/core/djangoapps/content/block_structure/block_structure.py +++ b/openedx/core/djangoapps/content/block_structure/block_structure.py @@ -11,12 +11,9 @@ The following internal data structures are implemented: from copy import deepcopy -from datetime import datetime from functools import partial from logging import getLogger -from dateutil.tz import tzlocal - from openedx.core.lib.graph_traversals import traverse_post_order, traverse_topologically from .exceptions import TransformerException @@ -467,20 +464,7 @@ class BlockStructureBlockData(BlockStructure): not found. """ block_data = self._block_data_map.get(usage_key) - xblock_field = getattr(block_data, field_name, default) if block_data else default - - if isinstance(xblock_field, datetime): - # Creating a new datetime object to avoid issues occuring due to upgrading - # python-datetuil version from 2.4.0 - # - # More info: https://openedx.atlassian.net/browse/BOM-2245 - if isinstance(xblock_field.tzinfo, tzlocal) and not hasattr(xblock_field.tzinfo, '_hasdst'): - return datetime( - year=xblock_field.year, month=xblock_field.month, day=xblock_field.day, - hour=xblock_field.hour, minute=xblock_field.minute, second=xblock_field.second, - tzinfo=tzlocal() - ) - return xblock_field + return getattr(block_data, field_name, default) if block_data else default def override_xblock_field(self, usage_key, field_name, override_data): """ diff --git a/requirements/constraints.txt b/requirements/constraints.txt index 747428c389..3af7d27891 100644 --- a/requirements/constraints.txt +++ b/requirements/constraints.txt @@ -27,14 +27,23 @@ django-storages<1.9 # for them. edx-enterprise==3.49.5 +# Newer versions need a more recent version of python-dateutil +freezegun==0.3.12 + # oauthlib>3.0.1 causes test failures ( also remove the django-oauth-toolkit constraint when this is fixed ) oauthlib==3.0.1 # django-auth-toolkit==1.3.3 requires oauthlib>=3.1.0 which is pinned because of test failures django-oauth-toolkit<=1.3.2 -# Will be updated once we update python-dateutil package +# Upgrading to 2.5.3 on 2020-01-03 triggered "'tzlocal' object has no attribute '_std_offset'" errors in production +python-dateutil==2.4.0 +# matplotlib>=3.4.0 requires python-dateutil>=2.7 matplotlib<3.4.0 +# pandas>0.22.0 requires python-dateutil>=2.5.0 +pandas==0.22.0 +# networkx>=2.6 requires pandas>=1.1 +networkx<2.6 # tests failing for pymongo==3.11 pymongo<3.11 diff --git a/requirements/edx-sandbox/py38.txt b/requirements/edx-sandbox/py38.txt index 992361363c..8fde6fc3ff 100644 --- a/requirements/edx-sandbox/py38.txt +++ b/requirements/edx-sandbox/py38.txt @@ -18,6 +18,8 @@ cryptography==37.0.2 # via -r requirements/edx-sandbox/py38.in cycler==0.11.0 # via matplotlib +decorator==4.4.2 + # via networkx joblib==1.1.0 # via nltk kiwisolver==1.4.2 @@ -36,8 +38,10 @@ matplotlib==3.3.4 # -r requirements/edx-sandbox/py38.in mpmath==1.2.1 # via sympy -networkx==2.8 - # via -r requirements/edx-sandbox/py38.in +networkx==2.5.1 + # via + # -c requirements/edx-sandbox/../constraints.txt + # -r requirements/edx-sandbox/py38.in nltk==3.7 # via # -r requirements/edx-sandbox/py38.in @@ -61,8 +65,10 @@ pyparsing==3.0.9 # chem # matplotlib # openedx-calc -python-dateutil==2.8.2 - # via matplotlib +python-dateutil==2.4.0 + # via + # -c requirements/edx-sandbox/../constraints.txt + # matplotlib random2==1.0.1 # via -r requirements/edx-sandbox/py38.in regex==2022.4.24 diff --git a/requirements/edx/base.txt b/requirements/edx/base.txt index f7692f5efa..c86e5eb722 100644 --- a/requirements/edx/base.txt +++ b/requirements/edx/base.txt @@ -834,8 +834,9 @@ pysrt==1.1.2 # via # -r requirements/edx/base.in # edxval -python-dateutil==2.8.2 +python-dateutil==2.4.0 # via + # -c requirements/edx/../constraints.txt # -r requirements/edx/base.in # analytics-python # botocore diff --git a/requirements/edx/development.txt b/requirements/edx/development.txt index a417d513c4..d8f9de315a 100644 --- a/requirements/edx/development.txt +++ b/requirements/edx/development.txt @@ -698,8 +698,10 @@ filelock==3.7.0 # -r requirements/edx/testing.txt # tox # virtualenv -freezegun==1.2.1 - # via -r requirements/edx/testing.txt +freezegun==0.3.12 + # via + # -c requirements/edx/../constraints.txt + # -r requirements/edx/testing.txt frozenlist==1.3.0 # via # -r requirements/edx/testing.txt @@ -1174,8 +1176,9 @@ pytest-randomly==3.12.0 # via -r requirements/edx/testing.txt pytest-xdist[psutil]==2.5.0 # via -r requirements/edx/testing.txt -python-dateutil==2.8.2 +python-dateutil==2.4.0 # via + # -c requirements/edx/../constraints.txt # -r requirements/edx/testing.txt # analytics-python # botocore @@ -1342,6 +1345,7 @@ six==1.16.0 # edx-rbac # edx-sphinx-theme # event-tracking + # freezegun # fs # fs-s3fs # html5lib diff --git a/requirements/edx/testing.txt b/requirements/edx/testing.txt index 747a9ac678..390da4feb0 100644 --- a/requirements/edx/testing.txt +++ b/requirements/edx/testing.txt @@ -673,8 +673,10 @@ filelock==3.7.0 # via # tox # virtualenv -freezegun==1.2.1 - # via -r requirements/edx/testing.in +freezegun==0.3.12 + # via + # -c requirements/edx/../constraints.txt + # -r requirements/edx/testing.in frozenlist==1.3.0 # via # -r requirements/edx/base.txt @@ -1105,8 +1107,9 @@ pytest-randomly==3.12.0 # via -r requirements/edx/testing.in pytest-xdist[psutil]==2.5.0 # via -r requirements/edx/testing.in -python-dateutil==2.8.2 +python-dateutil==2.4.0 # via + # -c requirements/edx/../constraints.txt # -r requirements/edx/base.txt # analytics-python # botocore @@ -1268,6 +1271,7 @@ six==1.16.0 # edx-milestones # edx-rbac # event-tracking + # freezegun # fs # fs-s3fs # html5lib