LionHeart123 / pyscripter

Automatically exported from code.google.com/p/pyscripter
0 stars 0 forks source link

Encoding with append to lists. Ascii and UTF8 confusion. #702

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
//What steps will reproduce the problem?
1. Open Pyscripter and post the following code:

result = []
for i in range(2):
    elem = raw_input('Enter element: ')##.encode("utf8")
    result.append(elem)
    print result

2. Run the code and when asked for two inputs just type 'a' in one and 'b' in 
the other.

3. Do the same procedure running it on repl.it, like in: http://repl.it/E07#

//What is the expected output? What do you see instead?
Somehow with that append statement there the input generates an error coming 
out with an extra 'u', so the console with the above inputs will print:
[u'a']
[u'a', u'b']

Instead of the expected
['a']
['a', 'b']

What version of the product are you using? On what operating system?
2.5.3.0 x86

Cheers
Thank you for this software.

Original issue reported on code.google.com by probi...@gmail.com on 17 Nov 2012 at 6:16