Page MenuHomePhabricator

Request.__setitem__ does not do what the docstring suggests
Open, HighPublic

Description

@jayvdb added support for datetime in 9245e04ebe0ff1ebe30addfa84f34a69019c3e5d
@XZise added support for bools in cadd9615d678728133a9341358405c5afb6224cb but forgot to update the docstring?

Event Timeline

valhallasw raised the priority of this task from to Needs Triage.
valhallasw updated the task description. (Show Details)
valhallasw added a project: Pywikibot.
valhallasw added subscribers: valhallasw, XZise, jayvdb.
Restricted Application added subscribers: Aklapper, Unknown Object (MLST). · View Herald TranscriptMay 17 2015, 4:26 PM

It's inconsistent now in any case:

__setattr__(..., bytes) -> sets unicode ?
__setattr__(..., list(bytes)) -> sets list(bytes)

Also, as far as I can see, passing a string is broken now because list('abc') = ['a', 'b', 'c']...

Before 954825e17c5f979c87d51d6bc18347133fb119b2 __setitem__ expected either bytes or unicode. But then it was changed that each parameter internally contains a list which was generated by splitting the value along the pipes when the value was bytes or unicode. And with that it allowed devs to add lists themselves containing any type and it wouldn't touch these. It converts only bytes/unicode into the list.

Also __setitem__ doesn't “convert“ any values anymore with my change but instead now only _encoded_items and that is not modifying the dictionary Request is using to hold the parameters. So yes the docstring is not up to date but there is a reason behind all of that.

Xqt triaged this task as Unbreak Now! priority.Aug 26 2016, 7:42 AM
Aklapper lowered the priority of this task from Unbreak Now! to High.Jan 2 2017, 1:16 PM

Obviously not "Unbreak Now!" priority as this has been open for four months. Decreasing.

Xqt raised the priority of this task from High to Needs Triage.Feb 3 2019, 11:36 AM
Xqt moved this task from Needs Review to Backlog on the Pywikibot board.
Xqt triaged this task as High priority.Feb 4 2019, 11:34 AM
Aklapper added a subscriber: Magul.

@Magul: I am resetting the assignee of this task because there has not been progress lately (please correct me if I am wrong!). Resetting the assignee avoids the impression that somebody is already working on this task. It also allows others to potentially work towards fixing this task. Please claim this task again when you plan to work on it (via Add Action...Assign / Claim in the dropdown menu) - it would be welcome. Thanks for your understanding!