how can i fix the "ran out of input" error - pickle

I'm trying to make a listing program for a school assignment where i can add things and delete things from a text document, however i keep running in to this "ran out of input" error that i cant figure out.
all im trying to do is open an empty file that can be edited
mainList = pickle.load(file_handler)
print(mainList)
input()
i am then presented with this error:
mainList = pickle.load(file_handler)
EOFError: Ran out of input
anyone got a good fix?

Related

Invalid Syntax Infinite Loop

In the Access query builder, as I am entering a formula, if there is a syntax error, I will get the usual error message stating "The expression you entered contains invalid syntax." The problem is, when I click "OK" the message comes back again, and again, and again. It it an infinite loop and the only way I have found to get out of it is filling MS Access in the task manager. Of course I lose all my unsaved work to that point.
Also happens for other syntax errors like "The expression you entered has an invalid string."
I am attaching screenshots for reference, but please do not get hung up on the syntax. I realize the syntax is not valid, it is the infinite loop of errors that results from them that is the issue.
Sample of Error
Sample of Error #2
This has been happening for a while now. Any help anyone could provide would be most appreciated.
PS. I tried this against an empty table with the same results. So it is not a case of Access trying to validate the syntax against all records in the table.

Why is this error causing a loop instead of exiting the function?

I was casting around SE and the web yesterday looking for a way to concatenate specific fields from multiple records together as part of a query/report structure in my Access database. I found this SE question which led me to Allen Browne's ConcatRelated() function here. After getting off on the wrong foot by naming the module the same as the function, I got it working as desired.
However, On my initial attempt to use it in a query, I made a dumb mistake and fed it parameters that equated to "WHERE Employee = " & [Employee] instead of the correct'WHERE Employee = ' & [Employee] & "'" necessary to evaluate as a string. This resulted in the expected 3464 (data type mismatch) runtime error but with Allen's modifications it showed the actual string that caused the error. No surprise, I'll just click ok and go fix the SQL. I was surprised to find that didn't work. As soon as I clicked away the msgbox it would come back again. I used Ctrl+Break to stop the code but clicking End caused it to go right back to the same error rather than actually ending the Function. The only way I could stop the loop was by clicking Debug which drops me into the code as expected but I couldn't get out of the code to change the original Query. Hitting reset caused the error to pop again and put me right back in the loop.
I eventually got out of it by commenting everything out of the Error Handler and telling it to Exit Function. I knew that most likely was only masking the problem so I added a counter and had it increment every time the error handler was called then checked the value in the Immediate window. Sure enough, it would go up by 10 or more each time I clicked somewhere in the query.
What I don't understand is what is causing the error to loop. Err_Handler should dump it out of the function on the first error since there's nothing telling it to attempt to Resume and it specifically directs it to Exit_Handler which resets a couple variables and then does Exit Function. Even directly putting Exit Function in Err_Handler still causes multiple increments to the my error counter. Further experimenting with Debug highlights the line Set rs = DBEngine(0)(0).OpenRecordset(strSql, dbOpenDynaset). I don't know that it helps that much since it's the first line after the function constructs the value of strSql. Commenting it out caused the next line to be highlighted.
I know why caused the initial error (my mistake) and that's an easy fix. I'm more interested in the unintended result of the mistake and the loop it created.
tl;dr
What would cause this error to loop instead of exiting or breaking?
Why would it seem to occur a finite number of times if error handling calls an immediate exit but adding something like msgbox first seems to loop infinitely, or at least until I got tired of clicking.
Is there a way to circumvent this in the code so that it actually stops after the fist error?
I initially was using a table with 600+ records but then experimented further with a small table of only 10 records.
Small Table Query SELECT TestEmpHistory.Employee, ConcatRelated("EmpGroup", "TestEmpHistory", "Employee = " & Employee) AS CompliedNames
FROM TestEmpHistory to reproduce the error.
The table TestEmpHistory is in the following format:
ID(AutoNum)|Employee|EmpGroup| Other fields not referenced in the query
ID|Employee | EmpGroup|
1 |Employee1| G&A
2 |Employee1| Sales
3 |Employee2| CSR
4 |Employee2| G&A
5 |Employee3| CSR
6 |Employee3|Programming
7 |Employee3| G&A
8 |Employee4| CSR
9 |Employee4| CSR
10|Employee4| Programming
I'm using Access 2016
Without reading the whole post, I'm guessing the reason you're in a loop is because it's running this code for every row returned by the query. The only way to get out of this is, when you break into the code temporarily comment it all out so that the query can complete without generating the error for every row. Once this has completed, you can go back and correct your query design before un-commenting the function code and trying again.

Complie Error: Method or Data Member not found, but it does exist

Having a strange problem in vba access. I have a text control control called txtUserName on a form and am trying to get the contents which is all but child's play. When I try to run or complie, I get the Method or Data Member not found error. However, when I type me. Intellisense shows txtUserName. I have gone as far as copying and pasting the name from the control's properties and still get the error. What am I missing? I am completely perplexed.
Thanks in advance
Don
In this case, I was just building a SQL string. I did find the problem, there was a bad control reference, however, it was not the one that was highlighted (highlighted was the first value in an insert into string and it was actually the 3rd value)

xcode wrong error. I deleted the line with the error and the error is still there, on a blank line

I just delete the var isTied and an error appears at the next line where I referenced this var. So I delete the reference but the error is still there, even with the blank line.
I tried to put back the variable and a reference to it, but no effect.
Another error appears at class ViewController: UIViewController : "Class "ViewController" has no initializers". And refers to an variable that I leave without value
var whoIsTheWinner : Int
So I just add a value:
var whoIsTheWinner : Int = 3
The error remains at the class ViewController and at the variable the error is now gray instead of red...
I can't see any errors and I already tried to close and re-open xcode.
Any ideas?
My Xcode is 7.2(7C68)
Have you tried doing a deep clean of the project?
Clean build with
Shift+Cmd+K
Clean build folder with
Option+Shift+Command+K

MS Access VBA Compile Error on "x="

Everytime I try to compile my VBA code, I'm getting an error that says "Can't find project or library".
I have no idea which library I'm missing because all that the debugger highlights is a portion of one of my VBA lines:
x=
the full line looks like this:
x = MsgBox("You must select a manufacturer")
Any clues what library I need to include?
Thanks Hans,
I didn't notice that one of my references was labeled as "MISSING".
...
First thing to check: from VB Editor main menu, choose Tools->References. If any of the selected (checked) references are "Missing", all sorts of weird crap can happen with your code. Fix any that are missing