Message269368
DeprecationWarning is used when we want to remove a feature. It becomes an error in the future. FutureWarning is used when we want change the meaning of a feature instead of removing it. For example re.split(':*', 'a:bc') emits a FutureWarning and returns ['a', 'bc'] because there is a plan to make it returning ['', 'a', 'b', 'c', ''].
I think "a silent warning" means that it should emit a DeprecationWarning or a PendingDeprecationWarning. Since there is no haste, we should use 2-releases deprecation period. After this a deprecation can be changed to a SynataxWarning in 3.8 and to a UnicodeDecodeError (for strings) and a ValueError (for bytes) in 4.0. The latter are converted to SyntaxError by parser. At the end we should get the same behavior as for truncated \x and \u escapes.
>>> '\u'
File "<stdin>", line 1
SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 0-1: truncated \uXXXX escape
>>> b'\x'
File "<stdin>", line 1
SyntaxError: (value error) invalid \x escape at position 0
Maybe change a parser to convert warnings to a SyntaxWarning? |
|
Date |
User |
Action |
Args |
2016-06-27 11:00:51 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka, gvanrossum, vstinner, ezio.melotti, r.david.murray, martin.panter, ztane, abarry |
2016-06-27 11:00:51 | serhiy.storchaka | set | messageid: <1467025251.83.0.565670504698.issue27364@psf.upfronthosting.co.za> |
2016-06-27 11:00:51 | serhiy.storchaka | link | issue27364 messages |
2016-06-27 11:00:51 | serhiy.storchaka | create | |
|