Ticket #324 (closed defect: fixed)

Opened 7 years ago

Last modified 7 years ago

Installation problem CsvMacro

Reported by: anonymous Assigned to: athomas
Priority: normal Component: CsvMacro
Severity: normal Keywords:
Cc: Trac Release: 0.9

Description (Last modified by athomas)

Python Traceback

Traceback (most recent call last):
  File "/usr/local/python/lib/python2.4/site-packages/trac/web/main.py", line 300, in dispatch_request
    dispatcher.dispatch(req)
  File "/usr/local/python/lib/python2.4/site-packages/trac/web/main.py", line 176, in dispatch
    resp = chosen_handler.process_request(req)
  File "/usr/local/python/lib/python2.4/site-packages/trac/wiki/web_ui.py", line 93, in process_request
    self._render_editor(req, db, page, preview=True)
  File "/usr/local/python/lib/python2.4/site-packages/trac/wiki/web_ui.py", line 312, in _render_editor
    info['page_html'] = wiki_to_html(page.text, self.env, req, db)
  File "/usr/local/python/lib/python2.4/site-packages/trac/wiki/formatter.py", line 825, in wiki_to_html
    Formatter(env, req, absurls, db).format(wikitext, out, escape_newlines)
  File "/usr/local/python/lib/python2.4/site-packages/trac/wiki/formatter.py", line 651, in format
    self.handle_code_block(line)
  File "/usr/local/python/lib/python2.4/site-packages/trac/wiki/formatter.py", line 621, in handle_code_block
    self.out.write(self.code_processor.process(self.req, self.code_text))
  File "/usr/local/python/lib/python2.4/site-packages/trac/wiki/formatter.py", line 104, in process
    text = self.processor(req, text)
  File "/usr/local/python/lib/python2.4/site-packages/trac/wiki/formatter.py", line 94, in _macro_processor
    return macro_provider.render_macro(req, self.name, text)
  File "/usr/local/python/lib/python2.4/site-packages/trac/wiki/macros.py", line 501, in render_macro
    return module.execute(req and req.hdf, content, self.env)
  File "/var/www/cvsdude/trac/telerespons/kundeservice/wiki-macros/CsvMacro.py", line 7, in execute
    reader = csv.reader(StringIO(txt), dialect=sniffer.sniff(txt))
TypeError: bad argument type for built-in operation

(trac 0.10pre)

Any ideas?

Attachments

Change History

04/23/06 06:30:52 changed by athomas

  • status changed from new to assigned.
  • description changed.

No idea, can you provide me with a CSV sample that causes this?

04/23/06 19:13:19 changed by anonymous

  • severity changed from blocker to normal.

I played around some more, and it wasn´t totally broken after all :-)

* The code doesn´t produce valid html tables when there is a variable number of cells in each line, or blank cells.

* If a blank line is produced above the csv data, it results in a blank table.

* Also, it causes an exception if characters such as æøå is used.

04/24/06 04:39:37 changed by athomas

To fix the first problem would require two passes over the CSV object, the first to determine the total number of columns.

Second problem is not really a problem, it's a misuse IMO :). It also must be a feature of the underlying Python csv module.

And the exception is the one above?

04/24/06 04:54:58 changed by athomas

Apparently the csv module does not handle Unicode. I will force the input to ASCII and replace any Unicode characters.

I've also removed the sniffer call as it doesn't actually seem to be necessary.

04/24/06 04:55:59 changed by athomas

  • status changed from assigned to closed.
  • resolution set to fixed.

(In [708]) Fix for lack of Unicode support in Python's csv module. Closes #324


Add/Change #324 (Installation problem CsvMacro)




Change Properties
Action