Bug 481540
Summary: | pydot crashes with character with accent | ||||||
---|---|---|---|---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Pierre-YvesChibon <pingou> | ||||
Component: | pydot | Assignee: | Tom "spot" Callaway <tcallawa> | ||||
Status: | CLOSED ERRATA | QA Contact: | Fedora Extras Quality Assurance <extras-qa> | ||||
Severity: | medium | Docs Contact: | |||||
Priority: | low | ||||||
Version: | 10 | CC: | a.badger, tcallawa | ||||
Target Milestone: | --- | ||||||
Target Release: | --- | ||||||
Hardware: | All | ||||||
OS: | Linux | ||||||
Whiteboard: | |||||||
Fixed In Version: | 1.0.2-4.fc10 | Doc Type: | Bug Fix | ||||
Doc Text: | Story Points: | --- | |||||
Clone Of: | Environment: | ||||||
Last Closed: | 2009-07-11 17:29:04 UTC | Type: | --- | ||||
Regression: | --- | Mount Type: | --- | ||||
Documentation: | --- | CRM: | |||||
Verified Versions: | Category: | --- | |||||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||
Cloudforms Team: | --- | Target Upstream Version: | |||||
Embargoed: | |||||||
Attachments: |
|
Description
Pierre-YvesChibon
2009-01-26 08:04:58 UTC
Filed upstream: http://code.google.com/p/pydot/issues/detail?id=23 I poked this for a while and couldn't come up with a fix. Thanks for reporting it. What do you think of the 4 lines I commented ? Well, its not a real fix, for sure. I tried all sorts of things in that section of code to fix it properly, but without success. There's some sort of bug in needs_quotes() and quote_if_necessary() but I haven't unravelled it yet. It almost looks like needs_quotes() is returning the opposite values as it should. ie: Returning False when quotes are needed and True when they aren't. But at least one of the tests (id_re_dbl_quoted.match) is wrong if I just change every True to False and False to True. So I need to understand that section of code a little bit better. Created attachment 345862 [details]
Fix reversed return values from need_quote()
I think this is right but if you use this module with any frequency, a bit of testing would be appreciated :-)
Some of the return values were reversed in needs_quote() but regex checks were returning the correct value. This patch should fix things up.
My test case was: #!/usr/bin/python #-*- coding: UTF-8 -*- import pydot n1 = u'Th\xe9r\xe8se Doe' n2 = u'Jean-Pierre Tou\xe9' g = pydot.Dot() g.add_node(pydot.Node(n1.encode('utf-8'))) g.add_edge(pydot.Edge(src=n1.encode('utf-8'), dst=n2.encode('utf-8'))) g.write('test.dot', format='raw') g.write_jpeg('test.jpg') pydot-1.0.2-4.fc10 has been submitted as an update for Fedora 10. http://admin.fedoraproject.org/updates/pydot-1.0.2-4.fc10 pydot-1.0.2-4.fc11 has been submitted as an update for Fedora 11. http://admin.fedoraproject.org/updates/pydot-1.0.2-4.fc11 pydot-1.0.2-4.fc11 has been pushed to the Fedora 11 stable repository. If problems still persist, please make note of it in this bug report. pydot-1.0.2-4.fc10 has been pushed to the Fedora 10 stable repository. If problems still persist, please make note of it in this bug report. I just wanted to thank Toshio for the patch and Tom to push it, it works great for me :-) |