-
-
Notifications
You must be signed in to change notification settings - Fork 34.3k
GH-118289: Fix handling of non-directories in os.path.realpath()
#118290
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from 1 commit
Commits
Show all changes
94 commits
Select commit
Hold shift + click to select a range
59f7fde
GH-118289: Fix handling of non-directories in `os.path.realpath()`
barneygale 382b31a
Skip test on Windows.
barneygale 5ac4469
Avoid catching and re-throwing exception.
barneygale 84e7c32
reversed() --> slice.
barneygale 8fa3426
Merge branch 'main' into gh-118289
barneygale 82b25a9
Expand tests
barneygale eb9bfd6
Simplify changes
barneygale 5854d72
Use native ELOOP string.
barneygale 3390dbc
Clarify news
barneygale e327b81
Merge branch 'main' into gh-118289
barneygale f889383
Revert "Clarify news"
barneygale 2362e22
Apply suggestions from code review
barneygale 53a81ce
Merge branch 'main' into gh-118289
barneygale 4dc3fed
statistics.fmean(): speed-up code path for non-sizeable inputs. (gh-1…
rhettinger 5c79eb4
gh-74929: PEP 667 C API documentation (gh-119379)
ncoghlan 1e0b92e
gh-118888: Further PEP 667 docs updates (gh-119893)
ncoghlan d56d198
build(deps-dev): bump types-setuptools from 69.5.0.20240423 to 70.0.0…
dependabot[bot] 79ad8f3
Bump types-psutil from 5.9.5.20240423 to 5.9.5.20240516 in /Tools (#1…
dependabot[bot] fe0d997
gh-117657: Fix TSAN race in free-threaded GC (#119883)
colesbury d60317e
gh-117657: Fix TSAN race in QSBR assertion (#119887)
colesbury 2364923
Minor speed/accuracy improvement for kde() (gh-119910)
rhettinger 525722c
gh-113892: Add a extra check to `ProactorEventLoop.sock_connect` to e…
Eclips4 50f9637
gh-117657: Add TSAN suppression for `set_discard_entry` (#119908)
colesbury 33db150
Add unique() recipe to itertools docs (gh-119911)
rhettinger 39998dd
GH-89727: Fix `shutil.rmtree()` recursion error on deep trees (#119808)
barneygale c7a70cd
gh-119016: Remove outdated sentences from the "classes" tutorial (#11…
nineteendo afe17fd
Refactor (mostly rearrange) the statistics module (gh-119930)
rhettinger bb2c6c5
gh-118934: Fix PyEval_GetLocals docs (PEP 667) (#119932)
ncoghlan d4aba40
gh-119775: Remove ability to create immutable types with mutable base…
sobolevn c0c837a
gh-119740: Remove deprecated trunc delegation (#119743)
mdickinson e2633ae
gh-117657: Fix TSAN reported race in `_PyEval_IsGILEnabled`. (#119921)
colesbury 0b2cb6a
Improve documentation for typing.get_type_hints (#119928)
JelleZijlstra 75992d8
GH-119054: Add "Reading and writing files" section to pathlib docs (#…
barneygale e9cef42
gh-109975: What's New in Python 3.13: fix broken link for `telnetlib`…
TechSolomon ad9cff9
gh-117657: Fix data races report by TSAN unicode-hash (gh-119907)
corona10 d5cc722
gh-119961: Fix test workflow status badge in README (#119962)
wookie184 dba3cb1
gh-119396: Optimize unicode_decode_utf8_writer() (#119957)
vstinner cdebef6
gh-119506: fix `_io.TextIOWrapper.write()` write during flush (#119507)
chgnrdv 1a2aa10
gh-118827: Remove `Quoter` from `urllib.parse` (#118828)
sobolevn 1831319
gh-116991: Improve `pygen --help` for `python` subparser (#116992)
sobolevn ef4c264
gh-119856: Support exiting help() with just "exit" (#119858)
vstinner 02f2a16
gh-112026: Deprecate _PyDict_GetItemStringWithError() function (#119855)
vstinner 1f52e84
gh-119838: Treat Fraction as a real value in mixed arithmetic operati…
serhiy-storchaka 6c84d03
gh-119968: Improved monitoring c-api docs (#119969)
SweetyAngel 400bfbd
gh-119786: move exception handling doc to InternalDocs (#119815)
iritkatriel 204a262
gh-116560: Add PyLong_GetSign() public function (#116561)
skirpichev ba68289
gh-102511: Amend 3.13.0b1.rst (GH-119895)
nineteendo add5b46
gh-119679: Ensures correct import libraries are included in Windows i…
zooba 25d0a68
gh-119588: Implement zipfile.Path.is_symlink (zipp 3.19.0). (#119591)
jaraco e286062
Use Cirrus M1 macOS runners for CI (GH-119979)
ambv 26671c1
gh-119981: Use do while(0) in some symtable.c multi-line macros (#119…
picnixz bd3d2ef
gh-119057: Use better error messages for zero division (#119066)
sobolevn 713d900
gh-119727: Add --single-process option to regrtest (#119728)
vstinner d70fb19
gh-118835: pyrepl: Fix prompt length computation for custom prompts c…
danielhollas a232d05
gh-117657: Avoid `sem_clockwait` in TSAN (#119915)
colesbury 6a14a98
update CODEOWNERS (#120003)
iritkatriel cc875fa
gh-117657: Fix race involving immortalizing objects (#119927)
colesbury 40099b3
gh-117398: Add datetime Module State (gh-119810)
ericsnowcurrently e8ee15c
gh-117142: Support Importing ctypes in Isolated Interpreters (gh-119991)
ericsnowcurrently 5a98e86
gh-117398: Use Per-Interpreter State for the _datetime Static Types (…
ericsnowcurrently e560568
gh-119724: Revert "bpo-45759: Better error messages for non-matching …
encukou 3a5a5a5
gh-106531: Apply changes from importlib_resources 6.3.2 (#117054)
jaraco 9b3fc31
gh-119879: str.find(): Utilize last character gap for two-way periodi…
74e1755
gh-119070: Update test_shebang_executable_extension to always use non…
zooba 1f2c6eb
gh-119613: Soft deprecate the Py_MEMCPY() macro (#120020)
vstinner 2313a8f
gh-111499: Fix PYTHONMALLOCSTATS at Python exit (#120021)
vstinner 2007509
Fix typos in documentation and comments (#119763)
xyb 74bbf0e
gh-118868: logging QueueHandler fix passing of kwargs (GH-118869)
Kaundur aff9a10
gh-119819: Fix regression to allow logging configuration with multipr…
vsajip d811474
gh-94808: Reorganize _make_posargs and mark unused code (GH-119227)
mjdominus 9073dbb
gh-117657: Fix race involving GC and heap initialization (#119923)
colesbury f71ed10
gh-120029: export `DEF_TYPE_PARAM` compiler flag (#120028)
picnixz d34608d
gh-119588: Update docs to reflect decision to include the change with…
jaraco fbef7b9
gh-120041: Do not use append_to_screen when completions are visible (…
lysnikolaou 74b7978
Fix incorrect pull GitHub link in What's New (#120045)
treyhunner 234a5df
gh-89928: Fix integer conversion of device numbers (GH-31794)
serhiy-storchaka faefa59
gh-112672: Fix builtin Tkinter with Tcl 9.0 (GH-112681)
chrstphrchvz bb615c6
gh-120041: Refactor check for visible completion menu in completing_r…
lysnikolaou 14567b1
gh-120039: Reduce expected timeout in test_siginterrupt_off (#120047)
colesbury 456b92f
gh-119553: Clear reader on Ctrl-C command (GH-119801)
lysnikolaou 59e59db
doc: Mention the missing reflected special methods for all binary ope…
paulofreitas 6f95ea9
gh-119842: Honor PyOS_InputHook in the new REPL (GH-119843)
pablogsal bde52f1
gh-120048: Make `test_imaplib` faster (#120050)
colesbury a6fb23a
gh-119819: Update test to skip if _multiprocessing is unavailable. (G…
vsajip dd8d1d1
gh-119999: Fix potential race condition in `_Py_ExplicitMergeRefcount…
colesbury 00e04cc
gh-119553: Fix console when pressing Ctrl-C within a multiline block …
lysnikolaou 5d3fc6e
gh-114616: Improve docs regarding changes to caches representation in…
iritkatriel ac78acf
gh-120078: Fix struct_time attr typo tm_day -> tm_mday in Doc/library…
shoenot 0cdb827
gh-119819: Update logging configuration to support joinable multiproc…
vsajip edb13f3
gh-119287: clarify doc on BaseExceptionGroup.derive and link to it fr…
iritkatriel ea9287b
gh-120065: Increase `collect_in_thread` period to 5 ms. (#120068)
colesbury 37f92ed
gh-119786: add links to code in exception handling doc (#120077)
iritkatriel 982da2a
gh-115225: Raise error on unsupported ISO 8601 time strings (#119339)
benchatt f974bc1
pathlib ABCs: remove duplicate `realpath()` implementation. (#119178)
barneygale File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next
Next commit
GH-118289: Fix handling of non-directories in
os.path.realpath()
In strict mode, raise `NotADirectoryError` if a file path is given with a trailing slash, or subsequent dot segments. We use a `part_count` variable rather than `len(rest)` because the `rest` stack also contains markers for unresolved symlinks.
- Loading branch information
commit 59f7fde03aa8659a42b23fab72737d8e47c3cedc
There are no files selected for viewing
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
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
2 changes: 2 additions & 0 deletions
2
Misc/NEWS.d/next/Library/2024-04-25-18-15-53.gh-issue-118289.moL9_d.rst
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| :func:`os.path.realpath` now raises :exc:`NotADirectoryError` when *strict* | ||
| mode is enabled and a non-directory path with a trailing slash is supplied. |
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.
Uh oh!
There was an error while loading. Please reload this page.