Move to xdrlib3
Subsystems (2)
Jeff Layton
maintainerPATCH 1/1 Move to xdrlib3
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.
--- 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(-)
README +7 -1
@@ -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 + +You can prepare both versions for use with + ./setup.py build + which will create auto-generated files and compile any shared libraries in place.
nfs4.0/lib/rpc/rpc.py +1 -1
@@ -9,7 +9,7 @@ from __future__ import absolute_import import struct -import xdrlib +import xdrlib3 as xdrlib import socket import select import threading
nfs4.0/lib/rpc/rpcsec/sec_auth_sys.py +1 -1
@@ -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
nfs4.0/nfs4lib.py +1 -1
@@ -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
nfs4.0/nfs4server.py +1 -1
@@ -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 = [ "/", "~", "#", ]
rpc/security.py +1 -1
@@ -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
xdr/xdrgen.py +2 -2
@@ -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,
Signature · 1 line
Jeff Layton <[email protected]>
Quoted 24 lines · Jeff Layton
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 <[email protected]>--- 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(-)README +0
-0
README Install dependent modules: · line 19
Quoted 7 lines
README +3
-1@@ -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.
Quoted 94 lines
README +4
-0+ +You can prepare both versions for use with + ./setup.py build + which will create auto-generated files and compile any shared libraries in place.nfs4.0/lib/rpc/rpc.py +1
-1@@ -9,7 +9,7 @@ from __future__ import absolute_import import struct -import xdrlib +import xdrlib3 as xdrlib import socket import select import threadingnfs4.0/lib/rpc/rpcsec/sec_auth_sys.py +1
-1@@ -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 defaultsnfs4.0/nfs4lib.py +1
-1@@ -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_opsnfs4.0/nfs4server.py +1
-1@@ -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 = [ "/", "~", "#", ]rpc/security.py +1
-1@@ -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_typexdr/xdrgen.py +2
-3@@ -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-68414e8f6d5fBest regards,
Jeff Layton
maintainerQuoted 40 lines · Calum Mackay
Quoted 24 lines · Jeff Layton
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 <[email protected]>--- 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(-)README +0
-0README Install dependent modules: · line 19
Quoted 7 lines
README +3
-1@@ -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 xdrlib3Thanks 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?
Quoted 8 lines
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.
Quoted 97 lines
Quoted 95 lines
README +4
-0+ +You can prepare both versions for use with + ./setup.py build + which will create auto-generated files and compile any shared libraries in place.nfs4.0/lib/rpc/rpc.py +1
-1@@ -9,7 +9,7 @@ from __future__ import absolute_import import struct -import xdrlib +import xdrlib3 as xdrlib import socket import select import threadingnfs4.0/lib/rpc/rpcsec/sec_auth_sys.py +1
-1@@ -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 defaultsnfs4.0/nfs4lib.py +1
-1@@ -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_opsnfs4.0/nfs4server.py +1
-1@@ -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 = [ "/", "~", "#", ]rpc/security.py +1
-1@@ -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_typexdr/xdrgen.py +2
-3@@ -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-68414e8f6d5fBest regards,
Signature · 1 line
Jeff Layton <[email protected]>
Quoted 45 lines · Jeff Layton
Quoted 44 lines · Calum Mackay
Quoted 24 lines · Jeff Layton
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 <[email protected]>--- 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(-)README +0
-0README Install dependent modules: · line 19
Quoted 7 lines
README +3
-1@@ -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 xdrlib3Thanks 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?
Quoted 7 lines
Quoted 4 lines
cheers,
c.Sure, I'm fine with phrasing it that way. Mind fixing it up when you merge it?
Yes, of course! Thanks again,
cheers,
c.
Quoted 103 lines
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.
Quoted 97 lines
Quoted 95 lines
README +4
-0+ +You can prepare both versions for use with + ./setup.py build + which will create auto-generated files and compile any shared libraries in place.nfs4.0/lib/rpc/rpc.py +1
-1@@ -9,7 +9,7 @@ from __future__ import absolute_import import struct -import xdrlib +import xdrlib3 as xdrlib import socket import select import threadingnfs4.0/lib/rpc/rpcsec/sec_auth_sys.py +1
-1@@ -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 defaultsnfs4.0/nfs4lib.py +1
-1@@ -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_opsnfs4.0/nfs4server.py +1
-1@@ -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 = [ "/", "~", "#", ]rpc/security.py +1
-1@@ -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_typexdr/xdrgen.py +2
-3@@ -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-68414e8f6d5fBest regards,
Calum Mackay
AppliedQuoted 50 lines · Jeff Layton
Quoted 40 lines · Calum Mackay
Quoted 24 lines · Jeff Layton
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 <[email protected]>--- 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(-)README +0
-0README Install dependent modules: · line 19
Quoted 7 lines
README +3
-1@@ -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 xdrlib3Thanks 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?
Quoted 8 lines
e.g: your distro may provide xdrlib3 via a pkg (details…), or you may install it via pip…
or similar?cheers,
c.
Quoted 6 lines
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.
Applied, with the fixed-up README.
thanks very much Jeff, apols for the delay.
cheers,
c.
Quoted 99 lines
Quoted 98 lines
Quoted 96 lines
README +4
-0+ +You can prepare both versions for use with + ./setup.py build + which will create auto-generated files and compile any shared libraries in place.nfs4.0/lib/rpc/rpc.py +1
-1@@ -9,7 +9,7 @@ from __future__ import absolute_import import struct -import xdrlib +import xdrlib3 as xdrlib import socket import select import threadingnfs4.0/lib/rpc/rpcsec/sec_auth_sys.py +1
-1@@ -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 defaultsnfs4.0/nfs4lib.py +1
-1@@ -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_opsnfs4.0/nfs4server.py +1
-1@@ -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 = [ "/", "~", "#", ]rpc/security.py +1
-1@@ -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_typexdr/xdrgen.py +2
-3@@ -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-68414e8f6d5fBest regards,