Repository navigation
smbserver: fix reserved name check on Python 3.15 - #5269
Merged
gpotter2 merged 4 commits intoNov 11, 2026
Merged
Conversation
PurePath.is_reserved() was removed in Python 3.15, so on Windows every CREATE request made SMB_Server.lookup_file() raise AttributeError. Use os.path.isreserved() on Python 3.13+. AI-Assisted: yes (Claude Opus 5.5) Co-Authored-By: Claude Opus 5.5 <[email protected]>
Member
|
Could you define a util function in |
gpotter2
reviewed
Nov 4, 2026
Member
|
Thanks for the PR, I made minor comments. |
Add isreserved() to scapy/compat.py, with a unit test, and use it in smbserver. Move the smbserver test next to the other server tests and use run_smbserver() like they do. AI-Assisted: yes (Claude Opus 5.5)
Contributor
Author
|
Done: added |
gpotter2
reviewed
Nov 4, 2026
Reserved names only exist on Windows, so the helper returns False elsewhere and smbserver no longer checks WINDOWS itself. AI-Assisted: yes (Claude Opus 5.5)
gpotter2
reviewed
Nov 4, 2026
AI-Assisted: yes (Claude Opus 5.5)
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #5269 +/- ##
==========================================
+ Coverage 80.55% 80.58% +0.03%
==========================================
Files 375 375
Lines 98399 98519 +120
==========================================
+ Hits 79263 79391 +128
+ Misses 19136 19128 -8
🚀 New features to boost your workflow:
|
gpotter2
approved these changes
Nov 11, 2026
Member
|
Thanks for the PR ! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
PurePath.is_reserved()was removed in Python 3.15. On Windows,SMB_Server.lookup_file()calls it for every CREATE request, so the SMB server raisesAttributeErroron 3.15. This usesos.path.isreserved()on Python 3.13+ (where it exists) and keepsis_reserved()for older versions.Added a test in
test/scapy/layers/smbclientserver.utsthat serves a file to the Scapy smbclient, which goes throughlookup_file().AI-Assisted: yes (Claude Opus 5.5). I ran the tests locally and reviewed the change.