Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(68297)

#18038: Unhelpful error message on invalid encoding specification

Can't Edit
Can't Publish+Mail
Start Review
Created:
6 years ago by maxcantor
Modified:
6 years ago
Reviewers:
ezio.melotti, storchaka
CC:
loewis, ezio.melotti, devnull_psf.upfronthosting.co.za, storchaka, maxcantor_gmail.com
Visibility:
Public.

Patch Set 1 #

Patch Set 2 #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats Patch
Lib/test/test_pep263.py View 1 1 chunk +21 lines, -0 lines 2 comments Download
Parser/tokenizer.c View 1 2 chunks +7 lines, -7 lines 0 comments Download

Messages

Total messages: 2
ezio.melotti
http://bugs.python.org/review/18038/diff/8232/Lib/test/test_pep263.py File Lib/test/test_pep263.py (right): http://bugs.python.org/review/18038/diff/8232/Lib/test/test_pep263.py#newcode48 Lib/test/test_pep263.py:48: self.assertRaisesRegexp(SyntaxError, 'fake', compile, This should be assertRaisesRegex (at least ...
6 years ago #1
storchaka_gmail.com
6 years ago #2
http://bugs.python.org/review/18038/diff/8232/Lib/test/test_pep263.py
File Lib/test/test_pep263.py (right):

http://bugs.python.org/review/18038/diff/8232/Lib/test/test_pep263.py#newcode48
Lib/test/test_pep263.py:48: self.assertRaisesRegexp(SyntaxError, 'fake',
compile,
On 2013/06/08 21:11:45, ezio.melotti wrote:
> This should be assertRaisesRegex (at least on 3.x).
> 
> Even though you prefer this form to the context manager, in this specific case
> you can both make the code more readable and also shorter by doing:
> with self.assertRaisesRegexp(SyntaxError, 'fake'):
>     compile('# -*- coding: fake -*-\n', 'dummy', 'exec')
> It took me a bit to figure out what was going on here.

May be.
Sign in to reply to this message.

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+