Skip to content

pypi.org release 0.0.4 doesn't match git hub's release #14

Description

@mushadow

Installing smime 0.0.4 using pip install smime==0.0.4 results in an error. It downloads the file from https://pypi.org/project/smime/0.0.4/#files but doesn't install.
Download location.
https://files.pythonhosted.org/packages/ef/24/53ff1e620c4a3da28c65697310d8275498c4b5c763c38706a01a356ca720/smime-0.0.4.tar.gz

When I installed the git hub release from home there was not an issue with Python 2.7. Good file location. https://github.com/balena/python-smime/archive/refs/tags/0.0.4.tar.gz

I compared the two zip files and for example smime/encrypt.py differences were:

diff -r .\encrypt_git.py .\encrypt_PyPI.py
14a15
> from email.message import EmailMessage
31c32
<     Takes the contents of the message parameter, formatted as in RFC 2822, and encrypts them,
---
>     Takes the contents of the message parameter, formatted as in RFC 2822 (type str or message), and encrypts them,
33c34
<     :return: string containing the new encrypted message.
---
>     :return: the new encrypted message (type str or message, as per input).
40,43c41,55
<     # Get the message content
<     msg = message_from_string(message)
<     to_encode = MIMEText(msg.get_payload())
<     content = to_encode.as_string()
---
>     # Get the message content. This could be a string, or a message object
>     passed_as_str = isinstance(message, str)
>     if passed_as_str:
>         msg = message_from_string(message)
>     else:
>         msg = message
>     # Extract the message payload without conversion, & the outermost MIME header / Content headers. This allows
>     # the MIME content to be rendered for any outermost MIME type incl. multipart
>     pl = EmailMessage()
>     for i in msg.items():
>         hname = i[0].lower()
>         if hname == 'mime-version' or hname.startswith('content-'):
>             pl.add_header(i[0], i[1])
>     pl._payload = msg._payload
>     content = pl.as_string()
45d56
<     # Generate the recipient infos
85c96,100
<     return result_msg.as_string()
---
>     # return the same type as was passed in
>     if passed_as_str:
>         return result_msg.as_string()
>     else:
>         return result_msg

My organization can only use the PyPI source, this makes using the smime 0.0.4 version very difficult if not impossible from work.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions