[Tutor] Runtime error while Test data creation
steve at pearwood.info
Sat Oct 8 14:05:54 CEST 2011
> Hello all,
> I am trying to create some test data for a search module that I am building.
> Since I dont want to hit performance related issues late in the game, I
> decided to create half a million records in the DB.
> My approach is create a csv file with valid UUIDs which I already have. Read
> each record from csv and generate random data and do DB insert as long the
> csv file has records in them. This crashes near 100000 record insertions.
> The problem is that my program eventually fails with this error. Any ideas
> what I can improve to make it go all the way?
> Runtime Error!
> Program: C:\Python27\pythonw.exe
> This app has requested the Runtime to terminate it in an unusual way. Please
> contact application support team
You should try to identify the actual error. That probably means running
the script directly in Python, using the command line, so as to avoid
unhelpful error messages like the above.
Are you using IDLE or some other IDE? They usually make debugging much
harder. Try just running the script directly from the command line. If
you have Windows:
Start menu > Run
Type "cmd" [enter]
Type "C:\python26\python.exe myscript.py" [enter]
You may have to change the pathname to the Python executable, if you are
using a different version, or I might have just got it wrong. And of
course change "myscript.py" to the name of your script.
> Here is the code that I wrote to do this.
Please do not send code using HTML or "rich text", because it messes up
the formatting of the code and makes it difficult or impossible to tell
what it actually does.
More information about the Tutor