4

I have installed mysql 5.5 and mysqldb for python [MySQL-python-1.2.3.win32-py2.7], python version 2.7

also, create new database with charset utf8 and installed from apple itunes.rar and extract it.

then open cmd and go to python directory then type: EPFImporter.py itunes

itunes: folder contains application EPF

when run it i got the following error:

2014-09-02 14:49:33,706 [INFO]: Beginning import for the following directories:
    it
2014-09-02 14:49:33,707 [INFO]: Importing files in it
2014-09-02 14:49:33,709 [INFO]: Starting import of C:\Python27\app\it...
2014-09-02 14:49:33,710 [INFO]: Beginning full ingest of app00511_application (1315569 records)
2014-09-02 14:49:34,698 [ERROR]: Fatal error encountered while ingesting 'C:\Python27\app\it\application'
Traceback (most recent call last):
  File "C:\Python27\app\EPFIngester.py", line 129, in ingestFull
    self._populateTable(self.tmpTableName, skipKeyViolators=skipKeyViolators)
  File "C:\Python27\app\EPFIngester.py", line 380, in _populateTable
    cur.execute(exStr)
  File "C:\Python27\lib\site-packages\MySQLdb\cursors.py", line 202, in execute
    self.errorhandler(self, exc, value)
  File "C:\Python27\lib\site-packages\MySQLdb\connections.py", line 36, in defaulterrorhandler
    raise errorclass, errorvalue
OperationalError: (1366, "Incorrect string value: '\\xF0\\x9F\\x91\\x8D \\xE8...' for column 'description' at row 47")
2014-09-02 14:49:34,700 [ERROR]: Last record ingested before failure: 1200
2014-09-02 14:49:34,703 [INFO]: Import of it completed at: 14-09-02 14:49:34
2014-09-02 14:49:34,703 [INFO]: Total import time for it: 0:00:00.99
2014-09-02 14:49:34,703 [WARNING]: The following files encountered errors and were not imported:
 application
2014-09-02 14:49:34,706 [WARNING]: The following files encountered errors and were not imported:
        it/['application']
2014-09-02 14:49:34,706 [INFO]: Total import time for all directories: 0:0

I read in some articles that said we should use utf8mb4 instead but when change charset for connection in EPFIngester.py file to utf8mb4 like the follwoing:

conn = MySQLdb.connect(
        charset='utf8mb4', 
        host=self.dbHost, 
        user=self.dbUser, 
        passwd=self.dbPassword, 
        db=self.dbName)
        return conn

i got this error:

C:\Python27\app>EPFImporter.py it
2014-09-02 14:58:33,742 [INFO]: Beginning import for the following directories:
    it
2014-09-02 14:58:33,743 [INFO]: Importing files in it
2014-09-02 14:58:33,744 [INFO]: Starting import of C:\Python27\app\it...
2014-09-02 14:58:33,746 [INFO]: Beginning full ingest of app00511_application (1
315569 records)
2014-09-02 14:58:33,769 [ERROR]: Fatal error encountered while ingesting 'C:\Pyt
hon27\app\it\application'
Traceback (most recent call last):
  File "C:\Python27\app\EPFIngester.py", line 128, in ingestFull
    self._createTable(self.tmpTableName)
  File "C:\Python27\app\EPFIngester.py", line 297, in _createTable
    conn = self.connect()
  File "C:\Python27\app\EPFIngester.py", line 240, in connect
    db=self.dbName)
  File "C:\Python27\lib\site-packages\MySQLdb\__init__.py", line 81, in Connect
    return Connection(*args, **kwargs)
  File "C:\Python27\lib\site-packages\MySQLdb\connections.py", line 215, in __in
it__
    self.set_character_set(charset)
  File "C:\Python27\lib\site-packages\MySQLdb\connections.py", line 298, in set_
character_set
    super(Connection, self).set_character_set(charset)
OperationalError: (2019, "Can't initialize character set utf8mb4 (path: C:\\mysq
l\\\\share\\charsets\\)")
2014-09-02 14:58:33,772 [ERROR]: Last record ingested before failure: -1
2014-09-02 14:58:33,773 [INFO]: Import of it completed at: 14-09-02 14:58:33
2014-09-02 14:58:33,775 [INFO]: Total import time for it: 0:00:00.02
2014-09-02 14:58:33,775 [WARNING]: The following files encountered errors and we
re not imported:
 application
2014-09-02 14:58:33,775 [WARNING]: The following files encountered errors and we
re not imported:
        it/['application']
2014-09-02 14:58:33,776 [INFO]: Total import time for all directories: 0:00:00.0
3

I am searching to solve this issue but no luck. could anyone face like this issue and has the solution.

Note: all operations above on Windows.

Joe Murray
  • 585
  • 5
  • 21
Ayman Hussein
  • 3,817
  • 7
  • 28
  • 48

1 Answers1

0

I'm not sure, but it appears you are importing the application files rather than a database. See https://www.apple.com/itunes/affiliates/resources/documentation/epfimporter.html#configure-epfimporter for installation and setup.

Joe Murray
  • 585
  • 5
  • 21