← Back to team overview

enterprise-support team mailing list archive

[Bug 2088094] [NEW] ConfigParser has no attribute readfp

 

Public bug reported:

Got this in noble's samba:

# samba-tool gpo manage motd set {31B2F340-016D-11D2-945F-00C04FB984F9}  "Welcome" -U Administrator
WARNING: Using passwords on command line is insecure. Installing the setproctitle python module will hide these from shortly after program start.
Password for [EXAMPLE\Administrator]:
ERROR(<class 'AttributeError'>): uncaught exception - 'ConfigParser' object has no attribute 'readfp'
  File "/usr/lib/python3/dist-packages/samba/netcmd/__init__.py", line 279, in _run
    return self.run(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/samba/netcmd/gpo.py", line 3838, in run
    reg.increment_gpt_ini(machine_changed=True)
  File "/usr/lib/python3/dist-packages/samba/policies.py", line 177, in increment_gpt_ini
    parser.parse(data)
  File "/usr/lib/python3/dist-packages/samba/gp_parse/gp_ini.py", line 112, in parse
    super(GPTIniParser, self).parse(contents)
  File "/usr/lib/python3/dist-packages/samba/gp_parse/gp_ini.py", line 41, in parse
    self.ini_conf.readfp(StringIO(contents.decode(self.encoding)))
    ^^^^^^^^^^^^^^^^^^^^

This was fixed in[1]:

commit 2b566979acfc89ad609eb7c0c87d720f1a35f30a
Author: Jo Sutton <josutton@xxxxxxxxxxxxxxx>
Date:   Tue Aug 29 16:30:08 2023 +1200

    gp: Use read_file() instead of readfp()
    
    readfp() is deprecated and could be removed in a future version of
    Python.
    
    Signed-off-by: Joseph Sutton <josephsutton@xxxxxxxxxxxxxxx>
    Reviewed-by: Andrew Bartlett <abartlet@xxxxxxxxx>


1. https://github.com/samba-team/samba/commit/2b566979acfc89ad609eb7c0c87d720f1a35f30a

** Affects: samba (Ubuntu)
     Importance: Undecided
         Status: Fix Released

** Affects: samba (Ubuntu Noble)
     Importance: Undecided
     Assignee: Andreas Hasenack (ahasenack)
         Status: Triaged

** Affects: samba (Ubuntu Oracular)
     Importance: Undecided
         Status: Fix Released

** Affects: samba (Ubuntu Plucky)
     Importance: Undecided
         Status: Fix Released


** Tags: server-todo

-- 
You received this bug notification because you are a member of Ubuntu
Server/Client Support Team, which is subscribed to samba in Ubuntu.
Matching subscriptions: Ubuntu Server/Client Support Team
https://bugs.launchpad.net/bugs/2088094

Title:
  ConfigParser has no attribute readfp

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/samba/+bug/2088094/+subscriptions



Follow ups