This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author serhiy.storchaka
Recipients Julian, emilyemorehouse, georg.brandl, martin.panter, ncoghlan, pitrou, serhiy.storchaka, terry.reedy
Date 2017-06-27.05:13:45
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1498540425.61.0.520336323924.issue30754@psf.upfronthosting.co.za>
In-reply-to
Content
I think the current behavior is useful, but undocumented. Otherwise a blank line starting with unmatched whitespaces (e.g. "  foo\n\t\n  bar") would block deindenting.

This also matches the behavior of Python parser which ignores all whitespaces in blank lines.

>>> exec('if 1:\n\tpass\n  pass\n')                                                                                                                                                         
Traceback (most recent call last):                                                                                                                                                              
  File "<stdin>", line 1, in <module>                                                                                                                                                           
  File "<string>", line 3                                                                                                                                                                       
    pass                                                                                                                                                                                        
       ^                                                                                                                                                                                        
IndentationError: unindent does not match any outer indentation level                                                                                                                           
>>> exec('if 1:\n\t\n  pass\n')                                                                                                                                                             
>>> 

Added Antoine and Nick as yet two experts of the textwrap module.
History
Date User Action Args
2017-06-27 05:13:45serhiy.storchakasetrecipients: + serhiy.storchaka, georg.brandl, terry.reedy, ncoghlan, pitrou, Julian, martin.panter, emilyemorehouse
2017-06-27 05:13:45serhiy.storchakasetmessageid: <1498540425.61.0.520336323924.issue30754@psf.upfronthosting.co.za>
2017-06-27 05:13:45serhiy.storchakalinkissue30754 messages
2017-06-27 05:13:45serhiy.storchakacreate