scrapinghub / scrapinghub/dateparser

Incorrect result

Open
#1,065 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
2.9k
Forks
520
Avg merge
22h 56m
Merged PRs (30d)
6

Description

In [37]: dateparser.parse(date_string="11 de a")
Out[37]: 
datetime.datetime(
    year=2011,
    month=7,
    day=14,
    hour=15,
    minute=57,
    second=17,
    microsecond=334749
)

It happens a lot with strings of the format "\d\d \W\ \W\W", and not with strings longer and shorter than that.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the exact dateparser.parse(date_string="11 de a") example and inspect the parser entry points that handle strings of this length. Determine the intended behavior for this malformed-looking input, then add regression coverage showing that behavior; the issue does not name a source file or existing test to run.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.