Chris Everest wrote: >> I write that, so hopefully I can help. Hi nice to meet you! I'm hanging out in the chat also since couple of days hoping to get in contact :) Sorry for answering a bit late
>> >>> I have a directory full of any kind of files, some of this filenames are >>> in latin1 and when I run my django app I get UnicodeDecodeError like this >>> >>> Request Method: GET >>> Request URL: http://myhost/washtub/mediapool/scan >>> Exception Type: DjangoUnicodeDecodeError >>> Exception Value: >>> >>> ('utf8', '/MUSIC/bettie/music2/Buena Vista Social Club - Veinte >>> A\xf1os.mp3', 73, 77, 'invalid data') ('utf8', '/MUSIC/bettie/music2/Buena Vista Social Club - Veinte A\xf1os.mp3', 73, 77, 'invalid data') this is an example for filenames that has different char encoding, on the filesystem I could see it as Veinte A?nos I solved it quickly installing an external tool "convmv" that converts filenames chars encoding on the filesystem...it was "quick and dirty" > Hey Fruity... can you send me an example file that breaks the > encoding? I would like to use it to test against my system. See what > I can figure out. Yes, after converting file names on the filesystem it is time for tags :) This is the traceback I get from the django output: Environment: Request Method: GET Request URL: http://dmmdb/washtub/mediapool/scan Django Version: 1.1 beta 1 SVN-11273 Python Version: 2.6.2 Installed Applications: ['django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', 'django.contrib.admin', 'wtsite.controller', 'wtsite.mediapool'] Installed Middleware: ('django.middleware.common.CommonMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'djangologging.middleware.LoggingMiddleware') Traceback: File "/usr/lib/python2.6/dist-packages/django/core/handlers/base.py" in get_response 92. response = callback(request, *callback_args, **callback_kwargs) File "/usr/lib/python2.6/dist-packages/django/contrib/auth/decorators.py" in __call__ 78. return self.view_func(request, *args, **kwargs) File "/home/fruity/washtub/wtsite/mediapool/views.py" in file_scanner 150. list = build_file_list2(directory) File "/home/fruity/washtub/wtsite/mediapool/views.py" in build_file_list2 81. s.save() File "/home/fruity/washtub/wtsite/mediapool/models.py" in save 153. super(Song, self).save(force_insert, force_update) File "/usr/lib/python2.6/dist-packages/django/db/models/base.py" in save 410. self.save_base(force_insert=force_insert, force_update=force_update) File "/usr/lib/python2.6/dist-packages/django/db/models/base.py" in save_base 495. result = manager._insert(values, return_id=update_pk) File "/usr/lib/python2.6/dist-packages/django/db/models/manager.py" in _insert 177. return insert_query(self.model, values, **kwargs) File "/usr/lib/python2.6/dist-packages/django/db/models/query.py" in insert_query 1087. return query.execute_sql(return_id) File "/usr/lib/python2.6/dist-packages/django/db/models/sql/subqueries.py" in execute_sql 320. cursor = super(InsertQuery, self).execute_sql(None) File "/usr/lib/python2.6/dist-packages/django/db/models/sql/query.py" in execute_sql 2369. cursor.execute(sql, params) File "/usr/lib/python2.6/dist-packages/django/db/backends/util.py" in execute 19. return self.cursor.execute(sql, params) File "/usr/lib/python2.6/dist-packages/django/db/backends/mysql/base.py" in execute 84. return self.cursor.execute(query, args) File "/var/lib/python-support/python2.6/MySQLdb/cursors.py" in execute 168. if not self._defer_warnings: self._warning_check() File "/var/lib/python-support/python2.6/MySQLdb/cursors.py" in _warning_check 82. warn(w[-1], self.Warning, 3) Exception Type: Warning at /washtub/mediapool/scan Exception Value: Incorrect string value: '\xC2\x9Cur' for column 'title' at row 1 I do not know yet wich file has the title tag that raise the exception, and if I may say, whouldn't be easyer to get the build_list stuff in an external util.py and than import it in the view? just for clearance... Ciao q9c9p ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ Savonet-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/savonet-users
