Changes by morris wang :
--
title: os.startfile("") craches Python 2.7, 3.4, 3.5 -> os.startfile("")
craches Python 2.7, 3.4, 3.5 in Windows 7
___
Python tracker
<http://
Huan Wang added the comment:
Hello,
I was confused by the decimal module. The problem is that I want to
from decimal import Decimal, ROUND_HALF_UP
def rounded(number, n):
''' Round the digits after the n_th decimal point by using
decimal module in python.
Huan Wang added the comment:
Hi Mark,
Thank you for your reply.
I went over again the answer from Zachary Ware published on 2015-08-08 09:36. I
got the point that it is better to use string type of number.
>>> from decimal import Decimal, ROUND_HALF_UP
>>> Decimal(&qu
New submission from Zhiming Wang:
Consider
import fileinput
import pathlib
with fileinput.input(files=(pathlib.Path('in.txt'),), inplace=True) as fp:
for line in fp:
print(line, end='')
which results in
Traceback (most recent ca
Changes by Zhiming Wang :
--
pull_requests: +3245
___
Python tracker
<http://bugs.python.org/issue31281>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from Zhiming Wang :
This is a regression in Python 3.7:
$ BROWSER=w3m python3.6 -c 'import sys; import webbrowser;
print(sys.version); print(webbrowser.get()); print(webbrowser._tryorder)'
3.6.7 (default, Nov 24 2018, 09:47:01)
[GCC 4.2.1 Compatible
Change by Zhiming Wang :
--
nosy: +serhiy.storchaka
___
Python tracker
<https://bugs.python.org/issue35308>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Zhiming Wang :
--
keywords: +patch
pull_requests: +9946
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issue35308>
___
___
Py
New submission from Fish Wang :
I come across this issue recently when developing a multi-threaded PySide2 (Qt)
application. When I'm calling .copy() on a WeakValueDictionary, there is a high
chance that my application crashes with the following stack backtrace:
--
Traceback
Fish Wang added the comment:
Thanks for your reply.
I'm preparing a PR. However, I'm not sure how to write a reliable test case to
trigger the crash outside my application. I will submit the PR for now, and see
if anyone on the mailing list has a better idea of what a reliable
Fish Wang added the comment:
Just submitted a PR against the master branch on GitHub.
> This can be apply to 3.8?
I think so.
--
___
Python tracker
<https://bugs.python.org/issu
Fish Wang added the comment:
Just checked weakref.py on different branches, I think this bug exists in
Python 2.7, 3.4, 3.5, and 3.6 as well.
--
___
Python tracker
<https://bugs.python.org/issue35
Change by Zhiming Wang :
--
nosy: +zmwangx
___
Python tracker
<https://bugs.python.org/issue33618>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from wang xuancong :
Python3 programmers have forgotten to convert/implement the socket file
descriptor for IO stream operation. Would you please add it? Thanks!
import socket
s = socket.socket()
s.connect('localhost', 5432)
S = s.makefile()
# on Python2, the follo
New submission from Yibo Wang:
I am writing python wrapper for rust library, everything goes fine until
execution finishes.
"Python quit unexpectedly"
[1]25805 segmentation fault python3
To reproduce, download code from GitHub repo provided by this
blog(https://kushalda
New submission from Fengyang Wang:
Reduced reproduction:
class X:
r = [1, 2, 3]
z = [(i, j) for i in [4, 5] for j in r]
fails with "NameError: name 'r' is not defined". The expected behavior would be
for r to be resolved as the r in the class namespace. Note in co
Fengyang Wang added the comment:
By the way, in Python 2.7 at least, this was working.
--
___
Python tracker
<http://bugs.python.org/issue30577>
___
___
Python-bug
Fengyang Wang added the comment:
It looks like this is a duplicate of http://bugs.python.org/issue11796
Sorry for the noise.
--
resolution: -> duplicate
___
Python tracker
<http://bugs.python.org/issu
Yibo Wang added the comment:
It's a bug from cffi because the interpreter won't crash when using ctypes only
without cffi.
--
resolution: -> not a bug
stage: -> resolved
status: open -> closed
___
Python tracker
<http://bugs
New submission from Xin Wang :
I face the same error with https://bugs.python.org/issue36154, but the solution
is not work for me. So I want to show you my error.
I'm on a Mac running Mojave, version 10.14.3. I installed Python 3.7.2.
I am using vscode. It is work fine in command
New submission from Xianbo Wang :
The urlparse function in Python urllib returns the wrong hostname when parsing
URL crafted by the malicious user. This may be caused by incorrect handling of
IPv6 addresses. The bug could lead to open redirect in web applications which
rely on urlparse to
Ying Wang added the comment:
I would like to take a stab at this as a first-time CPython contributor.
--
nosy: +Ying Wang
___
Python tracker
<https://bugs.python.org/issue36
Ying Wang added the comment:
@rhettinger should this issue be closed if no action is to be taken? If so,
should I manually close the pull request referencing this issue, or will that
be automatically handled by the Python bug tracker
Change by Ying Wang :
--
keywords: +patch
pull_requests: +13279
___
Python tracker
<https://bugs.python.org/issue24564>
___
___
Python-bugs-list mailin
Change by Ying Wang :
--
pull_requests: +13280
___
Python tracker
<https://bugs.python.org/issue36850>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from Zhiming Wang :
Python 2.7 could be significantly slower (5x in some cases) when compiled with
clang 3.x or 4.x, compared to clang 5.x. This is quite a problem on macOS,
since the latest clang from Apple (which comes with Xcode 9.2) is based on LLVM
4.x. This issue was
Zhiming Wang added the comment:
My benchmarks above do contain py37 (master) stats.
--
___
Python tracker
<https://bugs.python.org/issue32616>
___
___
Python-bug
Zhiming Wang added the comment:
Turns out python 2.7.10 doesn't suffer from the performance issue even when
compiled with stock clang 4.x, and upon further investigation, I tracked down
the commit that introduced the regression:
commit 2c992a0788536087bfd78da8f2c62b30a461d7e2
A
Zhiming Wang added the comment:
Yeah, Apple LLVM versions are a major headache. I resorted to feature
detection, using C++ coroutines support as the clang 5 distinguisher[1]:
$ cat /tmp/test/stub.cc
#include
int main() {
return 0;
}
$
/Applications/Xcode.app/Contents/Developer
Dawei Wang added the comment:
This is important since for aws lambda the package can change every time.
--
nosy: +Dawei Wang
___
Python tracker
<https://bugs.python.org/issue29
New submission from Judy Wang :
According to https://docs.python.org/3/library/datetime.html, %f is zero-padded
on the left. But actual Python 3 behavior is puts the zero padding on the right.
--
files: Bug description.py
messages: 315873
nosy: jujuwoman
priority: normal
severity
New submission from Zhiming Wang :
Currently (up to 3.7.0a1) archives generated by the zipapp module are
uncompressed, which are unnecessarily large for large projects. It's easy to
add deflate compression support, and Python loads compressed archives just fine.
I already have a
Change by Zhiming Wang :
--
keywords: +patch
pull_requests: +3803
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issue31638>
___
___
Py
Change by Roger Wang :
--
nosy: +rogerwang
___
Python tracker
<https://bugs.python.org/issue31639>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from Edward Wang :
Methods defined in Enums behave 'normally' but classes defined in Enums get
mistaken for regular values and can't be used as classes out of the box.
```python
class Outer(Enum):
a = 1
b = 2
class Inner(Enum):
foo = 10
Change by Edward Wang :
--
keywords: +patch
pull_requests: +7557
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issue33976>
___
___
Py
Edward Wang added the comment:
Ethan - thank you for your speedy response!
For an example you can see
https://github.com/ucb-bar/hammer/blob/97021bc7e1c819747f8b8b6d4b8c76cdc6a488e3/src/hammer-vlsi/hammer_vlsi_impl.py#L195
- the ObstructionType enum is really only used inside
New submission from Zhiming Wang :
Documentation for PSL module email.utils is named email.util.rst. See
<https://docs.python.org/3/library/email.util.html>.
This seems to violate the principle of least surprise. (I have a command line
tool to open documentation for any PSL module,
Change by Zhiming Wang :
--
keywords: +patch
pull_requests: +9362
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issue35035>
___
___
Py
Runping Wang added the comment:
We're also depending on this MIME type for WebAssembly. It will be great if we
can get this wasm MIME type in.
--
nosy: +runpiw
___
Python tracker
<https://bugs.python.org/is
Chenguang Wang added the comment:
I found this problem is still not fixed in the lastest hg version. Seriously?
This patch is for the latest v3.4.0a0.
--
keywords: +patch
nosy: +Chenguang.Wang
Added file: http://bugs.python.org/file28915/w.patch
New submission from Ye Wang:
According to RFC4217 (Securing FTP with TLS, aka the FTPS spec),
http://tools.ietf.org/html/rfc4217.html#section-10.2
" It is reasonable for the server to insist that the data connection
uses a TLS cached session. This might be a cache of a previous
New submission from wang xuancong:
Hi python developers,
I notice that one major change in python 3 is that you make 'print' as a
standard function, and it will require typing (). As you know, reading from and
writing to IO is a high frequency operation. By entropy coding theorem, y
New submission from bono wang:
when i was upgrade from py 2.6 to py 3.3
the error is show up
# make && make install
gcc -pthread -c -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes-I.
-I./Include-DPy_BUILD_CORE -o Modules/python.o ./Modules/python.c
gcc -pthread -c -DN
bono wang added the comment:
Usually, you can workaround GCC bugs by disabling optimizations. You can try to
modify Makefile to replace "-O3" with "-O2" or even "-O0" (disable all
optimizations), and then try to run "make" again.
donethanks a lot
New submission from Zhigang Wang :
The current subprocess.Popen() has a boolean close_fds parameter, which
cannot satisfy all the requirements. Eg. want to pass specific fd to
child process, but close others.
This patch adds a extra parameter pass_fds to subprocess.Popen's
__init__().
Zhigang Wang added the comment:
Thanks Robert for pointing out issue553171.
After read that issue, I still think we paid too much to make shelf less
surprising.
We should at lease provide a option for the *smart* programmers to get
better speed and less exceptions.
The write-back-all-cache
New submission from WANG Lu :
Python version: 2.6.4 r264:75706 (ubuntu 9.10)
I'm working on zlib, and have been busy in finding a way of specify the
window size of compression.
After wasting minutes in python online doc, I google and find the way:
zlib.compressobj(level, method, window
WANG Lu added the comment:
Oh I found this is mentioned in
msg94409(http://bugs.python.org/issue7191#msg94409)
--
___
Python tracker
<http://bugs.python.org/issue7
New submission from Ke Wang :
Under Solaris, find_library can not give the correct path.
Solaris does not have /sbin/ldconfig, so _findLib_gcc is used.
def _findLib_gcc(name):
expr = r'[^\(\)\s]*lib%s\.[^\(\)\s]*' % re.escape(name)
fdout, ccout = tempfi
Ke Wang added the comment:
I tested the command 'gcc -Wl,-t' on Ubuntu, it works fine.
But on Solaris, it doesn't work as expected.
Finally I find that gcc does not use GNU ld on Solaris, instead, it uses
SUN ld.
___
Python tracker
<http
Ke Wang added the comment:
On Solaris, we can use crle to find system library path.
Attached a patch to get find_library work with Solaris.
--
keywords: +patch
Added file: http://bugs.python.org/file13129/util.diff
___
Python tracker
<h
Ke Wang added the comment:
Above patch failed in a TabError.
Attached a new one.
Added file: http://bugs.python.org/file13133/util.diff
___
Python tracker
<http://bugs.python.org/issue5
New submission from Zhigang Wang :
shelf without writeback=True is too slow, while shelves with
writeback=True takes too much time to close. And even worse, these codes
can not run:
$ cat test_shelve.py
#!/usr/bin/env python
import shelve
store = shelve.open("/tmp/shelve.db", writ
Zhigang Wang added the comment:
Add some errata of the patch: add the new class to __all__.
--
Added file: http://bugs.python.org/file13318/fast_shelf-v2.patch
___
Python tracker
<http://bugs.python.org/issue5
New submission from Wang Chun :
uuid.uuid1() currently uses two different ways to generate a uuid. If
the system call "uuid_generate_time" is available, uuid1() uses the
system call via the ctypes interface, otherwise, it uses pure Python
code to generate a uuid. The problem
Wang Chun added the comment:
This is my test on another faster machine.
$ cat test.py
import sys, time, uuid
N = int(sys.argv[1])
t = time.time()
for x in xrange(N):
uuid.uuid1()
print('%.3f microseconds' % ((time.time() - t) * 100.0 / N))
$ cat test.c
#include
#include
New submission from Wang Chun :
PEP-0372 and Issue 5381 both say json.dumps respect OrderedDict's
iteration order, but the example in them do not work on my latest trunk
build.
$ uname -a
Linux 12.38 2.6.18-128.el5 #1 SMP Wed Dec 17 11:41:38 EST 2008 x86_64
x86_64 x86_64 GNU/
New submission from Funda Wang :
gcc -pthread -Wl,--as-needed -Wl,--no-undefined -Wl,-z,relro -lstdc++ -
Xlinker -export-dynamic -o python \
Modules/python.o \
-L. -lpython2.6 -lpthread -ldl -lutil -lm
build
Funda Wang added the comment:
Regarding python binary target, the actual command when linking is:
gcc -pthread -Wl,--as-needed -Wl,--no-undefined -Wl,-z,relro -lstdc++ -
Xlinker -export-dynamic -o python \
Modules/python.o \
-LL. -lpython2.6 -lpthread -ldl -lutil -lm
The linking order is
Funda Wang added the comment:
How is this issue going?
--
___
Python tracker
<http://bugs.python.org/issue6237>
___
___
Python-bugs-list mailing list
Unsubscribe:
Mingye Wang added the comment:
Windows cp950's EUDC<->PUA mapping is not specific to HKSCS.
--
title: No HKSCS support in Windows cp950 -> No EUDC (HKSCS) support in Windows
cp950
___
Python tracker
<http://bugs.pyth
Changes by Mingye Wang :
--
versions: -Python 3.3, Python 3.4
___
Python tracker
<http://bugs.python.org/issue28343>
___
___
Python-bugs-list mailing list
Unsub
New submission from Dingyuan Wang:
We have the sqlite3.set_authorizer function, where the first argument to its
callback is one of the Authorizer Action Codes that the SQLite documentations
defines[1]. However, the constants in the sqlite3 module is not up to date. The
code in _sqlite
New submission from Dingyuan Wang:
When compiling the PyPy default branch [1] on a Debian testing machine with
Python 2.7.13, cpython randomly crashes.
(gdb) bt
#0 update_refs () at ../Modules/gcmodule.c:332
#1 collect.lto_priv () at ../Modules/gcmodule.c:924
#2 0x5562a804 in
New submission from Alex Wang:
PR submitted here: https://github.com/python/cpython/pull/129
--
components: Build
messages: 288535
nosy: awang
priority: normal
severity: normal
status: open
title: --enable-optimizations compiler flag has no effect
type: behavior
versions: Python 2.7
Changes by Alex Wang :
--
pull_requests: +253
___
Python tracker
<http://bugs.python.org/issue29643>
___
___
Python-bugs-list mailing list
Unsubscribe:
Alex Wang added the comment:
At least when I last built Python, configure always said that optimizations
were not enabled regardless of whether I passed in the flag.
>From what it looked like to me, it's because configure uses the $enableval
>variable to store the result of th
New submission from Ellen Wang:
This is only on a PowerPC, specifically a p2020, running Debian 7.0 wheezy,
python 2.7.3.
Calling round() seems to corrupt something (in the floating point state?) that
causes subsequent exponentiation (the ** operator) to be wrong:
Python 2.7.3 (default, Jan
Ellen Wang added the comment:
Here's an example that uses only math library functions and float literals,
presumably with a simpler code path:
Python 2.7.3 (default, Jan 2 2013, 16:38:11)
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "l
Ellen Wang added the comment:
OK. My bad. I should have been tipped off that the program didn't need -lm to
link. Output from C code:
0.135335
1
0.239022
Feel free to close. I'll have to look into this on my own. Thanks
New submission from Dingyuan Wang:
If a script uses tabs for indentation, tokenize.untokenize won't restore
original indentation correctly from the second line of the indentation level,
and thus breaks the file.
This affects all Python versions.
Test code:
python2 -c 'import sys
Dingyuan Wang added the comment:
Sorry for the inconvenience. I failed to find this old bug.
I think there is another problem. The docs of `untokenize` said "The iterable
must return sequences with **at least** two elements, the token type and the
token string. Any additional seq
Dingyuan Wang added the comment:
The new patch should now pass all tests correctly.
The main idea is:
* if the token is INDENT, push it on the `indents` stack and continue
* if a new line starts, AND the position of the first token >= the length of
the last indent level, we assume the ind
Dingyuan Wang added the comment:
I mean the patch only restores tabs in indentation. The reports above should be
corrected.
Tabs between tokens and other race conditions can't be restored exactly
providing the token stream. This won't affect the syntax. I wonder if it's also
New submission from Sean Wang:
I transfered a file from remote Debian host to my local Windows 10 host using
SecureFX.
I found that the file's last modifed date was 1900/1/1,0:00:00 on
Windows.
I tried to serve this file to be downloaded, and it crashed as follows:
Exception hap
Sean Wang added the comment:
upload a sample test file
--
Added file: http://bugs.python.org/file40929/test
___
Python tracker
<http://bugs.python.org/issue25
New submission from Dingyuan Wang:
The _make_zipfile in shutil uses ZIP_DEFLATED compression by default, and the
fix introduced by #24982 adds directory entries. In zipfile.ZipFile.write,
directories is added as 0 file_size, 0 compress_size, regardless of the
compression method. Deflate will
Dingyuan Wang added the comment:
$ mkdir foo; touch foo/a.txt; python3 -c "import shutil;
shutil.make_archive('foo', 'zip', base_dir='foo')"; unzip -t foo.zip
Archive: foo.zip
testing: foo/
error: invalid compresse
Dingyuan Wang added the comment:
My patch for this.
--
keywords: +patch
Added file: http://bugs.python.org/file41039/storedirectory.patch
___
Python tracker
<http://bugs.python.org/issue25
New submission from Jun Wang:
See this simple example:
class A():
def __init__(self, x=None):
self.x = x
@property
def t(self):
return self.x.t
def __getattr__(self, name):
return 'default'
p
Jun Wang added the comment:
I think this is a common problem while using both __getattr__ and
descriptor/property. A descriptor example:
class Descriptor():
def __get__(self, instance, owner=None):
raise AttributeError('Implicitly suppressed')
class A():
Dingyuan Wang added the comment:
Yes, patching zipfile is enough. I wrote a test using `unzip -t` to check the
zip. ZipFile.testzip can't detect this kind of error because
zlib.decompressobj(-15) will decode b'' to b'' without errors.
--
Added file: http://
Changes by Dingyuan Wang :
--
nosy: +gumblex
___
Python tracker
<http://bugs.python.org/issue23962>
___
___
Python-bugs-list mailing list
Unsubscribe:
Sean Wang added the comment:
This bug still exists in Python 2.7.10 with optparse version 1.5.3.
When the default_value is not ASCII encoded, it would raise
`UnicodeEncodeError: 'ascii' codec can't encode characters`
this error is due to the `str` usage in `expand_default` m
Sean Wang added the comment:
Sorry, missed one condition:
I used `unicode_literals` in Python 2.7.10, example below:
>>> from __future__ import unicode_literals
>>> str('api名称')
Traceback (most recent call last):
File "", line 1, in
UnicodeEncodeError:
Sean Wang added the comment:
when an unicode option.default_value could not be ascii encoded, it would throw
exception, detailed logs below:
File "/Users/seanwang/Documents/dev/foo/bar.py", line 119, in main
parser.print_help()
File
"/usr/local/Cellar/python/2.7.
Mingye Wang added the comment:
> Advice for final user:
This seems something worthy of adding to the codecs doc as a footnote. Perhaps
something like "(deprecated) ... gb2312 is an obsolete encoding from the 1980s.
Use gbk or gb18030 instead." will do.
> libiconv-1.14 is also
Mingye Wang added the comment:
The "join the web people" solution should look like this:
$ diff -Naurp a/_codecs_cn.c b/_codecs_cn.c
--- a/_codecs_cn.c2016-10-09 14:24:04.675111500 -0700
+++ b/_codecs_cn.c2016-10-09 14:27:06.600961500 -0700
@@ -128,6 +128,12 @@ E
New submission from Mingye Wang:
Python's cp950 implementation lacks support for HKSCS ('big5hkscs'). This
support, which maps HKSCS Big5-EUDC code points to Unicode PUA code points
algorithmically, is found in Windows Vista+ as well as an update for XP.
An experiment session
Mingye Wang added the comment:
Just FYI, cp950 0xC6A1 (\uf6b1) is found in current WindowsBestFit:
ftp://ftp.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WindowsBestFit/bestfit950.txt
--
nosy: +Artoria2e5
___
Python tracker
<http://bugs.python.
Mingye Wang added the comment:
Also, go to
ftp://ftp.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WindowsBestFit/bestfit936.txt
for MS reference.
--
___
Python tracker
<http://bugs.python.org/issue28
New submission from Alex Wang:
- Python Version
Python 3.5.2
- Issue
I found that the c_wchar_p and c_char_p return results behaves different from
what it is based on ctypes doc. From the ctypes doc of Python 3.5:
>>> c_wchar_p("Hello, World")
c_wchar_p('Hello, World
Alex Wang added the comment:
Hi Eryk,
Thanks a lot for quick reply~
This is about the bug I filed: http://bugs.python.org/issue28698#
I may still need your help to have a look the original case when I caught
this issue:
I am writing some test automation which call C DLL from Python, the C
New submission from Mingye Wang:
Mappings for 0x81 and 0x8D in multiple Windows code pages diverge from what
Windows does. Attached is a script that tests for this behavior. (These two
bytes are not necessary the only problems, but for sure they are the most
widespread and famous ones. Again
Changes by Mingye Wang :
Added file: http://bugs.python.org/file45498/windows10_14959.txt
___
Python tracker
<http://bugs.python.org/issue28712>
___
___
Python-bugs-list m
Mingye Wang added the comment:
> Python 3.4.3 on Cygwin also fails ``b'\x81\x8d'.encode('cp1252')``.
... but since Cygwin packagers did not enable Win32 APIs for their build, I
cannot test the script directly.
--
__
Mingye Wang added the comment:
Ugh... This is weird. Attached is a correct version use Python 3.6's 'code
page' methods. I have modified the script a little to make sure it runs on Py3.
--
Added file: http://bugs.python.org/file45501/win10
Changes by Mingye Wang :
Added file: http://bugs.python.org/file45502/pycp.py
___
Python tracker
<http://bugs.python.org/issue28712>
___
___
Python-bugs-list mailin
Changes by Mingye Wang :
Removed file: http://bugs.python.org/file45497/pycp.py
___
Python tracker
<http://bugs.python.org/issue28712>
___
___
Python-bugs-list mailin
101 - 200 of 217 matches
Mail list logo