Created
October 15, 2018 07:22
-
-
Save Eveler/36dd2588be55fd1c3f2260fde56821ba to your computer and use it in GitHub Desktop.
URL-encoded attachment id resolve patch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Index: zeep/wsdl/messages/xop.py | |
| IDEA additional info: | |
| Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP | |
| <+>UTF-8 | |
| =================================================================== | |
| --- zeep/wsdl/messages/xop.py (date 1539132819497) | |
| +++ zeep/wsdl/messages/xop.py (date 1539132819497) | |
| @@ -1,4 +1,5 @@ | |
| import base64 | |
| +from urllib.parse import unquote | |
| def process_xop(document, message_pack): | |
| @@ -11,12 +12,14 @@ | |
| for xop_node in xop_nodes: | |
| href = xop_node.get('href') | |
| + href = unquote(href) | |
| if href.startswith('cid:'): | |
| href = '<%s>' % href[4:] | |
| value = message_pack.get_by_content_id(href) | |
| if not value: | |
| - raise ValueError("No part found for: %r" % xop_node.get('href')) | |
| + raise ValueError("No part found for: %r" % unquote( | |
| + xop_node.get('href'))) | |
| num_replaced += 1 | |
| xop_parent = xop_node.getparent() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
That did the trick! Thanks!