multiple errors

Ask questions about projects relating to: computer science or pure mathematics (such as probability, statistics, geometry, etc...).

Moderators: kgudger, bfinio, Moderators

Locked
Grendalov
Posts: 1
Joined: Sat Dec 12, 2015 12:57 pm
Occupation: Parent

multiple errors

Post by Grendalov »

Hello,

My dad and I have been working on this project for the past couple weekends. We have been able to figure out how to fix some of the errors we get. There are some we just can not figure out. We have tried looking online to find the solution but have been unsuccessful. When we run this program from the command line a result is returned for password0. When we run the program using IDLE, we receive the following "Traceback" errors. Please help.

Traceback (most recent call last):
File "C:\Users\Radean\Documents\my stuff\crack3.py", line 451, in <module>
sys.exit(main(sys.argv[1:]))
File "C:\Users\Radean\Documents\my stuff\crack3.py", line 402, in main
foundit = search_method_3("passwords1.txt")
File "C:\Users\Radean\Documents\my stuff\crack3.py", line 226, in search_method_3
words = f.readlines()
File "C:\Users\Radean\AppData\Local\Programs\Python\Python35-32\lib\encodings\cp1252.py", line 23, in decode
return codecs.charmap_decode(input,self.errors,decoding_table)[0]
UnicodeDecodeError: 'charmap' codec can't decode byte 0x81 in position 5706: character maps to <undefined>
HowardE
Posts: 496
Joined: Thu Nov 20, 2014 1:35 pm
Occupation: Science Buddies content developer
Project Question: N/A
Project Due Date: N/A
Project Status: Not applicable

Re: multiple errors

Post by HowardE »

I'll assume the program is called 'crack3' because you wrote your own. The error is telling you that there's something in the file that readlines() can't parse. Some odd unprintable character , hex 0x81 or ASCII 129. You ended up with a bad download of passwords.txt somehow. Did you also modify the passwords file?

It's telling you that it's at position 5706 in the file, so if you were to bring the file up in a text editor and hit the forward arrow 5,705 times, the next thing the cursor was sitting on would be the bad character. It might just be easier to try downloading the file again, or look at where you added things to it and see if anything there looks weird. Look for punctuation marks of some kind - those can all look the same and passwords don't need those anyway.

If you're still stuck, write back and I'll help you fix it.

Howard
Locked

Return to “Grades 9-12: Math and Computer Science”