[issue9690] Cannot distinguish bstr from str in ast module.

2010-08-27 Thread Kay Hayen
Kay Hayen kayha...@gmx.de added the comment: This is to inform you that I worked around the bug by reading the source file in question and checking the indicated position. This is currently the only way to decide if a literal should be unicode or str with unicode_literals from future

[issue9690] Cannot distinguish bstr from str in ast module.

2010-08-27 Thread Benjamin Peterson
Benjamin Peterson benja...@python.org added the comment: 2010/8/27 Kay Hayen rep...@bugs.python.org: Kay Hayen kayha...@gmx.de added the comment: This is to inform you that I worked around the bug by reading the source file in question and checking the indicated position. This is currently

[issue9690] Cannot distinguish bstr from str in ast module.

2010-08-26 Thread Kay Hayen
Kay Hayen kayha...@gmx.de added the comment: You didn't understand. Please tell me, how to decide if this is a unicode literal or a str (2.x) literal: value=Str(s='d') It's just not possible. When I found a from __future__ import unicode_literals in the code before, it means I should convert

[issue9690] Cannot distinguish bstr from str in ast module.

2010-08-26 Thread Benjamin Peterson
Benjamin Peterson benja...@python.org added the comment: I see that it's a problem, but there's nothing we can do about it now, so you'll have to determine whether it was unicode literals or not based on compile flags. -- ___ Python tracker

[issue9690] Cannot distinguish bstr from str in ast module.

2010-08-26 Thread Kay Hayen
Kay Hayen kayha...@gmx.de added the comment: Hello Benjamin, thank you for the response. What do you mean with there is nothing we can do about it. Is it not possible to add another field indicating the prefix given to a literal? BTW: I believe raw strings are also no longer recognizable.

[issue9690] Cannot distinguish bstr from str in ast module.

2010-08-26 Thread Benjamin Peterson
Benjamin Peterson benja...@python.org added the comment: 2010/8/26 Kay Hayen rep...@bugs.python.org: Kay Hayen kayha...@gmx.de added the comment: Hello Benjamin, thank you for the response. What do you mean with there is nothing we can do about it. Is it not possible to add another field

[issue9690] Cannot distinguish bstr from str in ast module.

2010-08-25 Thread Kay Hayen
New submission from Kay Hayen kayha...@gmx.de: There is no way to decide if a string literal should be non-unicode when the default has been set to unicode_literals. Please see: import ast ast.dump( ast.parse( c = d ) ) Module(body=[Assign(targets=[Name(id='c', ctx=Store())],

[issue9690] Cannot distinguish bstr from str in ast module.

2010-08-25 Thread Benjamin Peterson
Benjamin Peterson benja...@python.org added the comment: You'll have to look at the compile flags or search the future flags. -- nosy: +benjamin.peterson resolution: - wont fix status: open - closed ___ Python tracker rep...@bugs.python.org