FS#32986 - gendummydata.py gives a UnicodeDecodeError

Attached to Project: AUR web interface
Opened by Marcel Korpel (Marcel-) - Thursday, 06 December 2012, 13:04 GMT
Last edited by canyonknight (canyonknight) - Monday, 18 March 2013, 19:44 GMT
Task Type Bug Report
Category Backend
Status Closed
Assigned To canyonknight (canyonknight)
Lukas Fleischer (lfleischer)
Architecture All
Severity Low
Priority Normal
Reported Version 2.0.1
Due in Version 2.1.0
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

When following the AUR installation guide, gendummydata.py errors out:

$ python gendummydata.py dummy-data.sql
DEBUG: Grabbing words from seed file...
Traceback (most recent call last):
File "gendummydata.py", line 90, in <module>
contents = fp.readlines()
File "/usr/lib/python3.3/encodings/ascii.py", line 26, in decode
return codecs.ascii_decode(input, self.errors)[0]
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 1793: ordinal not in range(128)

According to canyonknight, it looks like unicode characters in the seed
file are causing this issue.
This task depends upon

Closed by  canyonknight (canyonknight)
Monday, 18 March 2013, 19:44 GMT
Reason for closing:  Fixed
Additional comments about closing:  Fixed in 2.1.0
Comment by canyonknight (canyonknight) - Thursday, 06 December 2012, 21:38 GMT
I'm having trouble getting this error to occur on my setup. If you could try the attached patch and let me know if that fixes the error it would be appreciated.
Comment by Marcel Korpel (Marcel-) - Friday, 07 December 2012, 10:05 GMT
Now I get the following messages, though a dummy-data.sql is generated. When I try to import the file, it doesn't seem to import anything, I don't see new records in the database. I'll attach my dummy-data.sql.

DEBUG: Grabbing words from seed file...
DEBUG: Generating random user names...
DEBUG: Generating random package names...
DEBUG: Creating SQL statements for users.
DEBUG: Number of developers: 30
DEBUG: Number of trusted users: 60
DEBUG: Number of users: 210
DEBUG: Number of packages: 900
DEBUG: Creating SQL statements for packages.
Traceback (most recent call last):
File "gendummydata.py", line 209, in <module>
fortune = subprocess.getoutput(FORTUNE_CMD).replace("'","")
File "/usr/lib/python3.3/subprocess.py", line 705, in getoutput
return getstatusoutput(cmd)[1]
File "/usr/lib/python3.3/subprocess.py", line 681, in getstatusoutput
text = pipe.read()
File "/usr/lib/python3.3/encodings/ascii.py", line 26, in decode
return codecs.ascii_decode(input, self.errors)[0]
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 785: ordinal not in range(128)
Comment by canyonknight (canyonknight) - Wednesday, 23 January 2013, 22:35 GMT
  • Field changed: Due in Version (Undecided → 2.1.0)

Loading...