{"record":{"id":"f7f68e46ac6163fe","repo":"matplotlib/matplotlib","slug":"until-cannot-be-aware-if-dtstart-is-naive-and-tzin","errorCode":null,"errorMessage":"until cannot be aware if dtstart is naive and tzinfo is None","messagePattern":"until cannot be aware if dtstart is naive and tzinfo is None","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"lib/matplotlib/dates.py","lineNumber":993,"sourceCode":"        # zones, it's best to use naive zones and attach timezones once the\n        # datetimes are returned\n        if 'dtstart' in kwargs:\n            dtstart = kwargs['dtstart']\n            if dtstart.tzinfo is not None:\n                if tzinfo is None:\n                    tzinfo = dtstart.tzinfo\n                else:\n                    dtstart = dtstart.astimezone(tzinfo)\n\n                kwargs['dtstart'] = dtstart.replace(tzinfo=None)\n\n        if 'until' in kwargs:\n            until = kwargs['until']\n            if until.tzinfo is not None:\n                if tzinfo is not None:\n                    until = until.astimezone(tzinfo)\n                else:\n                    raise ValueError('until cannot be aware if dtstart '\n                                     'is naive and tzinfo is None')\n\n                kwargs['until'] = until.replace(tzinfo=None)\n\n        self._construct = kwargs.copy()\n        self._tzinfo = tzinfo\n        self._rrule = rrule(**self._construct)\n\n    def _attach_tzinfo(self, dt, tzinfo):\n        # pytz zones are attached by \"localizing\" the datetime\n        if hasattr(tzinfo, 'localize'):\n            return tzinfo.localize(dt, is_dst=True)\n\n        return dt.replace(tzinfo=tzinfo)\n\n    def _aware_return_wrapper(self, f, returns_list=False):\n        \"\"\"Decorator function that allows rrule methods to handle tzinfo.\"\"\"\n        # This is only necessary if we're actually attaching a tzinfo","sourceCodeStart":975,"sourceCodeEnd":1011,"githubUrl":"https://github.com/matplotlib/matplotlib/blob/b379c1b69e012b142c0f496a52bcb30513802d72/lib/matplotlib/dates.py#L975-L1011","documentation":"Error \"until cannot be aware if dtstart is naive and tzinfo is None\" thrown in matplotlib/matplotlib.","triggerScenarios":"Thrown at lib/matplotlib/dates.py:993 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"b379c1b69e012b142c0f496a52bcb30513802d72","analyzedAt":"2026-08-21T23:31:55.468Z","schemaVersion":2},"datasetVersion":"2026-08-22T04:17:13.399Z"}