[issue30682] f-string assert is too restrictive

2017-06-16 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- type: behavior -> crash ___ Python tracker ___

[issue30682] f-string assert is too restrictive

2017-06-16 Thread Eric V. Smith
Eric V. Smith added the comment: Terry: The eval is important. The bug was in evaluating an f-string that consisted of two bytes: a backslash followed by a newline. And just as: eval("'\\\n'") == '' # len == 0 so should eval("f'\\\n'") == '' # len == 0 It's the second one that was throwing

[issue30682] f-string assert is too restrictive

2017-06-16 Thread Terry J. Reedy
Terry J. Reedy added the comment: Before the patch, eval("f'\\\n'") gives me the same assertion failure, with an IDLE freeze instead of core dump equivalent, but is seems that the string should be of length 2. >>> len('\\\n') 2 >>> len(f'\\\n') 2 -- nosy: +terry.reedy stage: ->

[issue30682] f-string assert is too restrictive

2017-06-16 Thread Eric V. Smith
Eric V. Smith added the comment: New changeset 2eca5b465f7404cc8484457b7966f828f434ec20 by ericvsmith (Serhiy Storchaka) in branch '3.6': [3.6] bpo-30682: Removed a too-strict assertion that failed for certain f-strings. (GH-2232) (#2242)

[issue30682] f-string assert is too restrictive

2017-06-16 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- pull_requests: +2286 ___ Python tracker ___ ___

[issue30682] f-string assert is too restrictive

2017-06-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 11e97f2f80bf65cc828c127eafc95229df35d403 by Serhiy Storchaka (ericvsmith) in branch 'master': bpo-30682: Removed a too-strict assertion that failed for certain f-strings. (#2232)

[issue30682] f-string assert is too restrictive

2017-06-16 Thread Eric V. Smith
Changes by Eric V. Smith : -- pull_requests: +2285 ___ Python tracker ___ ___

[issue30682] f-string assert is too restrictive

2017-06-16 Thread Eric V. Smith
New submission from Eric V. Smith: >>> eval("f'\\\n'") python: Python/ast.c:4906: FstringParser_ConcatFstring: Assertion `!state->last_str || PyUnicode_GET_LENGTH(state->last_str) != 0' failed. [2]12810 abort (core dumped) ./python The problem is that some literal strings are zero length.