Re: [Django] #30731: simplify_regexp() doesn't replace trailing groups.

2019-08-26 Thread Django
#30731: simplify_regexp() doesn't replace trailing groups.
---+
 Reporter:  n2ygk  |Owner:  nobody
 Type:  Bug|   Status:  new
Component:  contrib.admindocs  |  Version:  master
 Severity:  Normal |   Resolution:
 Keywords: | Triage Stage:  Accepted
Has patch:  0  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  1  |UI/UX:  0
---+
Changes (by felixxm):

 * easy:  0 => 1


-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/063.bd95cc210c3676fd81ff74a6c756e33d%40djangoproject.com.


Re: [Django] #30731: simplify_regexp() doesn't replace trailing groups. (was: django.contrib.admindocs.utils.replace_named_groups() fails substitution if missing trailing /)

2019-08-26 Thread Django
#30731: simplify_regexp() doesn't replace trailing groups.
---+
 Reporter:  n2ygk  |Owner:  nobody
 Type:  Bug|   Status:  new
Component:  contrib.admindocs  |  Version:  master
 Severity:  Normal |   Resolution:
 Keywords: | Triage Stage:  Accepted
Has patch:  0  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+
Changes (by felixxm):

 * version:  2.2 => master
 * stage:  Unreviewed => Accepted


Comment:

 Thanks for the ticket, trailing slash is not necessary regexp patterns
 could be also enclosed by `$`, by I agree that this could be easily fix
 by:

 {{{
 diff --git a/django/contrib/admindocs/utils.py
 b/django/contrib/admindocs/utils.py
 index 1ce4594501..db27f82deb 100644
 --- a/django/contrib/admindocs/utils.py
 +++ b/django/contrib/admindocs/utils.py
 @@ -167,12 +167,6 @@ def replace_named_groups(pattern):
  # Handle nested parentheses, e.g. '^(?P(x|y))/b'.
  unmatched_open_brackets, prev_char = 1, None
  for idx, val in enumerate(pattern[end:]):
 -# If brackets are balanced, the end of the string for the
 current
 -# named capture group pattern has been reached.
 -if unmatched_open_brackets == 0:
 -group_pattern_and_name.append((pattern[start:end + idx],
 group_name))
 -break
 -
  # Check for unescaped `(` and `)`. They mark the start and
 end of a
  # nested group.
  if val == '(' and prev_char != '\\':
 @@ -180,6 +174,11 @@ def replace_named_groups(pattern):
  elif val == ')' and prev_char != '\\':
  unmatched_open_brackets -= 1
  prev_char = val
 +# If brackets are balanced, the end of the string for the
 current
 +# named capture group pattern has been reached.
 +if unmatched_open_brackets == 0:
 +group_pattern_and_name.append((pattern[start:end + idx +
 1], group_name))
 +break

  # Replace the string for named capture groups with their group names.
  for group_pattern, group_name in group_pattern_and_name:
 }}}

 Similar change should be made in `replace_unnamed_groups()`. Please add
 testcases to
 `admin_docs.test_views.AdminDocViewFunctionsTests.test_simplify_regex`.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/063.0867c3a2c4775d826dbe1c0976b4c68b%40djangoproject.com.


Re: [Django] #30731: django.contrib.admindocs.utils.replace_named_groups() fails substitution if missing trailing /

2019-08-26 Thread Django
#30731: django.contrib.admindocs.utils.replace_named_groups() fails 
substitution if
missing trailing /
---+--
 Reporter:  n2ygk  |Owner:  nobody
 Type:  Bug|   Status:  new
Component:  contrib.admindocs  |  Version:  2.2
 Severity:  Normal |   Resolution:
 Keywords: | Triage Stage:  Unreviewed
Has patch:  0  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+--

Comment (by n2ygk):

 Here's execution of the example code:
 {{{
 (env) django-example$ python demo.py
  path: entries/(?P[^/.]+)/relationships/(?P\w+)
  expected: entries//relationships/
   got: entries//relationships/(?P\w+)

 path_trailing:
 entries/(?P[^/.]+)/relationships/(?P\w+)/
  expected: entries//relationships//
   got: entries//relationships//
 Traceback (most recent call last):
   File "demo.py", line 21, in 
 assert path == expected_path, "path without trailing slash didn't
 match expected"
 AssertionError: path without trailing slash didn't match expected
 (env) django-example$

 }}}

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/063.b50cdcf9b3ac5e2a5d9d031721f00e93%40djangoproject.com.


Re: [Django] #30731: django.contrib.admindocs.utils.replace_named_groups() fails substitution if missing trailing /

2019-08-26 Thread Django
#30731: django.contrib.admindocs.utils.replace_named_groups() fails 
substitution if
missing trailing /
---+--
 Reporter:  n2ygk  |Owner:  nobody
 Type:  Bug|   Status:  new
Component:  contrib.admindocs  |  Version:  2.2
 Severity:  Normal |   Resolution:
 Keywords: | Triage Stage:  Unreviewed
Has patch:  0  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+--
Changes (by n2ygk):

 * Attachment "demo.py" added.


-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/063.aed98d1801f581b169478c367cd8c61d%40djangoproject.com.


[Django] #30731: django.contrib.admindocs.utils.replace_named_groups() fails substitution if missing trailing /

2019-08-26 Thread Django
#30731: django.contrib.admindocs.utils.replace_named_groups() fails 
substitution if
missing trailing /
-+
   Reporter:  n2ygk  |  Owner:  nobody
   Type:  Bug| Status:  new
  Component:  contrib.admindocs  |Version:  2.2
   Severity:  Normal |   Keywords:
   Triage Stage:  Unreviewed |  Has patch:  0
Needs documentation:  0  |Needs tests:  0
Patch needs improvement:  0  |  Easy pickings:  0
  UI/UX:  0  |
-+
 replace_named_groups() fails to replace the final named group if the
 urlpattern passed in is missing a trailing '/'.

 For example, with input
 `r'entries/(?P[^/.]+)/relationships/(?P\w+)'` the
 "related_field" does not get properly replaced.  A workaround is to tack
 on a '/' at the end and then it works.

 Code that reproduces this is attached.

 This function is used downstream in Django REST Framework. See issue
 [[https://github.com/encode/django-rest-framework/issues/6888|6888]]

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/048.85e9867d76b229bd03ba9f7b867b7ecb%40djangoproject.com.


Re: [Django] #23718: TEST_MIRROR setting doesn't work as expected (and has no tests)

2019-08-26 Thread Django
#23718: TEST_MIRROR setting doesn't work as expected (and has no tests)
---+-
 Reporter:  Ilya Baryshev  |Owner:  Rag Sagar
 Type:  Bug|   Status:  assigned
Component:  Testing framework  |  Version:  1.7
 Severity:  Normal |   Resolution:
 Keywords:  replica testing| Triage Stage:  Accepted
Has patch:  1  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  1
Easy pickings:  0  |UI/UX:  0
---+-
Changes (by Patrick Cloke):

 * cc: Patrick Cloke (added)


-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/067.5cf2632d367bb5e516656547f5edd52f%40djangoproject.com.


Re: [Django] #29019: createsuperuser crashes if a ManyToManyField is in REQUIRED_FIELDS

2019-08-26 Thread Django
#29019: createsuperuser crashes if a ManyToManyField is in REQUIRED_FIELDS
--+--
 Reporter:  James Kirsop  |Owner:  Hasan Ramezani
 Type:  Bug   |   Status:  closed
Component:  contrib.auth  |  Version:  master
 Severity:  Normal|   Resolution:  fixed
 Keywords:  user custom   | Triage Stage:  Accepted
Has patch:  1 |  Needs documentation:  0
  Needs tests:  0 |  Patch needs improvement:  0
Easy pickings:  0 |UI/UX:  0
--+--
Changes (by Mariusz Felisiak ):

 * status:  assigned => closed
 * resolution:   => fixed


Comment:

 In [changeset:"03dbdfd9d0b0172aad648c6bbe3f39541137" 03dbdfd9]:
 {{{
 #!CommitTicketReference repository=""
 revision="03dbdfd9d0b0172aad648c6bbe3f39541137"
 Fixed #29019 -- Added ManyToManyField support to REQUIRED_FIELDS.
 }}}

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/069.db75c370e806fba7e5fbc4bddac161c2%40djangoproject.com.


Re: [Django] #27804: Use unittest.subTest() in Django's test suite

2019-08-26 Thread Django
#27804: Use unittest.subTest() in Django's test suite
--+
 Reporter:  Tim Graham|Owner:  (none)
 Type:  Cleanup/optimization  |   Status:  closed
Component:  Core (Other)  |  Version:  master
 Severity:  Normal|   Resolution:  fixed
 Keywords:| Triage Stage:  Accepted
Has patch:  0 |  Needs documentation:  0
  Needs tests:  0 |  Patch needs improvement:  0
Easy pickings:  1 |UI/UX:  0
--+

Comment (by Carlton Gibson ):

 In [changeset:"5dac63bb844d0a976e1dd1591a323c5ba9674a97" 5dac63b]:
 {{{
 #!CommitTicketReference repository=""
 revision="5dac63bb844d0a976e1dd1591a323c5ba9674a97"
 Refs #27804 -- Used subTest() in utils_tests/test_encoding.py.
 }}}

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/067.365f4bde3175cbce97f362de543f745b%40djangoproject.com.


Re: [Django] #30686: Improve utils.text.Truncator &co to use a full HTML parser.

2019-08-26 Thread Django
#30686: Improve utils.text.Truncator &co to use a full HTML parser.
---+
 Reporter:  Thomas Hooper  |Owner:  nobody
 Type:  Bug|   Status:  new
Component:  Utilities  |  Version:  master
 Severity:  Normal |   Resolution:
 Keywords: | Triage Stage:  Accepted
Has patch:  0  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+

Comment (by Carlton Gibson):

 Hi Jon,

 Thank you for the comments. I will email Will, the maintainer of Bleach,
 and ask his thoughts too. Bleach has slowed down, but that's because it's
 Stable/Mature now I would have thought.

 > ...would the stdlib HTML parser be sufficient?

 Yes. Maybe. Ideally we just thought to bring in Bleach, and with it
 html5lib since, in theory that's already working code. (Florian already
 had a Truncate prototype...)

 Anyhow... will follow-up.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/066.f6d3e3f7f85ac7da8e40a678c98515f8%40djangoproject.com.


Re: [Django] #30500: Error reporting returns a circular import error on a python formatting error, and does not restart the development server

2019-08-26 Thread Django
#30500: Error reporting returns a circular import error on a python formatting
error, and does not restart the development server
-+-
 Reporter:  Runner15 |Owner:  Tom
 Type:   |  Forbes
  Cleanup/optimization   |   Status:  assigned
Component:  Error reporting  |  Version:  master
 Severity:  Release blocker  |   Resolution:
 Keywords:  error reporting, | Triage Stage:  Accepted
  error, circular import |
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by felixxm):

 * severity:  Normal => Release blocker


Comment:

 Tom, thanks for the research. I agree with Claude let's fix this only in
 Django 2.2, we officially support only the latest point release of each
 Python series.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/066.bfe369ac111702327787da119f827e01%40djangoproject.com.


Re: [Django] #30591: MySQL: 1215 - "Cannot add foreign key constraint" when altering type of unique field referenced by ForeignKey.

2019-08-26 Thread Django
#30591: MySQL: 1215 - "Cannot add foreign key constraint" when altering type of
unique field referenced by ForeignKey.
--+--
 Reporter:  Cornelis Poppema  |Owner:  Adnan Umer
 Type:  Bug   |   Status:  assigned
Component:  Migrations|  Version:  master
 Severity:  Normal|   Resolution:
 Keywords:| Triage Stage:  Accepted
Has patch:  1 |  Needs documentation:  0
  Needs tests:  0 |  Patch needs improvement:  1
Easy pickings:  0 |UI/UX:  0
--+--

Comment (by GitHub ):

 In [changeset:"579909a13feb958f75d1d77e9995cef8f2b9c2a3" 579909a1]:
 {{{
 #!CommitTicketReference repository=""
 revision="579909a13feb958f75d1d77e9995cef8f2b9c2a3"
 Refs #30591 -- Fixed introspection of check and unique column constraints
 on MariaDB.

 Unnamed unique and check columns constraints have the same name as
 a column. Ensure uniqueness by using custom names.

 Thanks Adnan Umer for the report.
 }}}

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/066.f401fcd686ca4ea65c6168eced7c6659%40djangoproject.com.


Re: [Django] #30729: Add support for the RFC 7239 Forwarded header

2019-08-26 Thread Django
#30729: Add support for the RFC 7239 Forwarded header
---+--
 Reporter:  Ben Stähli |Owner:  nobody
 Type:  Uncategorized  |   Status:  new
Component:  Uncategorized  |  Version:  2.2
 Severity:  Normal |   Resolution:
 Keywords: | Triage Stage:  Unreviewed
Has patch:  0  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+--

Comment (by Ben Stähli):

 Not really. But it would be a good thing to go ahead and support it,
 otherwise it will never be adopted. Also, it is an RFC, so I guess it will
 probably become the new standard. Tomorrow, or in some years only, who
 knows.

 A quick research shows that some frameworks are discussing it.

 -
 https://duckduckgo.com/?q=is+RFC-7239+forwarded+support&t=canonical&ia=web
 - https://github.com/aspnet/AspNetCore/issues/5978
 - https://issues.jboss.org/browse/UNDERTOW-1207?_sscc=t
 - http://tomcat.10.x6.nabble.com/Bug-63080-New-Support-rfc7239-Forwarded-
 header-td5081951.html
 - https://groups.google.com/forum/#!msg/golang-
 nuts/wc45kx0bsr8/BX1Dds8cAwAJ

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/065.8b1d32789d79fd16cf9a247645d5019c%40djangoproject.com.