classification
Title: make reindent failed.
Type: behavior Stage: backport needed
Components: Versions: Python 3.7, Python 3.6, Python 3.5, Python 2.7
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Mariatta Nosy List: Mariatta, corona10, serhiy.storchaka
Priority: normal Keywords:

Created on 2017-04-20 03:17 by corona10, last changed 2017-04-20 14:12 by Mariatta.

Pull Requests
URL Status Linked Edit
PR 1207 merged Mariatta, 2017-04-20 05:22
PR 1208 merged Mariatta, 2017-04-20 06:00
PR 1209 merged Mariatta, 2017-04-20 06:01
Messages (5)
msg291935 - (view) Author: Dong-hee Na (corona10) * Date: 2017-04-20 03:17
When I try to `make reindent`

It was failed with this messages.

````
./python.exe ./Tools/scripts/reindent.py -r ./Lib
Traceback (most recent call last):
  File "/Users/corona10/cpython/Lib/tokenize.py", line 404, in find_cookie
    codec = lookup(encoding)
LookupError: unknown encoding: uft-8

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "./Tools/scripts/reindent.py", line 329, in <module>
    main()
  File "./Tools/scripts/reindent.py", line 101, in main
    check(arg)
  File "./Tools/scripts/reindent.py", line 115, in check
    check(fullname)
  File "./Tools/scripts/reindent.py", line 115, in check
    check(fullname)
  File "./Tools/scripts/reindent.py", line 121, in check
    encoding, _ = tokenize.detect_encoding(f.readline)
  File "/Users/corona10/cpython/Lib/tokenize.py", line 433, in detect_encoding
    encoding = find_cookie(first)
  File "/Users/corona10/cpython/Lib/tokenize.py", line 412, in find_cookie
    raise SyntaxError(msg)
SyntaxError: unknown encoding for './Lib/test/bad_coding.py': uft-8
make: *** [reindent] Error 1

```
msg291948 - (view) Author: Mariatta Wijaya (Mariatta) * (Python committer) Date: 2017-04-20 05:59
New changeset 58f3c9dc8f5626abe09ac9738c34f6ba99ce2972 by Mariatta in branch 'master':
bpo-30109: Fix reindent.py (GH-1207)
https://github.com/python/cpython/commit/58f3c9dc8f5626abe09ac9738c34f6ba99ce2972
msg291949 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2017-04-20 06:13
I don't know whether the fix for 2.7 is needed. The interface of tokenize is different in 2.7. Just run the new test and see if it fails.
msg291973 - (view) Author: Mariatta Wijaya (Mariatta) * (Python committer) Date: 2017-04-20 14:12
New changeset 430020500c56259d31e07d32771f017952bad4e0 by Mariatta in branch '3.6':
[3.6] bpo-30109: Fix reindent.py (GH-1207) (GH-1208)
https://github.com/python/cpython/commit/430020500c56259d31e07d32771f017952bad4e0
msg291974 - (view) Author: Mariatta Wijaya (Mariatta) * (Python committer) Date: 2017-04-20 14:12
New changeset 60d27f42a07d0b9d4a2c3fb160cac1683e91f196 by Mariatta in branch '3.5':
[3.5] bpo-30109: Fix reindent.py (GH-1207) (GH-1209)
https://github.com/python/cpython/commit/60d27f42a07d0b9d4a2c3fb160cac1683e91f196
History
Date User Action Args
2017-04-20 14:12:53Mariattasetmessages: + msg291974
2017-04-20 14:12:41Mariattasetmessages: + msg291973
2017-04-20 06:13:19serhiy.storchakasetnosy: + serhiy.storchaka
messages: + msg291949
2017-04-20 06:04:52Mariattasetstage: patch review -> backport needed
versions: + Python 2.7, Python 3.5, Python 3.6
2017-04-20 06:01:10Mariattasetpull_requests: + pull_request1331
2017-04-20 06:00:57Mariattasetpull_requests: + pull_request1330
2017-04-20 05:59:22Mariattasetmessages: + msg291948
2017-04-20 05:24:33Mariattasetassignee: Mariatta

nosy: + Mariatta
stage: patch review
2017-04-20 05:22:24Mariattasetpull_requests: + pull_request1329
2017-04-20 03:24:40corona10settype: behavior
versions: + Python 3.7
2017-04-20 03:17:36corona10create