aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatti Picus <matti.picus@gmail.com>2020-10-28 08:09:05 +0200
committerMatti Picus <matti.picus@gmail.com>2020-10-28 08:09:05 +0200
commit41e64e5353f7bcc9d79d4901f628aaaf8dbba179 (patch)
tree0b1f83482e1dfae66c729333f158a9d62f6ac327 /rpython
parentfail early in rstr.do_stringformat for ints too small, not when speciallizing... (diff)
parentbackport changes from py3.6 (diff)
downloadpypy-41e64e5353f7bcc9d79d4901f628aaaf8dbba179.tar.gz
pypy-41e64e5353f7bcc9d79d4901f628aaaf8dbba179.tar.bz2
pypy-41e64e5353f7bcc9d79d4901f628aaaf8dbba179.zip
merge default into branch
Diffstat (limited to 'rpython')
-rw-r--r--rpython/rlib/rposix.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/rpython/rlib/rposix.py b/rpython/rlib/rposix.py
index f006d854ae..fd82a3394a 100644
--- a/rpython/rlib/rposix.py
+++ b/rpython/rlib/rposix.py
@@ -925,6 +925,11 @@ def listdir(path):
raise OSError(get_saved_errno(), "opendir failed")
return _listdir(dirp)
else: # _WIN32 case
+ if not path:
+ traits = _preferred_traits('')
+ win32traits = make_win32_traits(traits)
+ raise OSError(win32traits.ERROR_FILE_NOT_FOUND,
+ "listdir called with invalid path")
traits = _preferred_traits(path)
win32traits = make_win32_traits(traits)
path = traits.as_str0(path)