Re: [PATCH pynfs] Move to xdrlib3

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 2025-01-23 at 19:36 +0000, Calum Mackay wrote:
> On 22/01/2025 5:13 pm, Jeff Layton wrote:
> > As of python 3.13, the xdrlib module is no longer included. Fortunately
> > there is an xdrlib3 module, which is a fork of the bundled module:
> > 
> >      https://pypi.org/project/xdrlib3/
> > 
> > Change pynfs to use that instead and revise the documentation to include
> > a step to install that module.
> > 
> > Signed-off-by: Jeff Layton <jlayton@xxxxxxxxxx>
> > ---
> >   README                                | 8 +++++++-
> >   nfs4.0/lib/rpc/rpc.py                 | 2 +-
> >   nfs4.0/lib/rpc/rpcsec/sec_auth_sys.py | 2 +-
> >   nfs4.0/nfs4lib.py                     | 2 +-
> >   nfs4.0/nfs4server.py                  | 2 +-
> >   rpc/security.py                       | 2 +-
> >   xdr/xdrgen.py                         | 4 ++--
> >   7 files changed, 14 insertions(+), 8 deletions(-)
> > 
> > diff --git a/README b/README
> > index b8b4e775f7766086f870f2dda4a60b3e9f9bac6f..efdc23807e8107b8fcd575e8a4c80b9c73e3cd07 100644
> > --- a/README
> > +++ b/README
> > @@ -14,8 +14,14 @@ Install dependent modules:
> >   * openSUSE
> >   	zypper install krb5-devel python3-devel swig python3-gssapi python3-ply
> >   
> > -You can prepare both for use with
> > +Install the xdrlib3 module:
> > +
> > +	pip install xdrlib3
> 
> Thanks Jeff,
> 
> I see that Debian's unstable & testing suites have a pkg 
> (python3-standard-xdrlib) to provide this post-removal from standard 
> Python. Of course, that's not in general release, yet, but then neither 
> is 3.13 itself. Not sure if we should mention it?
> 
> e.g: your distro may provide xdrlib3 via a pkg (details…), or you may 
> install it via pip…
> or similar?
> 
> cheers,
> c.
> 
> 

Sure, I'm fine with phrasing it that way. Mind fixing it up when you
merge it?

I'm on Fedora 41 which ships with python 3.13, so I think it is in
general release now. Fedora doesn't have xdrlib3 packaged however, so I
just used pip.

> 
> > +
> > +You can prepare both versions for use with
> > +
> >   	./setup.py build
> > +
> >   which will create auto-generated files and compile any shared libraries
> >   in place.
> >   
> > diff --git a/nfs4.0/lib/rpc/rpc.py b/nfs4.0/lib/rpc/rpc.py
> > index 243ef9e31aa83eb6be18800065b63cf78d99f833..475179042530a8d602a51e7bad1af7958ff5dd56 100644
> > --- a/nfs4.0/lib/rpc/rpc.py
> > +++ b/nfs4.0/lib/rpc/rpc.py
> > @@ -9,7 +9,7 @@
> >   
> >   from __future__ import absolute_import
> >   import struct
> > -import xdrlib
> > +import xdrlib3 as xdrlib
> >   import socket
> >   import select
> >   import threading
> > diff --git a/nfs4.0/lib/rpc/rpcsec/sec_auth_sys.py b/nfs4.0/lib/rpc/rpcsec/sec_auth_sys.py
> > index 1e990a369e6588f24dff75e9569c104d775ff710..2581a1e1dca22f637dc32144a05c88c66c57665e 100644
> > --- a/nfs4.0/lib/rpc/rpcsec/sec_auth_sys.py
> > +++ b/nfs4.0/lib/rpc/rpcsec/sec_auth_sys.py
> > @@ -1,7 +1,7 @@
> >   from .base import SecFlavor, SecError
> >   from rpc.rpc_const import AUTH_SYS
> >   from rpc.rpc_type import opaque_auth
> > -from xdrlib import Packer, Error
> > +from xdrlib3 import Packer, Error
> >   
> >   class SecAuthSys(SecFlavor):
> >       # XXX need better defaults
> > diff --git a/nfs4.0/nfs4lib.py b/nfs4.0/nfs4lib.py
> > index eddcd862bc2fe2061414fb4de61e52aed93495ae..2337d8cd190de90e4d158b3ef9e3dfd6a61027c5 100644
> > --- a/nfs4.0/nfs4lib.py
> > +++ b/nfs4.0/nfs4lib.py
> > @@ -41,7 +41,7 @@ import xdrdef.nfs4_const as nfs4_const
> >   from  xdrdef.nfs4_const import *
> >   import xdrdef.nfs4_type as nfs4_type
> >   from xdrdef.nfs4_type import *
> > -from xdrlib import Error as XDRError
> > +from xdrlib3 import Error as XDRError
> >   import xdrdef.nfs4_pack as nfs4_pack
> >   
> >   import nfs_ops
> > diff --git a/nfs4.0/nfs4server.py b/nfs4.0/nfs4server.py
> > index 2dbad3046709ea57c1503a36649d85c25e6301a8..10bf28ee5794684912fa8e6d19406e06bf88b742 100755
> > --- a/nfs4.0/nfs4server.py
> > +++ b/nfs4.0/nfs4server.py
> > @@ -34,7 +34,7 @@ import time, StringIO, random, traceback, codecs
> >   import StringIO
> >   import nfs4state
> >   from nfs4state import NFS4Error, printverf
> > -from xdrlib import Error as XDRError
> > +from xdrlib3 import Error as XDRError
> >   
> >   unacceptable_names = [ "", ".", ".." ]
> >   unacceptable_characters = [ "/", "~", "#", ]
> > diff --git a/rpc/security.py b/rpc/security.py
> > index 0682f438cd6237334c59e7cb280c8b192e7c8a76..789280c5d7328a928b2f6c1af95397d17180eff9 100644
> > --- a/rpc/security.py
> > +++ b/rpc/security.py
> > @@ -3,7 +3,7 @@ from .rpc_const import AUTH_NONE, AUTH_SYS, RPCSEC_GSS, SUCCESS, CALL, \
> >   from .rpc_type import opaque_auth, authsys_parms
> >   from .rpc_pack import RPCPacker, RPCUnpacker
> >   from .gss_pack import GSSPacker, GSSUnpacker
> > -from xdrlib import Packer, Unpacker
> > +from xdrlib3 import Packer, Unpacker
> >   from . import rpclib
> >   from .gss_const import *
> >   from . import gss_type
> > diff --git a/xdr/xdrgen.py b/xdr/xdrgen.py
> > index b472e50676799915ea3b6a14f6686a5973484fb2..f802ba80045e79716a71fa7a64d72f1b8831128d 100755
> > --- a/xdr/xdrgen.py
> > +++ b/xdr/xdrgen.py
> > @@ -1357,8 +1357,8 @@ pack_header = """\
> >   import sys,os
> >   from . import %s as const
> >   from . import %s as types
> > -import xdrlib
> > -from xdrlib import Error as XDRError
> > +import xdrlib3 as xdrlib
> > +from xdrlib3 import Error as XDRError
> >   
> >   class nullclass(object):
> >       pass
> > 
> > ---
> > base-commit: d042a1f6421985b7c9d17edf8eb0d59bcf7f5908
> > change-id: 20250122-master-68414e8f6d5f
> > 
> > Best regards,
> 
> 

-- 
Jeff Layton <jlayton@xxxxxxxxxx>





[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux