Eryk Sun added the comment:
In ntpath._getfinalpathname_nonstrict(), `tail` should be initialized to
`path[:0]`.
Currently `tail` is initialized to the empty string value ''. If an error
occurs that's allowed and `path` is a root directory that's passed as bytes,
then
Eryk Sun added the comment:
> So that means we can close the issue, no?
This is a bug in 3.8 and 3.9, which need the fix to keep reading until "\n" is
seen on the line. I arrived at this issue via bpo-38755 if you think it should
be addressed there, but it's the same b
Eryk Sun added the comment:
If realpath() resolves too much, you'll have to resolve manually via
os.path.islink() and os.readlink(). If you need strict resolution, use
pathlib.Path.resolve(). In strict mode it raises FileNotFoundError if a path
component doesn't exist. Also, e
Eryk Sun added the comment:
> I don't get any error executing the t33a.py script
The second line in t33a.py is 1618 bytes. The standard I/O BUFSIZ in Linux is
8192 bytes, but it's only 512 bytes in Windows. The latest alpha release,
3.10a7, includes your rewrite of the toke
Change by Eryk Sun :
--
versions: +Python 3.8, Python 3.9 -Python 2.7, Python 3.2, Python 3.3, Python
3.4
___
Python tracker
<https://bugs.python.org/issue14
Change by Eryk Sun :
--
stage: test needed -> needs patch
versions: -Python 3.7
___
Python tracker
<https://bugs.python.org/issue38755>
___
___
Python-
Eryk Sun added the comment:
> P.S. No problems with Python 3.8.5 and Ubuntu 20.04.2 LTS.
The issue is that the line length is limited to BUFSIZ, which ends up splitting
the UTF-8 sequence b'\xe2\x96\x91'. BUFSIZ is only 512 bytes in Windows. It's
8192 bytes in Linux, in w
Eryk Sun added the comment:
> So are you telling that we should change the name to "ptr" to
> avoid a breaking change?
The function parameter name is "ptr". Changing that name could break existing
code. I don't think it's likely, but it's not wort
Eryk Sun added the comment:
> If that's the problem then why not change all of them to use the
> name "address" or "addr" to avoid confusion and make it clear
> simple. What is your view?
Change them all to refer to `ptr`. It's
Eryk Sun added the comment:
> So we stop passing the O_TEMPORARY flag. If __enter__() is called,
> close() closes the file but doesn't delete anything, and
> __exit__() closes the file (if open) and deletes it (even if it
> wasn't open). If there is no __enter__(), cl
Eryk Sun added the comment:
In POSIX, os.path.abspath(p) is normpath(join(os.getcwd(), p)). normpath()
doesn't touch the filesystem, and it's documented that its "string manipulation
may change the meaning of a path that contains symbolic links". You can use
os.path.r
Eryk Sun added the comment:
> My opinion is that no extra flags are necessary. The default of
> deleting on close is fine, unless a context manager is active -- in
> which case delete on CM exit.
There is a use case of needing to let another thread or process open the
temporary f
Eryk Sun added the comment:
> the name "address" and "addr" respectively which are misleading
> because it is asking for ctypes.c_char_p or ctypes.c_wchar_p which
> are C pointer types
string_at() and wstring_at() take a c_void_p value. This can be initia
Eryk Sun added the comment:
> my subrocess code doesn't seem to hang on Linux where the
> thread example code does?
Reader threads for stdout and stderr are only used in Windows, since there's no
equivalent to select/poll for synchronous pipes in Windows.
Without using t
Change by Eryk Sun :
--
nosy: +pitrou
___
Python tracker
<https://bugs.python.org/issue43784>
___
___
Python-bugs-list mailing list
Unsubscribe:
Eryk Sun added the comment:
It's not a subprocess bug, per se. It's due to creating the stdout/stderr
worker threads from the __del__ finalizer while the interpreter is shutting
down. Minimal reproducer, confirmed in both Linux and Windows:
import threading
class C:
Eryk Sun added the comment:
> 3. Worth fixing in `ntpath.expanduser()`
To expand on the suggestion in msg390507, here's a demo that implements getting
the profile path of a local user account, with support for the special profile
directories "Default", "Public&q
Eryk Sun added the comment:
The limit of 512 characters is not for sys.stdin in general. It's for
io._WindowsConsoleIO, which gets used as the raw file for non-redirected
sys.stdin -- and opening "CON" and "CONIN$" -- if legacy mode isn't enabled.
See bpo-418
Eryk Sun added the comment:
> os.path.expanduser() has many flaws, and it just "guess" the
> home directory for other users.
I'm fine with not guessing another user's profile directory (or home directory)
in some cases, or even always. But the code that got commit
Eryk Sun added the comment:
For a "~user" path, the value of userhome should always be used if target_user
== current_user. If for some reason the USERPROFILE environment variable isn't
defined, the fallback "%HOMEDRIVE%%HOMEPATH%" does not necessarily end in
Eryk Sun added the comment:
> The 3.8 backport is much more complicated, as we don't have access to
> the PathSkipRoot function there. So we can't use the native function.
I guess you missed the comment that I left on the PR a few days ago. The 3.8
backport can use the old
Eryk Sun added the comment:
> I've got a fairly simple implementation for this using the (new)
> nt._path_splitroot native method
It's for the best to let the system path API handle this, especially if doing
so gets this issue resolved, as well as others like it and those th
Eryk Sun added the comment:
> It'll still raise, given it's invalid, though not with the
> exception it should be raising with...
onerror() is always called to handle an exception, and `raise` will re-raise
that exception. Is there a specific case where this isn't wor
New submission from Eryk Sun :
getenvironment() in Modules/_winapi.c needs to sort variables in the
environment block and remove duplicates case insensitively [1].
The sort order used to matter with SetEnvironmentVairableW(). As soon as it
reached a name in the environment block that
Change by Eryk Sun :
--
Removed message: https://bugs.python.org/msg389828
___
Python tracker
<https://bugs.python.org/issue43510>
___
___
Python-bugs-list mailin
Eryk Sun added the comment:
> Why is there no 2nd 995 after the recursion error?
print(s) calls sys.stdout.write(s) and sys.stdout.write("\n"). The I/O stack
consists of a text I/O wrapper, buffered writer, and a raw file object. What
happens in this case is that writing &q
Change by Eryk Sun :
--
resolution: -> rejected
stage: test needed -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Change by Eryk Sun :
--
versions: -Python 3.7
___
Python tracker
<https://bugs.python.org/issue43431>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Eryk Sun :
--
title: Ctypes Packing Bitfields Incorrectly - Linux -> [Linux] ctypes packs
bitfields Incorrectly
versions: +Python 3.10 -Python 3.7
___
Python tracker
<https://bugs.python.org/issu
Change by Eryk Sun :
--
components: +Interpreter Core, Library (Lib) -Extension Modules
title: Can't import extension modules resolved via relative paths in sys.path
on Windows -> [Windows] Can't import extension modules resolved via relative
paths in sys.path
versions:
Change by Eryk Sun :
--
components: +Extension Modules
title: Inconsistent os.stat behavior for directory with Access Denied ->
[Windows] Inconsistent os.stat behavior for directory with Access Denied
versions: +Python 3.10 -Python 3.7
___
Pyt
Change by Eryk Sun :
--
title: multiprocessing handle leak on Windows when child process is killed
during startup/unpickling -> [Windows] multiprocessing handle leak when child
process is killed during startup/unpickling
versions: -Python
Change by Eryk Sun :
--
versions: +Python 3.10 -Python 3.7
___
Python tracker
<https://bugs.python.org/issue36534>
___
___
Python-bugs-list mailing list
Unsub
Eryk Sun added the comment:
> Even if that's just swapping the execv call for spawnv(_P_WAIT)
> and then exiting, that's fine by me
Maybe call SuspendThread() on other threads, at least the ones that can be
enumerated with the threading module.
> I don't see how it
Eryk Sun added the comment:
spawn_main() could handle a PermissionError by checking the exit code. If the
parent has terminated already, then simply exit quietly.
_winapi.PROCESS_QUERY_LIMITED_INFORMATION would need to be defined. For example:
def spawn_main(pipe_handle, parent_pid=None
Eryk Sun added the comment:
> I think we should accept `encoding="locale"` even in binary mode.
That's a good idea. It means the same as passing None, except it avoids a
warning.
--
nosy: +eryksun
___
Python tracker
<ht
Eryk Sun added the comment:
Steve, what do you think about os.exec*()? Should it be emulated better or
deprecated?
We can't hide the reality that it's a new process with a different process ID
and parent process ID -- against what POSIX requires. But emulating exec() is
pro
Eryk Sun added the comment:
> "C:\Program Files\WindowsApps\venvlauncher.exe"
The above was supposed to be "C:\Program
Files\WindowsApps\Python...\venvlauncher.exe", where "Python..." is the elided
name of the package directory.
--
_
Eryk Sun added the comment:
> the Store package, which can only be *executed* from outside its
> container (we can't load the DLL directly).
The idea I was pondering was to create "python.exe" in the virtual environment
as an appexec link to "C:\Program Files\Wi
Eryk Sun added the comment:
> The doc on rmtree states
> Exceptions raised by onerror will not be caught.
> Does this mean I can't use try/exept inside of onerro
rmtree() does not call onerror() in a try/except statement. An exception raised
in onerror() will propagate to
Eryk Sun added the comment:
I closed bpo-20010 because the official PSF distributions of Python 3.5+ for
Windows use the Universal CRT (ucrt), the system C runtime library for
applications. ucrt does not have this problem with the "%z" format code. For
example, using ctypes:
Change by Eryk Sun :
--
versions: +Python 3.10, Python 3.8, Python 3.9 -Python 3.7
___
Python tracker
<https://bugs.python.org/issue35144>
___
___
Python-bug
Eryk Sun added the comment:
> blacklisting directories
Ensure that filepaths in sys.argv are resolved before changing out of a
blacklisted directory. Also, for file open/save dialogs, as opposed to the
working directory of the Python subprocess (e.g. os.getcwd() in the REPL), it's
Eryk Sun added the comment:
> if sys.stdout is None and no file in sys.argv
With the app distribution from the Microsoft Store, "idle3.x.exe" is a GUI
executable that runs idlelib. There isn't a console version. Also, GUI scripts
are usually run with the pyw.exe launcher o
Change by Eryk Sun :
--
versions: +Python 3.10 -Python 3.7
___
Python tracker
<https://bugs.python.org/issue39318>
___
___
Python-bugs-list mailing list
Unsub
Change by Eryk Sun :
--
Removed message: https://bugs.python.org/msg359981
___
Python tracker
<https://bugs.python.org/issue39318>
___
___
Python-bugs-list mailin
Change by Eryk Sun :
--
versions: +Python 3.10, Python 3.9 -Python 3.7
___
Python tracker
<https://bugs.python.org/issue37801>
___
___
Python-bugs-list mailin
Change by Eryk Sun :
--
components: +Library (Lib)
keywords: +3.10regression, 3.6regression, 3.7regression, 3.8regression,
3.9regression -patch
stage: test needed -> needs patch
type: crash -> behavior
versions: +Python 3.10 -Python 3.7
___
Change by Eryk Sun :
--
resolution: -> not a bug
stage: -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.org/issue37756>
___
Change by Eryk Sun :
--
resolution: -> not a bug
stage: -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.org/issue35440>
___
Change by Eryk Sun :
--
versions: +Python 3.10 -Python 3.7, Python 3.8
___
Python tracker
<https://bugs.python.org/issue33406>
___
___
Python-bugs-list mailin
Eryk Sun added the comment:
> __getattr__ method of LibraryLoader catches the OSError and
> raises an AttributeError
Yes. It seems no one was keen to work on this. I think it's relatively easy, so
I'll add that flag in case someone is looking for an easy issue.
--
Change by Eryk Sun :
--
versions: +Python 3.10, Python 3.8, Python 3.9 -Python 3.7
___
Python tracker
<https://bugs.python.org/issue35026>
___
___
Python-bug
Eryk Sun added the comment:
Here's a concrete implementation of the above discussion.
_is_windows = (sys.platform == 'win32')
def ismount(path):
"""Test whether a path is a mount point"""
path = os.fspath(path)
if
Change by Eryk Sun :
--
assignee: -> docs@python
components: +Documentation
nosy: +docs@python
title: os.path.ismount returns true on nested btrfs subvolumes -> Document that
os.path.ismount() returns true for nested btrfs subvolumes
type: behavior -> enhancement
versions
Change by Eryk Sun :
--
resolution: -> fixed
stage: -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.org/issue42041>
___
Change by Eryk Sun :
--
resolution: -> duplicate
stage: -> resolved
status: open -> closed
superseder: -> [Windows] time: crash on formatting time with de_DE locale
___
Python tracker
<https://bugs.python
Eryk Sun added the comment:
ucrt in Windows 10 v2004 uses an internal wide-character version of the
time-zone name, which gets updated by _tzset() and kept in sync with the
_tzname encoded strings. Also, note that the current implementation uses the
locale's ANSI code page for both &
Change by Eryk Sun :
--
Removed message: https://bugs.python.org/msg361476
___
Python tracker
<https://bugs.python.org/issue36792>
___
___
Python-bugs-list mailin
Change by Eryk Sun :
--
resolution: -> duplicate
stage: -> resolved
status: open -> closed
superseder: -> [Windows] OSError when testing whether pathlib.Path('*') exists
___
Python tracker
<https://b
Change by Eryk Sun :
--
title: OSError [WinError 123] when testing if pathlib.Path('*') (asterisks)
exists -> [Windows] OSError when testing whether pathlib.Path('*') exists
type: -> behavior
versions: +Python 3.10 -Python 3.7
Change by Eryk Sun :
--
Removed message: https://bugs.python.org/msg333746
___
Python tracker
<https://bugs.python.org/issue35306>
___
___
Python-bugs-list mailin
Eryk Sun added the comment:
The suggested documentation change looks good to me.
--
type: behavior -> enhancement
versions: +Python 3.10, Python 3.8, Python 3.9 -Python 3.7
___
Python tracker
<https://bugs.python.org/issu
Change by Eryk Sun :
--
type: behavior -> enhancement
versions: +Python 3.10 -Python 3.7
___
Python tracker
<https://bugs.python.org/issue34142>
___
___
Py
Change by Eryk Sun :
--
versions: +Python 3.10 -Python 3.7
___
Python tracker
<https://bugs.python.org/issue37769>
___
___
Python-bugs-list mailing list
Unsub
Eryk Sun added the comment:
> I realize one could interpret the python3 in the shebang as an
> "explicit version specification", but a) that's not on the
> command line, which seems the more natural reading and b) it's
> only a partial specification, since i
Eryk Sun added the comment:
> If you are lost with locale encodings, you can attempt to encode
> everything in UTF-8 and enables the Python UTF-8 Mode:
rushant is using Python 3.6. UTF-8 mode was added in 3.7, so it's not an option
without first upgrading to 3.7. Also, it's i
Eryk Sun added the comment:
I think this is a locale configuration problem, in which the locale encoding
doesn't match the terminal encoding. If so, it can be closed as not a bug.
> export a="中文"
In POSIX, the shell reads "中文" from the terminal as bytes encod
Eryk Sun added the comment:
I think so. But I'll mark it pending for now in case Tobi provides more
information to explain why this is a problem. Making time.perf_counter()
system-wide in Windows was fixing it to match the documented behavior. That
this provides the system uptime
Eryk Sun added the comment:
Fred, do you think this needs to be reopened to clarify that os.sep and
os.altsep are not parameters for the ntpath and posixpath modules?
I would have thought that the note at the top (path name conventions, etc)
would be sufficient to let someone know that
Eryk Sun added the comment:
> certainly you can see this is a doc bug, since the doc clearly
> states that os.sep is utilized to join the elements of the path,
> when it clearly isn't; right?
os.path is ntpath in Windows, which uses backslash as the path separator, which
Eryk Sun added the comment:
The documentation of os.path.join() uses os.sep because it's written from the
perspective of the platform's os.path, which is posixpath on a POSIX system and
ntpath on a Windows system.
If you need to work with POSIX paths in Windows, then use posixpat
Eryk Sun added the comment:
> Python interpreter will exit when using Ctrl C to interrupt
> some Python module functions with read operations.
The REPL exits when stdin is closed. open() allows the filename to be an
existing file descriptor without requiring a parameter such as "
Eryk Sun added the comment:
> I suppose the most reasonable behavior is to strip out the "\\?\" before
> attempting the conversion as the path is sensible and parsable without
Okay, so you're not looking to preserve the fact that it's a \\?\ verbatim path
in
Eryk Sun added the comment:
RFC8089 doesn't specify "a mechanism for translating namespaced paths ["\\?\"
and "\\.\"] to or from file URIs", and the Windows shell doesn't support them.
So what's the practical benefit of supporting them in nturl2p
Eryk Sun added the comment:
In some cases, the problem can be worked around by setting the
__PYVENV_LAUNCHER__ environment variable and executing the base executable. For
example:
import os
import sys
import subprocess
def get_python_exe_env():
if sys.executable
Change by Eryk Sun :
--
versions: +Python 3.10 -Python 3.9
___
Python tracker
<https://bugs.python.org/issue2920>
___
___
Python-bugs-list mailing list
Unsub
Eryk Sun added the comment:
Python 3.8 introduced some behavior changes to how reparse points are
supported, but generalized support for handling name-surrogate reparse points
as symlinks was not implemented. Python continues to set S_IFLNK in st_mode
only for IO_REPARSE_TAG_SYMLINK reparse
Eryk Sun added the comment:
> on windows, they print sys.path[0] is python38.zip not "".
Isolated mode is probably enabled, i.e. `sys.flags.isolated == 1`. It's enabled
by default for the embedded distribution [1], or if a "._pth" file exists
beside and wi
Eryk Sun added the comment:
In bpo-29971 it was suggested to split the PyThread lock API in Windows into an
"interruptible lock" API that's based on emulated condition variables and a
"fast lock" API that's based on native condition variables and SRW locks. May
Eryk Sun added the comment:
The issue with non-strict resolution of relative paths that do not exist is
being addressed in bpo-38671. The proposal to support and document the
absolute() method is addressed in bpo-29688.
--
resolution: -> duplicate
stage: -> resolved
status
Eryk Sun added the comment:
3.7.8, released on 2020-06-27, was the last bugfix release of Python 3.7, so
I'm closing this issue as a duplicate of bpo-33898, which is about supporting
device paths correctly in pathlib.
--
resolution: -> duplicate
stage: -> resolved
s
Change by Eryk Sun :
--
components: +Library (Lib)
stage: -> needs patch
type: -> behavior
versions: +Python 3.10, Python 3.8, Python 3.9 -Python 3.7
___
Python tracker
<https://bugs.python.org/i
Eryk Sun added the comment:
It's still the case that we have to guess that a generic EINVAL (22) is
actually EPIPE. Low-level wrapper functions in Python/fileutils.c, such as
_Py_read() and _Py_write_impl(), should try to get a better error code by
calling Python's custom winerro
Eryk Sun added the comment:
This old issue still needs to be fixed. The check for special_prefixes in
ntpath.normpath() must be removed in order to be consistent with WinAPI
GetFullPathNameW(). In Windows, one can just call ntpath.abspath() to ensure
that nt._getfullpathname() is called
Change by Eryk Sun :
--
Removed message: https://bugs.python.org/msg338058
___
Python tracker
<https://bugs.python.org/issue15286>
___
___
Python-bugs-list mailin
Eryk Sun added the comment:
For Windows, starting with Python 3.10, the value of time.perf_counter[_ns]()
is system wide instead of relative to the first time it's accessed in the
current process. This allows comparing the counter value across processes. See
bpo-37205.
--
Change by Eryk Sun :
--
Removed message: https://bugs.python.org/msg380941
___
Python tracker
<https://bugs.python.org/issue37205>
___
___
Python-bugs-list mailin
Change by Eryk Sun :
--
Removed message: https://bugs.python.org/msg380944
___
Python tracker
<https://bugs.python.org/issue37205>
___
___
Python-bugs-list mailin
Change by Eryk Sun :
--
assignee: -> docs@python
components: +Documentation, Extension Modules -Library (Lib)
nosy: +docs@python
title: time_ns() and time() cannot be compared on windows -> [time] document
that integer nanoseconds may be more precise than float
type: be
Eryk Sun added the comment:
> On Windows, the new process is executed in the background but
> can send output to a console if the original process was
> started in a console.
C execv[e]() is a mess for console applications. The child process is competing
for console input with an
Eryk Sun added the comment:
> I'm not actually sure what the proposal here is. Are we suggesting
> that all Python's means of terminating a process should use the
> same exit code?
That's how I read it, but I don't agree if it means always pretending that a
pr
Change by Eryk Sun :
--
title: shutil.copyfile throws incorrect SameFileError on Google Drive File
Stream -> [Windows] samefile() should not use zero-valued st_dev and st_ino
___
Python tracker
<https://bugs.python.org/issu
Eryk Sun added the comment:
Filesystem paths in Windows are normally opened case insensitive, but a
filesystem can choose to ignore this. NTFS does so for directories that flagged
as case sensitive [1]. ntpath.normcase() doesn't incorporate this information.
It would have to query the
Change by Eryk Sun :
--
components: +Extension Modules
versions: +Python 3.10, Python 3.9 -Python 3.7
___
Python tracker
<https://bugs.python.org/issue33
Eryk Sun added the comment:
> oh, I missed that a notification happens to the other process(es) in a
> common case, a bit of retrying with backoff would actually make sense
The other common problem with deleting an empty directory is when it's opened
as the working directory o
Eryk Sun added the comment:
> Isn't this just "how windows behaves" on some filesystems with
> little that we can do about it?
The suggestion was to include an error handler that retries unlink() and
rmdir() -- particularly rmdir() -- a given number of times, probably
Eryk Sun added the comment:
> side note: do we need to care about Windows 7 anymore in
> 3.10 given that microsoft no longer supports it?
If the fix comes in time for Python 3.8, then it needs to support Windows 7.
For Python 3.9+, the 32 KiB limit can be removed.
The c
Eryk Sun added the comment:
> In my experience, most applications use the ANSI code page because
> they use the ANSI flavor of the Windows API.
The default encoding at startup and in the "C" locale wouldn't change. It would
only differ from the default if setlocale(
Change by Eryk Sun :
--
stage: -> needs patch
versions: +Python 3.10, Python 3.8, Python 3.9 -Python 3.7
___
Python tracker
<https://bugs.python.org/issu
401 - 500 of 2115 matches
Mail list logo