-
-
Notifications
You must be signed in to change notification settings - Fork 168
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] Component._encode ignores parameters if value is native #557
Comments
Hi, thanks for reporting!
I think the next steps could be writing the code for the TODOs, putting this into a test function, fixing the test.
|
Hey, I’m currently writing the tests and I’m unsure with following case: If a native object with parameters is to be _encoded with further parameters, what would you propose on what should happen:
I’m not sure what is the better choice as both seem equally reasonable to me. What’s your opinion on that? Full ExampleAssume following property value with parameters: val = _encode("X-SOURCE", "SGFsbG8gV2VsdCE=", props={"ENCODING": "BASE64", "LANG": "en", "X-IS-SOURCE": "1"}) Following call would happen to val = _encode("X-TARGET", val, props={"LANG":"de", "X-IS-TARGET": "1"}) Both possibilities for the parameters seem reasonable:
|
Hi @Zocker1999NET , for me the first option seems more logical, since |
Signed-off-by: Felix Stupp <felix.stupp@banananet.work>
@jacadzaca would you like to create a new release? |
@niccokunzmann sure thing :) |
Describe the bug
Component._encode
ignores the given parameters if the value is already of a native type (see code in question). IMO this is unexpected behavior. This also seems unexpected for the dependent library caldav, where it leads to a RELTYPE to be fully ignored if the passed UID is of type vText (see python-caldav/caldav#334).To Reproduce
(I’m not familiar with this library as I only discovered this issue through discovering python-caldav/caldav#334, so the reproducing code is not fully complete.)
In the output, the
RELATES-TO
is added, as specified.However, its missing the parameter
RELTYPE=DEPENDS-ON
.Expected behavior
Use the specified parameters (replace or append already existing ones on the native type) or, at least, throw a warning or error that parameter will be ignored.
Environment
icalendar
version: 5.0.8Additional context
pip3 install https://github.com/collective/icalendar.git
The text was updated successfully, but these errors were encountered: