{"action":"created","issue":{"url":"https://api.github.com/repos/gauteh/astroid/issues/132","repository_url":"https://api.github.com/repos/gauteh/astroid","labels_url":"https://api.github.com/repos/gauteh/astroid/issues/132/labels{/name}","comments_url":"https://api.github.com/repos/gauteh/astroid/issues/132/comments","events_url":"https://api.github.com/repos/gauteh/astroid/issues/132/events","html_url":"https://github.com/gauteh/astroid/issues/132","id":154423274,"number":132,"title":"astroid crashes with nonsensical query","user":{"login":"mardukbp","id":1140106,"avatar_url":"https://avatars.githubusercontent.com/u/1140106?v=3","gravatar_id":"","url":"https://api.github.com/users/mardukbp","html_url":"https://github.com/mardukbp","followers_url":"https://api.github.com/users/mardukbp/followers","following_url":"https://api.github.com/users/mardukbp/following{/other_user}","gists_url":"https://api.github.com/users/mardukbp/gists{/gist_id}","starred_url":"https://api.github.com/users/mardukbp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mardukbp/subscriptions","organizations_url":"https://api.github.com/users/mardukbp/orgs","repos_url":"https://api.github.com/users/mardukbp/repos","events_url":"https://api.github.com/users/mardukbp/events{/privacy}","received_events_url":"https://api.github.com/users/mardukbp/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/gauteh/astroid/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/gauteh/astroid/labels/need-info","name":"need-info","color":"d4c5f9"},{"url":"https://api.github.com/repos/gauteh/astroid/labels/notmuch","name":"notmuch","color":"fbca04"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":26,"created_at":"2016-05-12T08:18:49Z","updated_at":"2016-05-21T07:25:11Z","closed_at":"2016-05-17T16:35:30Z","body":"By accident I discovered that performing the following query a few times (one after the other) crashes astroid:\r\n\r\n`tag:flagged from:2015..`\r\n\r\nI am using version v0.5.r164.ged2256a compiled from git in Arch."},"comment":{"url":"https://api.github.com/repos/gauteh/astroid/issues/comments/220763626","html_url":"https://github.com/gauteh/astroid/issues/132#issuecomment-220763626","issue_url":"https://api.github.com/repos/gauteh/astroid/issues/132","id":220763626,"user":{"login":"gauteh","id":56827,"avatar_url":"https://avatars.githubusercontent.com/u/56827?v=3","gravatar_id":"","url":"https://api.github.com/users/gauteh","html_url":"https://github.com/gauteh","followers_url":"https://api.github.com/users/gauteh/followers","following_url":"https://api.github.com/users/gauteh/following{/other_user}","gists_url":"https://api.github.com/users/gauteh/gists{/gist_id}","starred_url":"https://api.github.com/users/gauteh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gauteh/subscriptions","organizations_url":"https://api.github.com/users/gauteh/orgs","repos_url":"https://api.github.com/users/gauteh/repos","events_url":"https://api.github.com/users/gauteh/events{/privacy}","received_events_url":"https://api.github.com/users/gauteh/received_events","type":"User","site_admin":false},"created_at":"2016-05-21T07:25:11Z","updated_at":"2016-05-21T07:25:11Z","body":"Marduk Bolaños writes on mai 20, 2016 22:47:\n>> but we cannot implement it better or anticipate all the ingenious ways\n>> a user may enter a faulty query.\n> \n> I apologize for being so persistent with this, but it really interests\n> me and I want to learn. I appreciate your patience.\n> \n> From my naive point of view, if you know exactly what is the structure\n> of a valid query then anything that does not comply with it is by\n> definition an invalid query. Therefore, you do not have to care about\n> all the possible ways to formulate an invalid query.\n> \n> My naive implementation of a query parser would do this. Given a query,\n> search for \"words\" delimited by quotes (these are strings of words\n> separated by spaces), store them in a list and remove them from the\n> query. Given the new query split it at every occurrence of the space\n> character. This results in a list of words. Given a word search for a\n> colon character. If you find it, then split the word in a left and a\n> right part. In the left part you will only accept words that belong to\n> the list of prefixes. If the left part is date, then on the right part\n> you will only accept dates and ranges that conform to the formats\n> specified in the manual. If the left part is not date, then on the right\n> part you will not interpret .. as a range.\n> \n> This very likely does not cover all cases, but so far is it reasonable?\n\nBut it is totally pointless when there already is a complete, tested,\nfully-functional, always-up-to-date, fast, easy-to-use, and ready\nquery-parser including validator ready in Xapian.  So yes, it could\nprobably catch some cases, it would probably get some false positives as\nwell (which would prevent the user from doing legitimate queries). But\nunless it is complete and perfect, what is the point?\n\nParsers are hard to get right, it would require a lot of work to make it\ngood. And whenever something changes upstream we would lag behind, or do\nsomething wrong depending on the version the user has installed.\n\nWhat do you think would be the difference in behaviour if we implemented it\nourselves?\n \n>> Please try again the latest commit, I forgot a check.\n> \n> I tried the latest commit and it crashed again with the query\n> `tag:flagged dat:2015..`.\n\nWhat is the backtrace? Please send the log as well.\n"}}
{"actor":{"display_login":"gauteh"}}