classification
Title: ParseError in test_all_project_files()
Type: behavior Stage: resolved
Components: 2to3 (2.x to 3.x conversion tool), Tests Versions:
process
Status: closed Resolution: duplicate
Dependencies: Superseder: test_lib2to3.test_parser.test_all_project_files() fails
View: 30117
Assigned To: Nosy List: benjamin.peterson, serhiy.storchaka, xtreak
Priority: normal Keywords:

Created on 2017-10-21 17:08 by serhiy.storchaka, last changed 2018-09-26 12:39 by serhiy.storchaka. This issue is now closed.

Messages (3)
msg304715 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2017-10-21 17:08
test_all_project_files() in test_lib2to3 emits warnings in verbose mode.

/home/serhiy/py/cpython/Lib/lib2to3/tests/test_parser.py:415: UserWarning: ParseError on file /home/serhiy/py/cpython/Lib/lib2to3/main.py (bad input: type=22, value='=', context=('', (130, 38)))
  warnings.warn('ParseError on file %s (%s)' % (filepath, err))
/home/serhiy/py/cpython/Lib/lib2to3/tests/test_parser.py:415: UserWarning: ParseError on file /home/serhiy/py/cpython/Lib/lib2to3/tests/pytree_idempotency.py (bad input: type=22, value='=', context=('', (49, 33)))
  warnings.warn('ParseError on file %s (%s)' % (filepath, err))

ParseError is raised by lines like:

    print("Use --help to show usage.", file=sys.stderr)

Seems "from __future__ import print_function" doesn't work.
msg326457 - (view) Author: Karthikeyan Singaravelan (xtreak) * (Python committer) Date: 2018-09-26 12:16
The warnings were introduced with issue13125 and this was fixed with issue30117 . I verified it as below : 

➜  cpython git:(master) git checkout 14e976e00e65bf343ba0fca016c3c9132a843daf~1
➜  cpython git:(ce0f33d045) git clean -xdf && ./configure --with-pydebug && make -s -j4
➜  cpython git:(ce0f33d045) time ./python.exe -I -S -m test.regrtest -vv test_import test_lib2to3 >/dev/null
Warning -- files was modified by test_import
  Before: []
  After:  ['@test_41673_tmp.pyc']
/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/lib2to3/tests/test_parser.py:430: UserWarning: ParseError on file /Users/karthikeyansingaravelan/stuff/python/cpython/Lib/lib2to3/main.py (bad input: type=22, value='=', context=('', (130, 38)))
  warnings.warn('ParseError on file %s (%s)' % (filepath, err))
/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/lib2to3/tests/test_parser.py:430: UserWarning: ParseError on file /Users/karthikeyansingaravelan/stuff/python/cpython/Lib/lib2to3/tests/pytree_idempotency.py (bad input: type=22, value='=', context=('', (49, 33)))
  warnings.warn('ParseError on file %s (%s)' % (filepath, err))
./python.exe -I -S -m test.regrtest -vv test_import test_lib2to3 > /dev/null  44.31s user 1.18s system 94% cpu 47.971 total

# Fixed commit

➜  cpython git:(14e976e00e) time ./python.exe -I -S -m test.regrtest -vv test_import test_lib2to3 >/dev/null
Warning -- files was modified by test_import
  Before: []
  After:  ['@test_41839_tmp.pyc']
./python.exe -I -S -m test.regrtest -vv test_import test_lib2to3 > /dev/null  50.50s user 1.56s system 91% cpu 56.778 total

The test_import warning is also not reproducible with master as of now I will find the necessary commit and reply back in issue28655. As part of triaging I am closing this as duplicate with issue30117 as superseder which has the fix. Feel free to reopen this if needed.

Thanks
msg326461 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2018-09-26 12:39
Thanks Karthikeyan!
History
Date User Action Args
2018-09-26 12:39:44serhiy.storchakasetmessages: + msg326461
2018-09-26 12:16:18xtreaksetstatus: open -> closed

superseder: test_lib2to3.test_parser.test_all_project_files() fails

nosy: + xtreak
messages: + msg326457
resolution: duplicate
stage: resolved
2017-10-21 17:22:48serhiy.storchakalinkissue28655 dependencies
2017-10-21 17:08:02serhiy.storchakacreate