Linked Questions
12 questions linked to/from builtins.TypeError: must be str, not bytes
1
vote
1
answer
303
views
EOFError Python 2.7 to 3 migration [duplicate]
Possible Duplicate:
builtins.TypeError: must be str, not bytes
I wrote a program to write a dict to file and in Python 2.7 it works well, but now in Python 3 I receive TypeError: 'str' does not ...
0
votes
1
answer
190
views
Python write() argument must be str [duplicate]
I'm using this Python script to convert .XML wordpress files to .txt. This works fine for blogposts, however other post types it doesn't like.
I've changed around some code, but it still isn't working ...
255
votes
8
answers
414k
views
Writing Unicode text to a text file? [duplicate]
I'm pulling data out of a Google doc, processing it, and writing it to a file (that eventually I will paste into a Wordpress page).
It has some non-ASCII symbols. How can I convert these safely to ...
348
votes
3
answers
152k
views
Using pickle.dump - TypeError: must be str, not bytes
I'm using python3.3 and I'm having a cryptic error when trying to pickle a simple dictionary.
Here is the code:
import os
import pickle
from pickle import *
os.chdir('c:/Python26/progfiles/')
def ...
82
votes
2
answers
203k
views
Python 3 TypeError: must be str, not bytes with sys.stdout.write()
I was looking for a way to run an external process from python script and print its stdout messages during the execution.
The code below works, but prints no stdout output during runtime. When it ...
30
votes
7
answers
46k
views
Download attachments from Gmail using Gmail API
I am using Gmail API to access my Gmail data and Google Python API client.
According to documentation to get the message attachment they gave one sample for Python. But the same code I tried then I am ...
7
votes
3
answers
12k
views
Save HTML Source Code to File
How can I copy the source code of a website into a text file in Python 3?
EDIT:
To clarify my issue, here's what I have:
import urllib.request
def extractHTML(url):
f = open('temphtml.txt', 'w')...
2
votes
1
answer
4k
views
Python Write to Text File Skip Bad Lines
RESOLVED: Problem had to do with Python version, refer to stackoverflow.com/a/5513856/2540382
I am fiddling with htm -> txt file conversion and am having a little trouble. My project is ...
0
votes
3
answers
1k
views
Python writing to XML and not over writing input
I am attempting to create a program that will allow me to take in peoples info and then write it to an xml doc, save it, and then once the program is ran again, it will pick up from where I left off. ...
-1
votes
1
answer
774
views
HTMLTestRunner write() argument must be str, not bytes
I'm using HTMLRunner 1.1.1 which is compatible with python 3.5
my code is :
dir=os.getcwd()
photo_tests=unittest.TestLoader().loadTestsFromTestCase(Photo_Tests.Photo_Test)
photo_tests_suit=unittest....
0
votes
1
answer
502
views
Django on heroku with s3 for media files. Have to edit model save method to switch between dev and prod?
Hopefully someone can help with this. Thanks for having a look!
I am fairly new to django and programming in general so please bear with me. I am building a custom Profile app that has an avatar ...
0
votes
1
answer
382
views
How to create and write incrementing .png files with python?
Im am currently trying to generate QR codes for the keys of a dictionary.If I try that for one key only, it is no problem at all. However, if I try to automatize the process, incrementing my file ...