Author serhiy.storchaka
Recipients ebarry, ezio.melotti, gvanrossum, haypo, martin.panter, r.david.murray, serhiy.storchaka, ztane
Date 2016-06-27.11:00:51
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1467025251.83.0.565670504698.issue27364@psf.upfronthosting.co.za>
In-reply-to
Content
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?
History
Date User Action Args
2016-06-27 11:00:51serhiy.storchakasetrecipients: + serhiy.storchaka, gvanrossum, haypo, ezio.melotti, r.david.murray, martin.panter, ztane, ebarry
2016-06-27 11:00:51serhiy.storchakasetmessageid: <1467025251.83.0.565670504698.issue27364@psf.upfronthosting.co.za>
2016-06-27 11:00:51serhiy.storchakalinkissue27364 messages
2016-06-27 11:00:51serhiy.storchakacreate