Bug 1263282 - yum should clean up it's .pyo files when removed (via rpm or dnf)
yum should clean up it's .pyo files when removed (via rpm or dnf)
Status: CLOSED EOL
Product: Fedora
Classification: Fedora
Component: yum (Show other bugs)
22
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: packaging-team-maint
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-09-15 09:31 EDT by Pavel Studeník
Modified: 2016-07-19 13:54 EDT (History)
9 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-07-19 13:54:00 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Pavel Studeník 2015-09-15 09:31:31 EDT
Description of problem:
I remove package with yum and the pyo files stay in directory. It is problem, because the model is possible to import to code. I get error when I try use dnf-plugin-spacewalk.

>> ls /usr/lib/python2.7/site-packages/yum/
callbacks.pyo  drpm.pyo         __init__.pyo       packageSack.pyo  plugins.pyo       sqlitesack.pyo
comps.pyo      Errors.pyo       i18n.pyo           packages.pyo     repoMDObject.pyo  sqlutils.pyo
config.pyo     fssnapshots.pyo  logginglevels.pyo  parser.pyo       repos.pyo         transactioninfo.pyo
constants.pyo  history.pyo      metalink.pyo       pgpmsg.pyo       rpmsack.pyo       update_md.pyo
depsolve.pyo   igroups.pyo      misc.pyo           pkgtag_db.pyo    rpmtrans.pyo      yumRepo.pyo

>> dnf provides /usr/lib/python2.7/site-packages/yum/__init__.py
Failed loading plugin: spacewalk
Last metadata expiration check performed 0:19:15 ago on Tue Sep 15 13:11:46 2015.
yum-3.4.3-505.fc22.noarch : RPM package installer/updater/manager
Repo        : fedora

Version-Release number of selected component (if applicable):
dnf-1.1.1-2.fc22.noarch
yum-3.4.3-505.fc22.noarch

How reproducible:
always

Steps to Reproduce:
1. dnf install yum-rhn-plugin yum
2. dnf remove yum-rhn-plugin yum
3. dnf install dnf-plugin-spacewalk

Actual results:
>> dnf repolist

Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/dnf/plugin.py", line 124, in import_modules
    module = importlib.import_module(name)
  File "/usr/lib64/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
  File "/usr/lib/python2.7/site-packages/dnf-plugins/spacewalk.py", line 34, in <module>
    import up2date_client.up2dateAuth
  File "/usr/share/rhn/up2date_client/up2dateAuth.py", line 3, in <module>
    import rhnserver
  File "/usr/share/rhn/up2date_client/rhnserver.py", line 34, in <module>
    import rpcServer
  File "/usr/share/rhn/up2date_client/rpcServer.py", line 11, in <module>
    import clientCaps
  File "/usr/share/rhn/up2date_client/clientCaps.py", line 10, in <module>
    from capabilities import parseCap
  File "/usr/share/rhn/up2date_client/capabilities.py", line 4, in <module>
    import up2dateErrors
  File "/usr/share/rhn/up2date_client/up2dateErrors.py", line 98, in <module>
    from yum.Errors import RepoError
  File "/usr/lib/python2.7/site-packages/yum/__init__.py", line 52, in <module>
AttributeError: 'module' object has no attribute 'i18n'
Comment 1 Michael Mráka 2015-09-17 06:57:40 EDT
This should be fixed in yum packaging.
Solution would be including .pyo files as %ghost into package.

See 
https://lists.fedoraproject.org/pipermail/packaging/2005-August/000490.html
https://fedoraproject.org/wiki/Packaging:Python
Comment 2 Fedora End Of Life 2016-07-19 13:54:00 EDT
Fedora 22 changed to end-of-life (EOL) status on 2016-07-19. Fedora 22 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.

Note You need to log in before you can comment on or make changes to this bug.