Up till now I've had no problems using the Python 2.7.8 csv module 
to write to Python dictionary objects to a csv file, using 
the csv.DictWriter, however now it appears that I'm sending it an object 
that it can't handle (See the attached file for an edited/readable version 
of the python object throwing the ValueError exception.). It doesn't appear 
to have many new characters which might be causing the problem, except that 
it seems to have comma characters as part of some of the field values. So 
I'm wondering if that could be the problem?

Would using the csv.Sniffer() possibly help solve my  problem(s)?

I've not seen this before so I would appreciate any help or suggestions in 
trying to figure this out.

Is there any way to fine-tune my exception checking/catching to better show 
me where the problem is? I'm currently using just a try/except in the code 
that's throwing the error.     

Thanks.

Henry

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/8477aa5e-e849-4331-aa36-6c0c99f6b09b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


    {
        'has_overrides': False, 
        'points_possible': 33333, 
        'updated_at': '2015-03-27T17:04:57Z', 
        'turnitin_enabled': 'None', 
        'course_id': 5269, 
        'id': 55988, 
        'locked_for_user': False,
        'muted': False, 
        'grading_type': 'points', 
        'peer_reviews': False, 
        'discussion_topic': 
        {
            'attachments': [], 
            'delayed_post_at': None, 
            'last_reply_at': '2015-03-27T17:04:46Z', 
            'locked_for_user': False, 
            'can_group': True, 
            'message': '<p>e5d6 imutgy8kly8u9poy8.,9p8ip90</p>', 
            'read_state': 'unread', 
            'id': 45944, 
            'unread_count': 0, 
            'subscribed': False, 
            'title': '578o,y89poy890p[ji0[pi0k', 
            'discussion_type': 'side_comment', 
            'user_can_see_posts': True, 
            'posted_at': '2015-03-27T17:04:46Z', 
            'require_initial_post': None, 
            'pinned': False, 
            'discussion_subentry_count':0, 
            'topic_children': [], 
            'user_name': ' xxxxx xxxxxxxx', 
            'root_topic_id': None,
            'assignment_id': 55988, 
            'podcast_has_student_posts': False, 
            'podcast_url': None, 
            'html_url': 
'https://xxxxxx.beta.instructure.com/courses/5269/discussion_topics/45944', 
            'can_unpublish': True, 
            'permissions': 
            {
                'attach': True, 
                'update': True,
                'delete': True
            }, 
            'locked': False, 
            'group_category_id': None, 
            'can_lock': True, 
            'lock_at': None, 
            'author': 
            {
                'avatar_image_url': 
'https://xxxxxx.instructure.com/images/thumbnails/275792/EqKbSWlDn3akrSERY2sxyR32unu1YUHG8rhQYCR1',
 
                'display_name': 'xxxxx xxxxxxxx', 
                'id': 1, 
                'html_url': 
'https://xxxxxx.beta.instructure.com/courses/5269/users/1'
            }, 
            'url': 
'https://xxxxxx.beta.instructure.com/courses/5269/discussion_topics/45944', 
            'published': True, 
            'position': None
        }, 
        'integration_data': {}, 
        'description': '<p>e5d6 imutgy8kly8u9poy8.,9p8ip90</p>', 
        'anonymous_peer_reviews': 'None', 
        'grade_group_students_individually': 'None', 
        'grading_standard_id': 'None', 
        'html_url': 
'https://xxxxxx.beta.instructure.com/courses/5269/assignments/55988', 
        'turnitin_settings': 
        {
            'originality_report_visibility': 'immediate', 
            'internet_check': False, 
            'journal_check': False, 'exclude_small_matches_type': None, 
            'exclude_quoted': False, 
            'submit_papers_to': True, 
            's_paper_check': False, 
            'exclude_small_matches_value': None, 
            'exclude_biblio': False
        }, 
        'has_submitted_submissions': False,  
        'needs_grading_count': 0, 
        'group_category_id': 'None', 
        'integration_id': 'None', 
        'name': '578o,y89poy890p[ji0[pi0k', 
        'unlock_at': '2015-03-26T05:00:00Z', 
        'due_at': 'None', 
        'created_at': '2015-03-27T17:04:46Z', 
        'post_to_sis': 'None', 
        'lock_at': 'None', 
        'assignment_group_id': 13902, 
        'automatic_peer_reviews': False,  
        'published': True, 
        'position': 1, 
        'submission_types': ['discussion_topic'], 
        'unpublishable': True
    }

Reply via email to