Warning: Can't synchronize with repository "(default)" (Unsupported version control system "svn": No module named svn). Look in the Trac log for more information.

Ticket #1284 (closed defect: fixed)

Opened 10 years ago

Last modified 10 years ago

[PATCH] Safari Unicode fix in controllers.py raising TypeError

Reported by: simonwittber Owned by: anonymous
Priority: normal Milestone: 1.0.3
Component: TurboGears Version: 1.0.1
Severity: normal Keywords: controllers, TypeError
Cc:

Description (last modified by jorge.vargas) (diff)

File "/Users/simonwittber/Library/Python/2.4/site-packages/TurboGears-1.0.1-py2.4.egg/turbogears/controllers.py", line 100, in _process_output
    output = unicodechars.sub(
TypeError: expected string or buffer

A fix is in the diff file attached.

Attachments

controllers.diff Download (102 bytes) - added by simonwittber 10 years ago.
diff file against 1.0.1 turbogears/controllers.py

Change History

Changed 10 years ago by simonwittber

diff file against 1.0.1 turbogears/controllers.py

comment:1 Changed 10 years ago by simonwittber

  • Owner set to anonymous
  • Version changed from 1.0 to 1.0.1
  • Component changed from unassigned to TurboGears

comment:2 Changed 10 years ago by jorge.vargas

  • Description modified (diff)

umm why are you getting a generator? could you provide the value of that variable?

as for the patches  http://docs.turbogears.org/patching_guidelines

comment:3 Changed 10 years ago by simonwittber

Not sure why I get a generator, but i believe one is supposed to be able to return generators from cherrypy functions, which are iterated to produce strings?

It could be the same error this person was having:

 http://groups.google.com/group/turbogears/browse_thread/thread/e32194cdfa87066a/eb9c12fb7f58a376?lnk=gst&q=tg_format&rnum=9#eb9c12fb7f58a376

comment:4 Changed 10 years ago by alberto

  • Milestone changed from 1.0.2 to 1.0.3

comment:5 Changed 10 years ago by dazzawazza

Just a little more information: I've traced this through and to answer jorge.vargas you get a generator if you are rendering JSON. I've applied this patch and it is working for me.

comment:6 Changed 10 years ago by faide

  • Summary changed from Safari Unicode fix in controllers.py raising TypeError to [PATCH] Safari Unicode fix in controllers.py raising TypeError

comment:7 Changed 10 years ago by faide

  • Status changed from new to closed
  • Resolution set to fixed

Applied at r3214 (1.0) and r3215 (1.1)

Thanks.

Note: See TracTickets for help on using tickets.