Bug 672171
Summary: | Pulp server cannot process a repo with name encoded in unicode | ||||||
---|---|---|---|---|---|---|---|
Product: | [Retired] Pulp | Reporter: | Lukas Zapletal <lzap> | ||||
Component: | z_other | Assignee: | Lukas Zapletal <lzap> | ||||
Status: | CLOSED CURRENTRELEASE | QA Contact: | Preethi Thomas <pthomas> | ||||
Severity: | unspecified | Docs Contact: | |||||
Priority: | unspecified | ||||||
Version: | unspecified | Keywords: | Triaged | ||||
Target Milestone: | --- | ||||||
Target Release: | --- | ||||||
Hardware: | Unspecified | ||||||
OS: | Unspecified | ||||||
Whiteboard: | |||||||
Fixed In Version: | Doc Type: | Bug Fix | |||||
Doc Text: | Story Points: | --- | |||||
Clone Of: | Environment: | ||||||
Last Closed: | 2011-08-15 15:14:54 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: | |||||||
Bug Depends On: | |||||||
Bug Blocks: | 647488 | ||||||
Attachments: |
|
Description
Lukas Zapletal
2011-01-24 09:49:33 UTC
The problem is in the src/pulp/server/auditing.py method audit_repr(value). It tries to decode both strings and unicode objects. Unicode objects in Python are not subjects of decoding. I think the intention for this method was to "Return an audit-friendly representation of a value." and to encode unicode strings to simple ASCII representation. For example to log string Příliš žluťoučký kůŇ úpěl Ďábelské ódy as P??li? ?lu?ou?k? k?? ?p?l ??belsk? ?dy in the events.log. For this case I have prepared a patch that fixes the audit_repr method. It decodes only string objects and encodes them to ASCII properly. Unicode objects are only encoded to ASCII since they are already "decoded". Attaching. The question is if this is correct approach because for Chineese or Japanese the unicode messages could be quite useless (like "???" or "??????????"). Therefore maybe the pulp authors would like to prefer to output strings "as is". In this case modification needs to be done since currently the Pulp server is trying to decode already decoded strings. I can provide the patch for this outputting as well. Created attachment 474938 [details]
Solution A patch
Preethi - forgot to set MODIFIED flag. This has been commited and pushed weeks ago. Should work now. Build: 0.145 verified [root@preethi ~]# rpm -q pulp pulp-0.0.146-1.fc14.noarch [root@preethi ~]# pulp-admin repo create --arch=x86_64 --feed yum:http://download.fedora.redhat.com/pub/fedora/linux/updates/13/x86_64/ --name="Příliš žluťoučký kůŇ úpěl Ďábelské ódy" --id=fedora-repo-with-czech-name Successfully created repository [ fedora-repo-with-czech-name ] [root@preethi ~]# pulp-admin -u admin -p admin repo list+------------------------------------------+ List of Available Repositories +------------------------------------------+ Id fedora-repo-with-czech-name Name Příliš žluťoučký kůŇ úpěl Ďábelské ódy FeedURL http://download.fedora.redhat.com/pub/fedora/linux/updates/13/x86_64/ FeedType yum Arch x86_64 Sync Schedule None Packages 0 Files 0 Distributions None Publish True Clones [] Groups None Filters [] Closing with current community release pulp-0.0.223 |