Re: Use "raise from" where appropriate, all over the codebase

2020-01-20 Thread Adam Johnson
Nice work Jon. I don't think we can generally apply R100 though - thre are
definitely cases where "raise" inside an exception handler is not *caused*
by the other exception - but maybe that's a sign refactoring is needed.

On Sun, 19 Jan 2020 at 22:52, Jon Dufresne  wrote:

>
> > I think it's rare enough that personally, I would have liked to have a
>> > Flake8 / PyLint rule like that enforces it, and allow ignoring it
>> > with a comment. (As much as I hate Lint ignore comments.)
>>
>> That makes sense. And you know, flake8 supports plugins... a couple of
>> web searches and "pip search flake8 | grep {raise,from,chain}" didn't
>> pull anything which seems relevant, but if so, it can be written.
>>
>
> As a weekend project, I wrote a flake8 plugin to handle this at:
> https://pypi.org/project/flake8-raise/
>
> I'm not advocating this necessarily included by the Django test suite, but
> it can be used to review the PR. Either way, it was fun to write.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django developers (Contributions to Django itself)" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-developers+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-developers/CADhq2b4m40efQkorgji9-erXri9qSAb1VJBv%3DZ3HrOL6ksOJAQ%40mail.gmail.com
> 
> .
>


-- 
Adam

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/CAMyDDM0c3J%2BRGZZB%3D-Er3fAYnyvptkwu34CaO%2BmA%2BmKPKTEYPw%40mail.gmail.com.


Re: Fellow Reports - January 2020

2020-01-20 Thread Mariusz Felisiak
Week ending January 19, 2020.

*Triaged:*
https://code.djangoproject.com/ticket/31161 - Remote User - user name with 
"\". (duplicate)
https://code.djangoproject.com/ticket/31162 - GIS error logging when using 
WKT string as input to filter() query. (accepted)
https://code.djangoproject.com/ticket/31150 - SELECT DISTINCT is not not so 
distict (duplicate)
https://code.djangoproject.com/ticket/31136 - Multiple annotations with 
Exists() should not group by aliases. (reopen)
https://code.djangoproject.com/ticket/31164 - SESSION_COOKIE_SAMESITE and 
SameSite=None. (duplicate)
https://code.djangoproject.com/ticket/29271 - Chaining Filters on a Reverse 
Foreign Key Produces Multiple Joins. (invalid)
https://code.djangoproject.com/ticket/31165 - Overhaul settings. (invalid)
https://code.djangoproject.com/ticket/31167 - Unable to delete or modify a 
constraint using model Meta. (worksforme)
https://code.djangoproject.com/ticket/31168 - Add ability to mark test as 
parallel unsafe. (wontfix)
https://code.djangoproject.com/ticket/28297 - Same queryset result in two 
different queries on ORM. (duplicate)
https://code.djangoproject.com/ticket/31163 - Use filters after when case, 
the table is not reused. (duplicate)
https://code.djangoproject.com/ticket/31171 - Misleading wording in custom 
template tags docs. (accepted)
https://code.djangoproject.com/ticket/31174 - The inline original text area 
can not display full. (invalid)
https://code.djangoproject.com/ticket/31173 - Testing with PickleSerializer 
and Mock objects breaks. (invalid)
https://code.djangoproject.com/ticket/31175 - Remove newline in Textarea 
widget. (wontfix)
https://code.djangoproject.com/ticket/31178 - Filing a new bug when you're 
logged in is *extremely* difficult (invalid)

*Reviewed/committed:*
https://github.com/django/django/pull/12307 - Fixed #31160 -- Fixed admin 
CSS for ordered lists' descendants in unordered list.
https://github.com/django/django/pull/12273 - Fixed #29871 -- Allowed 
setting pk=None on a child model to create a copy.
https://github.com/django/django/pull/11823 - Fixed #30765 -- Made 
cache_page decorator take precedence over max-age Cache-Control directive.
https://github.com/django/django/pull/12330 - Fixed #31171 -- Fixed wording 
in auto-escaping section of custom template tags docs.
https://github.com/django/django/pull/12263 - Fixed #31166 -- Used "raise 
from" when raising ImproperlyConfigured exceptions in django.urls.resolvers.
https://github.com/django/django/pull/12335 - Refs #30752 -- Doc'd error 
reporting related optional request attributes.
https://github.com/django/django/pull/12316 - Added note about incomplete 
HTML in tutorial 3.

*Reviewed:*
https://github.com/django/django/pull/12284 - Fixed #31124 -- Fixed setting 
of get_FOO_display() when overriding inherited choices.
https://github.com/django/django/pull/11395 - Fixed #29998 -- Fixed parents 
dict for inherited table that contains multiple OneToOne references.
https://github.com/django/django/pull/11754 - Fixed #30752 -- Allowed using 
ExceptionReporter subclasses in error reports.

*Authored:*
https://github.com/django/django/pull/12317 - Refs #31136 -- Made 
QuerySet.values()/values_list() group only by selected annotation.
https://github.com/django/django/pull/12325 - Fixed #29998 -- Allowed 
multiple OneToOneField to the parent model.
https://github.com/django/django/pull/12329 - Fixed #31162 -- Prevented 
error logs when using WKT strings in lookups.

Best regards,
Mariusz

>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/35fc6ed1-dad4-44be-8007-10fa7302b815%40googlegroups.com.


Re: Use "raise from" where appropriate, all over the codebase

2020-01-20 Thread Ram Rachum
Jon: That's awesome! I also liked R101. I didn't think of that.

Adam: I thought so too, but after going over dozens of R100 cases, I didn't
find even one where a raise without "from" inside an except clause was
justified. I challenge you to show me even one such example.

On Mon, Jan 20, 2020 at 12:06 PM Adam Johnson  wrote:

> Nice work Jon. I don't think we can generally apply R100 though - thre are
> definitely cases where "raise" inside an exception handler is not *caused*
> by the other exception - but maybe that's a sign refactoring is needed.
>
> On Sun, 19 Jan 2020 at 22:52, Jon Dufresne  wrote:
>
>>
>> > I think it's rare enough that personally, I would have liked to have a
>>> > Flake8 / PyLint rule like that enforces it, and allow ignoring it
>>> > with a comment. (As much as I hate Lint ignore comments.)
>>>
>>> That makes sense. And you know, flake8 supports plugins... a couple of
>>> web searches and "pip search flake8 | grep {raise,from,chain}" didn't
>>> pull anything which seems relevant, but if so, it can be written.
>>>
>>
>> As a weekend project, I wrote a flake8 plugin to handle this at:
>> https://pypi.org/project/flake8-raise/
>>
>> I'm not advocating this necessarily included by the Django test suite,
>> but it can be used to review the PR. Either way, it was fun to write.
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django developers (Contributions to Django itself)" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-developers+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-developers/CADhq2b4m40efQkorgji9-erXri9qSAb1VJBv%3DZ3HrOL6ksOJAQ%40mail.gmail.com
>> 
>> .
>>
>
>
> --
> Adam
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/CANXboVYGg33WfP0jLWNPkKLBeL49gnbf%3DP5BM12NUPNzMeNJyg%40mail.gmail.com.


Re: ngettext_lazy and ngettext

2020-01-20 Thread אורי
Hi,

Anyone wants to review PR #12332?
אורי
u...@speedy.net

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/CABD5YeEjTbzZhSng%3DtN8k-85-qMiRH%2BgqpkG_nOZN9nMxF2YCw%40mail.gmail.com.