Python 2.7 - b'' appears in front of a string in output file
I added this in my code
reload(sys)
sys.setdefaultencoding('UTF8')
then removed the function str() before the output of my string and now it works fine, thanks!
I wrote a Python script running a SQL query and creating an external file from the output.
It works well on my computer but when I try to run the exact same script on another computer the output file is different.
In mine the content of the content of the output file looks like this : FR, DE, CA
and with the other computer it looks like this: b'FR', b'DE', b'CA'
There is this b'' around the string and I don't know what I should configure in the 2nd computer to remove that. Both computers are using Python 2.7.11.
I noticed the b'' thing appears in the 2nd computer after I use the function: smart_str from django.utils.encoding
Before I pass the string to the output file I do:  str(x)  but the b'' is not removed.
Thanks in advance for your help!