Inconsistent tabs vs spaces for indentation in HTTPRequest.py means potential for subtle bug to be introduced.

Bug #234209 reported by Darryl Dixon
2
Affects Status Importance Assigned to Milestone
Zope 2
Fix Released
Undecided
Tres Seaver

Bug Description

Traceback (most recent call last):
  File "deployserver.py", line 6, in ?
    from ZPublisher.HTTPResponse import HTTPResponse
  File "/u01/app/zope-2.9.8/lib/python/ZPublisher/__init__.py", line 24, in ?
    from Publish import publish_module, Retry
  File "/u01/app/zope-2.9.8/lib/python/ZPublisher/Publish.py", line 20, in ?
    from Request import Request
  File "/u01/app/zope-2.9.8/lib/python/ZPublisher/Request.py", line 13, in ?
    import HTTPRequest
  File "/u01/app/zope-2.9.8/lib/python/ZPublisher/HTTPRequest.py", line 1495
    broken_p = paramlessre.match(text)
                                     ^
TabError: inconsistent use of tabs and spaces in indentation

Doing `cat -vent ZPublisher/HTTPRequest.py` shows me:
[...cut...]
  1493 else:$
  1494 # Broken Cookie without = nor value.$
  1495 ^I^Ibroken_p = paramlessre.match(text)$
  1496 ^I^Iif broken_p:$
  1497 ^I^I l = len(broken_p.group(1))$
  1498 ^I^I name = broken_p.group(2)$
  1499 ^I^I value = ''$
  1500 $
  1501 else:$
  1502 return result$
[...cut...]

Meaning that the 'Broken Cookie' block is open for subtle breakage if any other indentation changes anywhere.

Revision history for this message
Tres Seaver (tseaver) wrote :

The tabs are only present on the 2.9 branch, which may never see another
release. They also don't cause a traceback that I can see: your system
configuration must be different in some way.

Nevertheless, I have checked in a patch de-tabifying the file:

  http://svn.zope.org/Zope/branches/2.9/?rev=86919&view=rev

Changed in zope2:
assignee: nobody → tseaver
status: New → Fix Committed
Changed in zope2:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.