Re: Fellow Reports - June 2019

2019-06-23 Thread Mariusz Felisiak
Week ending June 23, 2019.

*Triaged:*
https://code.djangoproject.com/ticket/30570 - Integrity errors in Django 
project with custom User model. (worksforme)
https://code.djangoproject.com/ticket/30568 - Definition of URLconf appears 
in tutorial 3; first mention is in tutorial 1. (wontfix)
https://code.djangoproject.com/ticket/30567 - Start passing 
FileResponse.block_size to wsgi.file_wrapper. (accepted)
https://code.djangoproject.com/ticket/30571 - Incorrect value of kwargs in 
pre_init signal documentation. (invalid)
https://code.djangoproject.com/ticket/30572 - Composed queries cannot 
change the list of columns with values()/values_list(). (created)
https://code.djangoproject.com/ticket/30573 - Don't assume that things are 
"easy"/"obvious"/"simple" in the docs. (accepted)
https://code.djangoproject.com/ticket/30574 - Support join tables query 
over two tables without foreign key. (invalid)
https://code.djangoproject.com/ticket/30575 - Union of TruncBase 
annotations with different tzinfo apply `convert_value` of last tzinfo. 
(wontfix)
https://code.djangoproject.com/ticket/30576 - Code not working on Django 
Tutorial part 6. (worksforme)
https://code.djangoproject.com/ticket/30578 - SelectDateWidget doesn't use 
DATE formats properly when settings.USE_L10N=False. (accepted)
https://code.djangoproject.com/ticket/30579 - Add management command to 
delete all tables. (wontfix)
https://code.djangoproject.com/ticket/30582 - Redirect by using 307/308 
instead of 301/302. (wontfix)
https://code.djangoproject.com/ticket/30583 - XML serializer doesn't handle 
JSONFields. (accepted)

*Reviewed/committed:*
https://github.com/django/django/pull/11483 - Fixed typos and example in 
signals.pre_init docs.
https://github.com/django/django/pull/10554 - Fixed #29834 -- Fixed column 
mismatch crash with QuerySet.values()/values_list() and order_by() on 
combined querysets.
https://github.com/django/django/pull/11209 - Fixed #30451 -- Added ASGI 
handler and coroutine-safety.
https://github.com/django/django/pull/11298 - Fixed #30421 -- Allowed 
symmetrical intermediate table for self-referential ManyToManyField.
https://github.com/django/django/pull/11498 - Bumped minimum ESLint version 
to 4.18.2.

*Reviewed:*
https://github.com/django/django/pull/11478 - Fixed #30547 -- Doc'd how 
Meta.constraints affect model validation.
https://github.com/django/django/pull/11484 - Fixed #30565 -- Closed 
HttpResponse when wsgi.file_wrapper closes file-like object.

*Authored:*
https://github.com/django/django/pull/11485 - Fixed 
LiveWidgetTests.test_textarea_trailing_newlines() crash on Chrome 75+.
https://github.com/django/django/pull/11490 - Fixed #30572 -- Prevented 
values()/values_list() on combined queryset from mutating the list of 
columns in querysets.

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 post to this group, send email to django-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/e8de881e-b1aa-417b-9ff0-c46b4c8079a8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Ticket #23004 - Cleanse entries from request.META in debug views

2019-06-23 Thread ohlr
I'd like to draw your attention to this ticket which is accepted and now 
open for 5 years.

https://code.djangoproject.com/ticket/23004

>From my point of view it is a quite important one because:
When specifying ADMINS in *settings.py* sensetive data from *request.META *
is not cleansed e.g. in E-Mails resulting out of internal-server-errors.

There are currently two PRs and what is missing is:

a) a decision which to take
b) reviews

The PRs:
- https://github.com/django/django/pull/11224
- https://github.com/django/django/pull/10748

-- 
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 post to this group, send email to django-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/59a32916-a7bf-42da-88b6-df7224faabd6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: ipdb throws AttributeError in autoreload.py with 2.2.2

2019-06-23 Thread Jason Johns
Wow, that was quick! Thank you!

-- 
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 post to this group, send email to django-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/6b7125aa-404e-4678-8c19-578533cb52fa%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: ipdb throws AttributeError in autoreload.py with 2.2.2

2019-06-23 Thread Tom Forbes
IPython seems to override `__main__`, which I certainly did not expect: 
https://github.com/ipython/ipython/blob/257e4c45563598810b0a771de286004617510fc1/IPython/core/debugger.py#L238
 

 and perhaps 
https://github.com/ipython/ipython/blob/7b42de99c651de35f487adea3f57824ad97bcd74/IPython/testing/globalipapp.py#L115
 
.

I’ve made a ticket here: https://code.djangoproject.com/ticket/30588#ticket 
, and a PR to fix it: 
https://github.com/django/django/pull/11507 


> , and I know the autoreload has been an area of some frustration lately and 
> as such I'm not sure of the best approach for handling this case.

I do feel responsible for the frustration, sorry! My advice to anyone that 
hears a little voice in their head asking “how hard can building an autoloader 
be?”: ignore it. That being said, I think we’ve ironed out the worst of the 
issues, despite this one being pretty bad :/

> On 23 Jun 2019, at 16:46, Jason Johns  wrote:
> 
> Hello,
> 
> About two weeks ago, work updated the base docker image to use django 2.2.2 
> and I noticed an issue right off the bat with using ipdb 0.12 and ipython 
> 7.5.0 (which are also defaults for the docker image).  I really didn't have 
> the time to dig more, and got along well enough with pdb in the meantime.  
> This weekend, I had some free time to poke around, and these are my findings:
> 
> 
> In a DRF serializer helper method, I import ipdb and set a breakpoint.  The 
> API call executes and stops here.  After anywhere from 1 to 3 seconds pause 
> at the breakpoint, I then see the following output from ipdb> and the 
> runserver process exits.
> > /orm/service/api/serializers/helpers/facet_generator.py(62)__make_facet()
>  61 import ipdb; ipdb.set_trace()
> ---> 62 log.info(f'Facet field: {facet_field}')
>  63 log.info(f'Facet values: {facet_values}')
> 
> ipdb> Traceback (most recent call last):
>   File "/orm/manage.py", line 15, in 
> execute_from_command_line(sys.argv)
>   File 
> "/usr/local/lib/python3.7/site-packages/django/core/management/__init__.py", 
> line 381, in execute_from_command_line
> utility.execute()
>   File 
> "/usr/local/lib/python3.7/site-packages/django/core/management/__init__.py", 
> line 375, in execute
> self.fetch_command(subcommand).run_from_argv(self.argv)
>   File 
> "/usr/local/lib/python3.7/site-packages/django/core/management/base.py", line 
> 323, in run_from_argv
> self.execute(*args, **cmd_options)
>   File 
> "/usr/local/lib/python3.7/site-packages/django/core/management/commands/runserver.py",
>  line 60, in execute
> super().execute(*args, **options)
>   File 
> "/usr/local/lib/python3.7/site-packages/django/core/management/base.py", line 
> 364, in execute
> output = self.handle(*args, **options)
>   File 
> "/usr/local/lib/python3.7/site-packages/django/core/management/commands/runserver.py",
>  line 95, in handle
> self.run(**options)
>   File 
> "/usr/local/lib/python3.7/site-packages/django/core/management/commands/runserver.py",
>  line 102, in run
> autoreload.run_with_reloader(self.inner_run, **options)
>   File "/usr/local/lib/python3.7/site-packages/django/utils/autoreload.py", 
> line 585, in run_with_reloader
> start_django(reloader, main_func, *args, **kwargs)
>   File "/usr/local/lib/python3.7/site-packages/django/utils/autoreload.py", 
> line 570, in start_django
> reloader.run(django_main_thread)
>   File "/usr/local/lib/python3.7/site-packages/django/utils/autoreload.py", 
> line 288, in run
> self.run_loop()
>   File "/usr/local/lib/python3.7/site-packages/django/utils/autoreload.py", 
> line 294, in run_loop
> next(ticker)
>   File "/usr/local/lib/python3.7/site-packages/django/utils/autoreload.py", 
> line 334, in tick
> for filepath, mtime in self.snapshot_files():
>   File "/usr/local/lib/python3.7/site-packages/django/utils/autoreload.py", 
> line 350, in snapshot_files
> for file in self.watched_files():
>   File "/usr/local/lib/python3.7/site-packages/django/utils/autoreload.py", 
> line 249, in watched_files
> yield from iter_all_python_module_files()
>   File "/usr/local/lib/python3.7/site-packages/django/utils/autoreload.py", 
> line 103, in iter_all_python_module_files
> return iter_modules_and_files(modules, frozenset(_error_files))
>   File "/usr/local/lib/python3.7/site-packages/django/utils/autoreload.py", 
> line 120, in iter_modules_and_files
> sys_file_paths.append(module.__file__)
> AttributeError: module '__main__' has no attribute '__file__'
> 
> If you suspect this is an IPython bug, please report it at:
> https://github.com/ipython/ipython/issues
> or 

ipdb throws AttributeError in autoreload.py with 2.2.2

2019-06-23 Thread Jason Johns
Hello,

About two weeks ago, work updated the base docker image to use django 2.2.2 
and I noticed an issue right off the bat with using ipdb 0.12 and ipython 
7.5.0 (which are also defaults for the docker image).  I really didn't have 
the time to dig more, and got along well enough with pdb in the meantime.  
This weekend, I had some free time to poke around, and these are my 
findings:


In a DRF serializer helper method, I import ipdb and set a breakpoint.  The 
API call executes and stops here.  After anywhere from 1 to 3 seconds pause 
at the breakpoint, I then see the following output from ipdb> and the 
runserver process exits.
> /orm/service/api/serializers/helpers/facet_generator.py(62)__make_facet()
 61 import ipdb; ipdb.set_trace()
---> 62 log.info(f'Facet field: {facet_field}')
 63 log.info(f'Facet values: {facet_values}')

ipdb> Traceback (most recent call last):
  File "/orm/manage.py", line 15, in 
execute_from_command_line(sys.argv)
  File 
"/usr/local/lib/python3.7/site-packages/django/core/management/__init__.py", 
line 381, in execute_from_command_line
utility.execute()
  File 
"/usr/local/lib/python3.7/site-packages/django/core/management/__init__.py", 
line 375, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
  File 
"/usr/local/lib/python3.7/site-packages/django/core/management/base.py", 
line 323, in run_from_argv
self.execute(*args, **cmd_options)
  File 
"/usr/local/lib/python3.7/site-packages/django/core/management/commands/runserver.py",
 
line 60, in execute
super().execute(*args, **options)
  File 
"/usr/local/lib/python3.7/site-packages/django/core/management/base.py", 
line 364, in execute
output = self.handle(*args, **options)
  File 
"/usr/local/lib/python3.7/site-packages/django/core/management/commands/runserver.py",
 
line 95, in handle
self.run(**options)
  File 
"/usr/local/lib/python3.7/site-packages/django/core/management/commands/runserver.py",
 
line 102, in run
autoreload.run_with_reloader(self.inner_run, **options)
  File "/usr/local/lib/python3.7/site-packages/django/utils/autoreload.py", 
line 585, in run_with_reloader
start_django(reloader, main_func, *args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/django/utils/autoreload.py", 
line 570, in start_django
reloader.run(django_main_thread)
  File "/usr/local/lib/python3.7/site-packages/django/utils/autoreload.py", 
line 288, in run
self.run_loop()
  File "/usr/local/lib/python3.7/site-packages/django/utils/autoreload.py", 
line 294, in run_loop
next(ticker)
  File "/usr/local/lib/python3.7/site-packages/django/utils/autoreload.py", 
line 334, in tick
for filepath, mtime in self.snapshot_files():
  File "/usr/local/lib/python3.7/site-packages/django/utils/autoreload.py", 
line 350, in snapshot_files
for file in self.watched_files():
  File "/usr/local/lib/python3.7/site-packages/django/utils/autoreload.py", 
line 249, in watched_files
yield from iter_all_python_module_files()
  File "/usr/local/lib/python3.7/site-packages/django/utils/autoreload.py", 
line 103, in iter_all_python_module_files
return iter_modules_and_files(modules, frozenset(_error_files))
  File "/usr/local/lib/python3.7/site-packages/django/utils/autoreload.py", 
line 120, in iter_modules_and_files
sys_file_paths.append(module.__file__)
AttributeError: module '__main__' has no attribute '__file__'

If you suspect this is an IPython bug, please report it at:
https://github.com/ipython/ipython/issues
or send an email to the mailing list at ipython-...@python.org

You can print a more detailed traceback right now with "%tb", or use 
"%debug"
to interactively debug it.

Extra-detailed tracebacks for bug-reporting purposes can be enabled via:
%config Application.verbose_crash=True

Error in atexit._run_exitfuncs:
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/IPython/core/history.py", 
line 780, in writeout_cache
self._writeout_input_cache(conn)
  File "/usr/local/lib/python3.7/site-packages/IPython/core/history.py", 
line 764, in _writeout_input_cache
(self.session_number,)+line)
sqlite3.ProgrammingError: SQLite objects created in a thread can only be 
used in that same thread. The object was created in thread id 
139743563077376 and this is thread id 139743865329408.



To be sure it wasn't just the project's fault, I checked out another team's 
project and got the same error.  This seems to be isolated to just ipdb.  
Using pdb does not show the same errors

Then, I pulled the latest from django github and confirmed that it is 
probably related to the changes in iter_modules_and_files 

 between 
2.2.1 and 2.2.2.  Looking at ipdb 
's package structure, I 
think the problem is the usage of __main__.py, because it apparently does 
not