Bug 42806 - Replace __package__ = '' PEP 366 workaround
Replace __package__ = '' PEP 366 workaround
Product: UCS
Classification: Unclassified
Component: Listener (univention-directory-listener)
UCS 4.4
Other Linux
: P5 normal (vote)
: ---
Assigned To: UCS maintainers
Depends on:
  Show dependency treegraph
Reported: 2016-10-31 18:46 CET by Florian Best
Modified: 2020-10-30 01:41 CET (History)
1 user (show)

See Also:
What kind of report is it?: Development Internal
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional):
Max CVSS v3 score:
best: Patch_Available+


Note You need to log in before you can comment on or make changes to this bug.
Description Florian Best univentionstaff 2016-10-31 18:46:55 CET
All listener modules define __package__ = '' to be able to suppress some python warnings.
This should be done in the correct pythonic way:

from __future__ import absolute_import

sed -i 's/__package__ = ''.*/from __future__ import absolute_import/g' -- $(git grep -l "__package__ = ''.*")

Style checkers like pep8 are otherwise complaining:
pep8 --first --select E402 -- $(git grep -l "__package__ = ''.*")
base/univention-heimdal/keytab-member.py:33:1: E402 module level import not at top of file
Comment 1 Stefan Gohmann univentionstaff 2019-01-03 07:19:39 CET
This issue has been filled against UCS 4.1. The maintenance with bug and security fixes for UCS 4.1 has ended on 5st of April 2018.

Customers still on UCS 4.1 are encouraged to update to UCS 4.3. Please contact
your partner or Univention for any questions.

If this issue still occurs in newer UCS versions, please use "Clone this bug" or simply reopen the issue. In this case please provide detailed information on how this issue is affecting you.
Comment 2 Florian Best univentionstaff 2020-10-30 01:41:43 CET
Fixed along with the Python 3 migration in UCS 5.0.