[issue29387] Tabs vs spaces FAQ out of date

2017-04-20 Thread Mariatta Wijaya

Changes by Mariatta Wijaya :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29387] Tabs vs spaces FAQ out of date

2017-03-14 Thread Mariatta Wijaya

Mariatta Wijaya added the comment:

Thanks, Martin, and thanks Jim for the ping.
I'll backport the change to 2.7 later today, and then this issue can be closed 
:)

--
assignee: docs@python -> Mariatta

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29387] Tabs vs spaces FAQ out of date

2017-03-14 Thread Martin Panter

Martin Panter added the comment:

The “tabnanny” script was removed from Tools/scripts/ in 2.0: 
. So the 2.7 FAQ also has the 
wrong location.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29387] Tabs vs spaces FAQ out of date

2017-03-14 Thread Mariatta Wijaya

Mariatta Wijaya added the comment:

Just a question, does this need backport to 2.7?
It's only been backported to 3.5 and 3.6.

--
nosy: +Mariatta

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29387] Tabs vs spaces FAQ out of date

2017-03-14 Thread Jim Fasarakis-Hilliard

Jim Fasarakis-Hilliard added the comment:

Shouldn't this issue get closed now that the PR was merged?

--
nosy: +Jim Fasarakis-Hilliard

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29387] Tabs vs spaces FAQ out of date

2017-02-14 Thread Mariatta Wijaya

Mariatta Wijaya added the comment:


New changeset 38c8354f3204441f6c6bd22213b449d2d8954fcc by GitHub in branch 
'3.5':
bpo-29521 Fix two minor documentation build warnings (#41) (#84)
https://github.com/python/cpython/commit/38c8354f3204441f6c6bd22213b449d2d8954fcc


--
nosy: +Mariatta

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29387] Tabs vs spaces FAQ out of date

2017-02-13 Thread Brian Curtin

Brian Curtin added the comment:


New changeset 3d707be950b387552585451071928e7b39cdfa53 by Brian Curtin in 
branch 'master':
bpo-29521 Fix two minor documentation build warnings (#41)
https://github.com/python/cpython/commit/3d707be950b387552585451071928e7b39cdfa53


--
nosy: +brian.curtin

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29387] Tabs vs spaces FAQ out of date

2017-02-11 Thread Jim DeLaHunt

Jim DeLaHunt added the comment:

PR https://github.com/python/cpython/pull/41 to the new Github repo contains 
the following wording in Doc/faq/windows.rst:

Python raises :exc:`IndentationError` or :exc:`TabError` if mixed tabs 
and spaces are causing problems in leading whitespace.
You may also run the :mod:`tabnanny` module to check a directory tree 
in batch mode.

This is parallel wording with the contents of Martin's patch.

The PR may be enough to fix this issue.

--
pull_requests: +44

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29387] Tabs vs spaces FAQ out of date

2017-02-10 Thread Marco Buttu

Marco Buttu added the comment:

Thanks Jim. I tested thise exec() in Py2.7 and Py3 (3.5 - 3.7):

exec("if True:\n" + " "*width + "1\n" + "\t2\n")

* width == 0 raises a IndentationError both in Py2 and Py3
* width in range(1, 8) raises an IndentationError in Py2 and TabError in Py3
* width == 8 is OK in Py2, and raises a TabError in Python 3
* width > 8 is the same as width == 0

I think the most important case, is when width==4 or width==8, because they are 
the usual widths of the TAB. In these cases, the editor will show a "correct" 
level of indentation, but Python will raise an exception and a beginner user 
will not understand the reason. IMO is here that Lib/tabnanny.py really comes 
in handy. And in these cases (width== 4 or 8), Python 3 raises a TabError, but 
if we write in the doc that it raises an IndentationError, IMO the user perhaps 
will think there is an error in the doc, because IMO on the average he/she will 
not spot that TabError is a subclass of IndentationError. Thats why I think it 
is better to not specity the exeption type.

Anyway, it is really a minor issue, and currently is also related to other 
issues, so there is no need to discuss to much for such a detail. Finally, the 
wording in the pull request is good enough for me :) Thanks

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29387] Tabs vs spaces FAQ out of date

2017-02-10 Thread Jim DeLaHunt

Jim DeLaHunt added the comment:

I just created Pull Request 76 https://github.com/python/cpython/pull/76  to 
address http://bugs.python.org/issue29521 . 

In faq/windows.rst, I've used your wording from the discussion in of this bug. 
I may have address this issue completely, in fact.  I did not do the more 
careful "testing all versions patched" which Terry suggested.

--
nosy: +JDLH

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29387] Tabs vs spaces FAQ out of date

2017-02-04 Thread Terry J. Reedy

Terry J. Reedy added the comment:

I would add the exception type after testing all versions patched.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29387] Tabs vs spaces FAQ out of date

2017-02-04 Thread Marco Buttu

Marco Buttu added the comment:

I think you are right about the TAB model (Parser/tokenizer.c:40 and 
Lib/tokenize.py:215), that is why the difference between the two cases.

In any case, I am not sure whether expliciting the type of the exeption is the 
best choice. So, to me +1 to just change "should report" with "reports" in the 
proposed patch, and +0 to indicate the exeption type.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29387] Tabs vs spaces FAQ out of date

2017-02-04 Thread Martin Panter

Martin Panter added the comment:

Marco: I agree “Python reports an error” would have been simpler. That is what 
I meant to say. Anyway, perhaps we should put

Python raises :exc:`IndentationError` if mixed tabs and spaces are causing 
problems in leading whitespace.

In general, the exception seems to be IndentationError. TabError is a subclass, 
but is not raised in all circumstances. It seems the compiler assumes a 
particular tab model, so the exact exception depends on the amount of tabs and 
spaces:

>>> exec("if True:\n" + " "*8 + "1\n" "\t2\n")
Traceback (most recent call last):
  File "", line 1, in 
  File "", line 3
2
^
TabError: inconsistent use of tabs and spaces in indentation
>>> exec("if True:\n" + " "*9 + "1\n" "\t2\n")
Traceback (most recent call last):
  File "", line 1, in 
  File "", line 3
2
^
IndentationError: unindent does not match any outer indentation level

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29387] Tabs vs spaces FAQ out of date

2017-02-03 Thread Terry J. Reedy

Terry J. Reedy added the comment:

I agree with Marco in that I do not understand the 'should'.  Py 3 has a 
definite rule for when it raises.  (I don't remember the exact details as I 
don't use tabs.)  "Python raises xxxError if one mixes tabs and spaces in the 
same file." (Or whatever the rule is.)

--
nosy: +terry.reedy

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29387] Tabs vs spaces FAQ out of date

2017-02-03 Thread Xiang Zhang

Xiang Zhang added the comment:

LGTM. -t is not removed but only ignored in Py3 for backwards compatibility. 
And I am fine with the wording.

--
nosy: +xiang.zhang

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29387] Tabs vs spaces FAQ out of date

2017-01-31 Thread Marco Buttu

Marco Buttu added the comment:

Hi Martin, why did you write "Python should report an error if mixed tabs and 
spaces are causing problems in leading whitespace."? 
Python for sure reports an error in that case. 

Maybe "Python reports an error if..." is a better choice. But my English is 
really poor, so I can be wrong... I have just this doubt, otherwise the patch 
is OK to me.

--
nosy: +marco.buttu

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29387] Tabs vs spaces FAQ out of date

2017-01-29 Thread Martin Panter

New submission from Martin Panter:

The Windows FAQ 

 mentions the “python -t” command-line option, but in Python 3 this option is 
undocumented (and I understand has no effect):

/media/disk/home/proj/python/cpython/Doc/faq/windows.rst:303: WARNING: unknown 
option: -t

Also, the reference to the tabnanny script is wrong. It exists as a module 
(Lib/tabnanny.py), not in Tools/scripts/. This aspect also applies to 2.7.

--
assignee: docs@python
components: Documentation, Windows
files: tabnanny.patch
keywords: patch
messages: 286460
nosy: docs@python, martin.panter, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
stage: patch review
status: open
title: Tabs vs spaces FAQ out of date
versions: Python 2.7, Python 3.5, Python 3.6, Python 3.7
Added file: http://bugs.python.org/file46450/tabnanny.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com