eryksun added the comment:
Steve, do you think it's OK to abandon localization for exception messages? If
so, should we be using English for all FormatMessage calls? It's a bit ugly
that Python's exceptions and the CRT error messages are in English, but then
whenever we cal
eryksun added the comment:
The "DLL load failed" message is from Python, but the rest is the text for the
Windows error code, ERROR_BAD_EXE_FORMAT (0x00c1) [1]. The "%1" in the string
can be expanded as the first element of the Arguments array parameter of
FormatMessage [2
Changes by eryksun :
--
resolution: -> duplicate
stage: -> resolved
status: open -> closed
superseder: -> Windows: subprocess.Popen: race condition for leaking
inheritable handles
___
Python tracker
<http://bugs.python
eryksun added the comment:
> As for the suggestion to install SP1 1... As for the manual
> installation I am not sure which file to download from
It's one of these three, depending on your system architecture:
windows6.1-KB976932-X86.exe - This application installs Sp1 to a
eryksun added the comment:
On Windows, how about creating a junction (_winapi.CreateJunction in 3.5, or
the shell's mklink /j) from ~\.idlerc to %APPDATA%\idle? If ~\.idlerc already
exists, it could be moved to %APPDATA%\idle before creating the junction. New
code would directly use %AP
Changes by eryksun :
Added file: http://bugs.python.org/file40890/ctypes_from_buffer_2.patch
___
Python tracker
<http://bugs.python.org/issue25498>
___
___
Python-bug
Changes by eryksun :
Removed file: http://bugs.python.org/file40884/ctypes_from_buffer_1.patch
___
Python tracker
<http://bugs.python.org/issue25498>
___
___
Python-bug
Changes by eryksun :
--
keywords: +patch
Added file: http://bugs.python.org/file40884/ctypes_from_buffer_1.patch
___
Python tracker
<http://bugs.python.org/issue25
Changes by eryksun :
Added file: http://bugs.python.org/file40883/ctypes_crash.py
___
Python tracker
<http://bugs.python.org/issue25498>
___
___
Python-bugs-list mailin
eryksun added the comment:
I forgot to first check whether p2cread is None:
ERROR_INVALID_HANDLE = 0x0006
if stdin is None:
p2cread = _winapi.GetStdHandle(_winapi.STD_INPUT_HANDLE)
if p2cread is not None:
try:
os.get_handle_inheritable
eryksun added the comment:
For me, fails() lives up to its name in Windows 7, but it doesn't fail in
Windows 10. It shouldn't fail in Windows 8, either.
In Windows 8+ the console interface is implemented using a kernel device.
Console handles reference virtual files on the Con
eryksun added the comment:
In subprocess.py there's the following code that builds a sequence of potential
paths for the executable [1]:
executable = os.fsencode(executable)
if os.path.dirname(executable):
executable_list = (executable,)
else:
# This matche
eryksun added the comment:
This seems to be a problem with Tk 8.6 when using an international keyboard
layout on Linux. I ran the following test.tcl script via wish:
text .t
pack .t
Initially dead keys work, but they stop working if I switch away from the text
entry to another window
eryksun added the comment:
I meant that you need a check in buffered_close such as the following:
if (res == NULL) {
if (PyErr_ExceptionMatches(PyExc_BlockingIOError))
goto end;
PyErr_Fetch(&exc, &val, &tb);
} else
Py_DECREF(res);
For 2
eryksun added the comment:
Per issue 16597, when an exception occurs in flush(), the file is closed
anyway. You'd have to check the exception and only skip to the end for
EWOULDBLOCK or EAGAIN. That way you're not introducing a regression for ENOSPC
and other exceptions for whic
eryksun added the comment:
Steve, I think you're right that it's simpler and more reliable to add a
command-line option that sets IDLE's working directory to the current user's
home directory.
Terry, the default behavior in Linux, at least in Ubuntu, is to start ID
eryksun added the comment:
> 'Start in:' is blank and for what ever reason, the default is ...system32.
When the "Start in" field of a .lnk shortcut is blank, the child process
inherits the working directory of the parent process (i.e. the process that
runs the short
Changes by eryksun :
--
resolution: -> duplicate
stage: -> resolved
status: open -> closed
superseder: -> Catching virtual subclasses in except clauses
___
Python tracker
<http://bugs.python
eryksun added the comment:
In Python 2, PyErr_GivenExceptionMatches [1] calls PyObject_IsSubclass. To
handle calling __subclasscheck__ in this case, 2.7 (but not 2.6) temporarily
increases the recursion limit by 5. For example:
class CMeta(type):
def __subclasscheck__(self, other
eryksun added the comment:
Since Python has multiple inheritance, it could be misconstrued as a
conjunctive test. For example, if c is an instance of C, which subclasses both
A and B, then someone might think isinstance(c, (A, B)) requires c to be an
instance of both A and B. The description
eryksun added the comment:
Setting a new default for py.exe doesn't require admin privileges. You can use
the PY_PYTHON environment variable:
C:\>py --version
Python 2.7.10
C:\>set PY_PYTHON=3
C:\>py --version
Python 3.5.0
which you can easily persist i
eryksun added the comment:
> It would be interesting to know under what circumstances these
> functions can fail.
The CRT _put[w]ch and _get[w]ch[e] functions will fail when called in a process
that doesn't have a console. (Except get[w]ch may succeed if it follows
unget[w]ch.)
eryksun added the comment:
Sorry, I forgot to include the link to readme.txt:
[2]: https://hg.python.org/cpython/file/v3.5.0/PCbuild/readme.txt
--
___
Python tracker
<http://bugs.python.org/issue25
eryksun added the comment:
Building Python 3.5 requires Visual Studio 2015 and Windows 8.1, so this would
be a vanishingly small audience that's building to deploy on old 32-bit Windows
7 machines. I don't think the PSF needs to worry about this. Anyway, the "/arch
(x86)"
eryksun added the comment:
> Windows requires SSE these days, since Vista IIRC, so the problem
> is probably someone on XP.
Windows 8 is the first to require SSE2 [1][2]. I'm sure it's no coincidence
that this became the default in VS 2012.
There is probably a small minori
eryksun added the comment:
With Visual Studio 2010 and earlier, SSE support had to be explicitly enabled.
Starting with VS2012 it's on by default [1]:
Because the x86 compiler generates code that uses SSE2
instructions by default, you must specify /arch:IA32 to
disable gener
Changes by eryksun :
--
nosy: +vinay.sajip
___
Python tracker
<http://bugs.python.org/issue25360>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from eryksun:
The Windows launcher searches PATH to implement the shebang "#!/usr/bin/env".
Given "#!/usr/bin/env python", it always searches for L"python" (see issue
17903), even in pyw.exe. maybe_handle_shebang in PC/launcher.c should instead
us
eryksun added the comment:
int(float_version) is returning the actual integer value represented by the
float, which is the closest approximation possible using an [IEEE 754
binary64][1], i.e. a C double. Here's one way to compute this value manually:
from struct import pack
eryksun added the comment:
Please attach "Python 3.5.0 (32-bit)_*_core_JustForMe.log", if it exists.
According to the log, initially the installer can't create a restore point
because, I assume, you have the volume shadow copy (VSS) service disabled, i.e.
th
eryksun added the comment:
> it does not generates any .evtx file
Start a command prompt; change to the directory that has the MSU, and run it
with the option "/log:kb2999226.evtx". For me this creates kb2999226.evtx in
the current directory, which can be converted to XML using
Changes by eryksun :
--
components: +Windows
nosy: +paul.moore, steve.dower, tim.golden, zach.ware
___
Python tracker
<http://bugs.python.org/issue25327>
___
___
Changes by eryksun :
Removed file: http://bugs.python.org/file40706/Python 3.5.0
(64-bit)_20151006150920.log
___
Python tracker
<http://bugs.python.org/issue25
eryksun added the comment:
Yes, if you explicitly use big-ending or little-endian UTF, then you need to
manually include a BOM if that's required. That said, if a file format or data
field is specified with a particular byte order, then using a BOM is strictly
incorrect. See the UTF BO
eryksun added the comment:
Error code WU_E_NOT_APPLICABLE (0x80240017) just tells us that "there are no
applicable updates". Perhaps the Windows Update log has more information.
Shirshendu, try directly installing the [Universal CRT update][1] from the
command prompt. Run it wit
eryksun added the comment:
I don't know about OS X, but in 64-bit Linux I can increase the recursion limit
to 10 if I allow the main thread to grow to 64 MiB by setting the
RLIMIT_STACK soft limit. For example:
soft, hard = resource.getrlimit(resource.RLIMIT_STACK)
soft = max
eryksun added the comment:
AFAICT, on Windows using the posix_putenv_garbage dict is unnecessary. The
Windows C runtime creates a private copy of the string, so there's no need to
keep a reference. Moreover, since there's no unsetenv, deleting a variable is
accomplished by calling p
eryksun added the comment:
My suggestion is only for 3.5 / 3.6, because Windows XP is no longer supported.
Starting with Windows Vista, both cmd.exe and CreateProcess support this
behavior. I realize that disabling searching the current director by default is
going beyond what cmd.exe does
eryksun added the comment:
Please don't default to searching the current directory:
if is_windows:
# The current directory takes precedence on Windows.
if not os.curdir in path:
path.insert(0, os.curdir)
Add a keyword option to enable this, with a warning
Changes by eryksun :
--
components: +Windows
nosy: +paul.moore, steve.dower, tim.golden
versions: +Python 3.6
___
Python tracker
<http://bugs.python.org/issue22
eryksun added the comment:
In interactive mode the extra reference is held by the "_" built-in variable.
>>> a
'test string A'
>>> del __builtin__._; sys.getrefcount(a) - 1
1
Look at the following disassembled code, compiled in the '
eryksun added the comment:
> Does notepad handle clicking "edit" on a shortcut to a batch file?
> Maybe subcommands don't have exactly the same semantics as regular
> verbs...
In Windows 7 SP1 a regular verb works fine from a shortcut, but apparently not
a subcommand
eryksun added the comment:
> I don't believe %1 is necessarily correct here either, but maybe
> with %* it's redundant anyway
%0, %1, or %L is lpFile. On older systems "%L" guarantees using the long
filename, but this is pointless nowadays. %* (i.e. %2 through %9)
eryksun added the comment:
> some code that uses it will need updating (due to API changes
> since VC9/VC10)
For example, I discovered that the stdio exports don't include printf, etc.
Using __stdio_common_vfprintf to implement printf relies on calling
__acrt_iob_func to get std
eryksun added the comment:
Here's a rewrite with a cleaner while loop, at least to me:
def list_volumes():
vname = ctypes.create_unicode_buffer(wintypes.MAX_PATH)
vhandle = kernel32.FindFirstVolumeW(vname, len(vname))
if vhandle == INVALID_HANDLE_
eryksun added the comment:
> Ah, I misread that part. Will have to look deeper, but I'm not
> actually sure that shortcuts are supposed to support the same
> operations (though if it shows up, I guess it should work).
A LNK shortcut should support the same commands (e.g. open
eryksun added the comment:
The default function pointer restype is c_int, and the default integer argument
conversion is also c_int. However, the handle returned by FindFirstVolume is a
pointer to a private structure that it uses for the volume enumeration, so you
must set restype to a
eryksun added the comment:
> Dependency Walker doesn't know how to resolve those DLLs on
> any platform - Win10 looks exactly the same.
On older systems the api-ms-win-crt-* DLLs should be physically installed in
System32, so Dependency Walker should find them if they exist. For
eryksun added the comment:
> this update doesn't apply to you system
Was that Windows6.0-KB2999226-x86.msu? Open a command prompt and enter the
following:
wmic os get Version, OSArchitecture
Windows Vista SP 2 is version 6.0.6002, and the OS architecture should be
eryksun added the comment:
There haven't been any fundamental changes to bdist_wininst in years, and
bdist_wheel has mostly replaced it nowadays.
I'm fairly certain this issue was fixed by Mark Hammond's fix for issue 4566.
Just to be certain, I updated the code to use prin
eryksun added the comment:
Creating a symbolic link can't be relied on for a per-user installation.
Administrators have to elevate to create symbolic links, and most regular users
also lack this privilege.
--
___
Python tracker
eryksun added the comment:
Try directly installing the Universal CRT update,
[Windows6.0-KB2999226-x86.msu][1]. Run it with the /log option, e.g.
Windows6.0-KB2999226-x86.msu /log:kb2999226.evtx
You can view this log in the Windows event viewer, or convert it to text XML on
the command
eryksun added the comment:
Also, why does the per-user install path have a seemingly pointless "Python"
base directory? I expected it to install directly into
FOLDERID_UserProgramFiles, to be consistent with installing to
FOLDERID_ProgramFiles.
Also, I doubt anyone cares, but t
eryksun added the comment:
Even MvL appears to slip up when he states "some may accept non-strings as
attribute names". That would be pointless in a __setattr__ method since setattr
/ PyObject_SetAttr reject non-string values
eryksun added the comment:
Where is the API documented to change the install scope dynamically? I see
where it's apparently defined in the burn manifest (extracted from the
executable) as PerMachine="no":
http://schemas.microsoft.com/wix/2008/Burn";>
<
eryksun added the comment:
> The problem here is probably that installing the CRT update
> required a restart
I saw that, but it didn't make any sense to me that the DLL isn't available
immediately after wusa.exe exits. Is it in limbo until the system is restarted?
I know in
eryksun added the comment:
This is a documentation issue and not specific to a particular version of
Python. What's the rule on version tagging in this case?
--
components: +Documentation
___
Python tracker
<http://bugs.python.org/is
eryksun added the comment:
This issue doesn't pertain to the 64-bit version.
C:\Temp>py -3.5
Python 3.5.0 (v3.5.0:374f501f4567, Sep 13 2015, 02:27:37)
[MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "li
eryksun added the comment:
> import locale
> locale.setlocale(locale.LC_ALL, '')
>
> import importlib
> import time
> importlib.reload(time)
>
> it does not work when imported after importing time.
> What is the reason? Does reload() work only for
>
eryksun added the comment:
To clarify using a unicode name in 2.x, it has to be encodable using the
default encoding, sys.getdefaultencoding(). Normally this is ASCII.
--
___
Python tracker
<http://bugs.python.org/issue25
eryksun added the comment:
The name can be any str/unicode string, including language keywords:
>>> setattr(o, 'def', 'allowed')
>>> getattr(o, 'def')
'allowed'
>>> o.def
File "", line 1
eryksun added the comment:
> local_encoding = locale.getdefaultlocale()[1]
Use locale.getpreferredencoding().
> b = eval('b' + ascii(result))
> result = b.decode(local_encoding)
It's simpler and more reliable to use 'latin-1' and 'mbcs' (ANSI). For
eryksun added the comment:
Lauri changed the version from 3.4 to 3.2, and I was able to reproduce the
problem in 3.2.5:
C:\Temp>py -3.2 --version
Python 3.2.5
C:\Temp>py -3.2 nospace.py
removing fill.txt
Traceback (most recent call last):
File "nospace.py&q
eryksun added the comment:
See issue 16597. This wasn't fixed for 3.2, so it won't close the file if
flush() fails. You'll either have to work around this or upgrade to 3.3+.
------
nosy: +eryksun
resolution: -> out of date
stage: -> resolved
s
eryksun added the comment:
> This looks as a duplicate of issue2528.
No, yangyanbo's problem is unrelated to the file's security descriptor, and
it's not a bug.
telnet.exe is manually installed via "Programs and Features", which only
installs a 64-bit version into
eryksun added the comment:
To decode the tzname strings, Python calls mbstowcs, which on Windows uses
Latin-1 in the "C" locale. However, in this locale the tzname strings are
actually encoded using the system ANSI codepage (e.g. 1250 for Central/Eastern
Europe). So it ends up dec
eryksun added the comment:
Per "Python 3.5.0 (32-bit)_20150914055131.log", the installer detects the OS as
NT 6.2.9200 (Windows 8/Server 2012), and installs Windows8-RT-KB2999226-x64.msu.
[0A68:0EC8][2015-09-14T05:51:31]i001:
Burn v3.10.0.1823,
Windows v6.2 (
eryksun added the comment:
> Pre-compiling should generally not be needed
It's a useful optimization if Python is installed to a directory that doesn't
grant write access to regular users, such as %ProgramFiles%.
--
___
Python t
eryksun added the comment:
There should be a bunch of logs named "Python 3.5.0*.log" in your user's %TEMP%
directory. If you don't mind, zip them up and attach the file to this issue for
Steve Dower to review when he returns from vacation.
In the mean time, try dir
eryksun added the comment:
The issue as I understand it is that, on this particular Windows 8.1 system,
passing a non-NULL lpEnvironment to CreateProcess works when starting a native
64-bit executable, but fails when starting a 32-bit executable via the WOW64
system. The child process instead
eryksun added the comment:
virtualenv fails to copy vcruntime140.dll. Use the standard library's venv
module instead.
--
nosy: +eryksun
resolution: -> third party
stage: -> resolved
status: open -> closed
___
Python
eryksun added the comment:
Maybe the download page should direct XP users to install 3.4.x.
--
nosy: +eryksun
___
Python tracker
<http://bugs.python.org/issue25
eryksun added the comment:
This bug is due to issue 23285, which improved support for EINTR handling.
os_waitpid_impl was changed to use the following do-while loop:
do {
Py_BEGIN_ALLOW_THREADS
res = _cwait(&status, pid, options);
Py_END_ALLOW_THREADS
} w
eryksun added the comment:
But it should go without saying that clearing errno from Python isn't reliable
considering how much code executes between Python statements. It needs to be
cleared right before call strftime, and optionally the old value needs to be
saved first in order to re
eryksun added the comment:
> Is there a way people can set errno to zero from Python code?
> Or do we need to ship 3.5.1 already?
The only the thing that comes to mind is using ctypes based on the CRT's
implementation of errno:
import ctypes
import errno
import time
eryksun added the comment:
> errno should always be cleared before use (in C99 at least,
> not sure what the crt does).
The CRT's strftime doesn't clear errno. I suggested clearing it in issue 25029,
msg250215.
------
nosy: +eryksun
__
Changes by eryksun :
--
components: +Windows -IDLE
___
Python tracker
<http://bugs.python.org/issue25107>
___
___
Python-bugs-list mailing list
Unsubscribe:
eryksun added the comment:
The latest version that supports Windows XP is 3.4.3.
--
components: +IDLE -Windows
nosy: +eryksun
___
Python tracker
<http://bugs.python.org/issue25
eryksun added the comment:
You're passing an already decoded string, so the BOM is treated as text.
Instead open the file in binary mode, i.e. open("bom3.py", "rb"). This way the
BOM will be detected when decoding the source bytes. Here's an example that
passe
eryksun added the comment:
I think 3.5 should be distributed with vcruntime140.dll. It seems a waste for
python.exe, python35.dll, and all of the extension modules and dependent DLLs
to each take an FLS slot:
>>> import ctypes # +1 for _ctypes
>>> kernel32 = ctype
eryksun added the comment:
Steve, it seems to me that for MSVC the EINVAL test should come first:
_Py_BEGIN_SUPPRESS_IPH
olderr = errno;
errno = 0;
buflen = format_time(outbuf, i, fmt, &buf);
err = errno;
errno = olderr;
_Py_END_SUPPRESS_IPH
if (bu
eryksun added the comment:
It seems VC 14 has a bug here. In the new C runtime, strftime is implemented by
calling wcsftime as follows:
size_t const result = _Wcsftime_l(wstring.get(), maxsize, wformat.get(),
timeptr, lc_time_arg, locale);
if (result == 0)
return 0
eryksun added the comment:
With MSVC, if errno is cleared before calling strftime, then when buflen == 0
you know whether it's an invalid format string (EINVAL) or maxsize is too small
(ERANGE). There's no need to guess. Oddly, only EINVAL is documented, even
though setting ERANGE h
eryksun added the comment:
> MSVC seems somewhat inconsistent about its response:
> >>> strftime('aaa%')
> ''
That's not due to MSVC. It's setting errno to EINVAL. The problem is that
time_strftime is testing (buflen > 0 || i >= 256 * fm
eryksun added the comment:
There's a public method that's almost what you want:
>>> print(pathlib.Path.absolute.__doc__)
Return an absolute version of this path. This function works
even if the path doesn't point to anything.
No normali
eryksun added the comment:
> Rather than debating about how various platforms handle malformed
> format strings for strftime(), and whether or not they crash, we
> should simply prevent the native strftime() function from seeing
> them in the first place.
Of course the check
eryksun added the comment:
> On Windows, the C lib strftime() segfaults with a trailing '%',
> just as it does with unsupported format codes.
No, it doesn't segfault; it invokes the invalid parameter handler (IPH). This
could always be configured for the whole process,
Changes by eryksun :
--
keywords: +easy
priority: normal -> low
versions: +Python 3.4, Python 3.5, Python 3.6
___
Python tracker
<http://bugs.python.org/issu
eryksun added the comment:
Do you mean the dst path has a trailing slash, but the directory doesn't exist?
shutil.copy doesn't check for a trailing slash, so it attempts to open dst as a
regular file. On Linux, and probably most POSIX systems, this results in an
EISDIR (is a direct
eryksun added the comment:
> exception instance raised in __getattr__ should not lead
> to its another call but propagated to outer level
In this case the next outer level is your descriptor implementation. You have
to ensure it doesn't leak the AttrubuteError. Otherwise the
eryksun added the comment:
Did you mark the variable for export in your shell? For example:
$ v=1
$ python -c 'import os;print os.environ.get("v")'
None
$ export v
$ python -c 'import os;print os.environ.get("v"
eryksun added the comment:
A gdb backtrace may be of more help than strace.
--
___
Python tracker
<http://bugs.python.org/issue24958>
___
___
Python-bugs-list m
eryksun added the comment:
Maybe the problem is using escape characters (0x1b) instead of \e. Try using
the following:
"\e[5~": history-search-backward
FWIW, your inputrc doesn't crash my system (64-bit Linux, readline 6.3 and
Python 3.4).
------
eryksun added the comment:
> If you dropped the isatty() check for stdout in Linux, you may
> end up with the output of Readline in the file (assuming
> Readline is okay with this). The file would include all the
> cursor positioning codes, backspaces, etc, that Readline
> g
eryksun added the comment:
FYI, the size of the terminal associated with the C's stdout isn't related to
the IDLE shell. For example, in Linux when I run IDLE from the GUI, the
associated terminal size is 0x0.
On Windows, os.get_terminal_size uses the console API
GetConsoleScreen
eryksun added the comment:
Here's the rationale given for ignoring SHELL in POSIX system():
One reviewer suggested that an implementation of system() might
want to use an environment variable such as SHELL to determine
which command interpreter to use. The supposed implement
eryksun added the comment:
I expect Popen's shell=True option to use the same shell as os.system. The
POSIX spec for the [system function][1] requires running sh, as follows:
execl(, "sh", "-c", command, (char *)0);
glibc uses "/bin/sh" for the shell pa
eryksun added the comment:
The 3.5 build uses MSVC 14 (VS 2015):
https://docs.python.org/3.5/using/windows.html#compiling-python-on-windows
https://hg.python.org/cpython/file/3.5/PCbuild/readme.txt
--
nosy: +eryksun
___
Python tracker
<h
eryksun added the comment:
> It is not clear why the absence of _setmode(fd, os.O_BINARY)
> is not detected by tests.
It's only a problem when an existing text-mode file descriptor is passed in.
For example, in text mode the CRT handles b'\x1a' as an EOF marker:
Pyt
eryksun added the comment:
Within the standard library, I think only the site module uses the top-level
sysconfig module, which IIRC it uses to set up sys.path.
Note that WINDOWS_SCHEME in distutils.command.install uses "Include". Also for
virtual en
1 - 100 of 293 matches
Mail list logo