Changes by Serhiy Storchaka storch...@gmail.com:
--
nosy: +mark.dickinson, rhettinger
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18297
___
___
Changes by Serhiy Storchaka storch...@gmail.com:
--
title: In range.sample() correct the ValueError message for negative k - In
random.sample() correct the ValueError message for negative k
___
Python tracker rep...@bugs.python.org
Changes by Serhiy Storchaka storch...@gmail.com:
--
components: +Extension Modules
nosy: +nadeem.vawda
stage: - patch review
type: - behavior
versions: +Python 2.7, Python 3.3
___
Python tracker rep...@bugs.python.org
Changes by Serhiy Storchaka storch...@gmail.com:
--
nosy: +loewis
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18296
___
___
Python-bugs-list
Mark Dickinson added the comment:
This has been proposed and rejected before: see issue #17388.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18297
___
Kristján Valur Jónsson added the comment:
ok, I concede that a file-like object makes sense from a polymorphism point of
view. It makes no sense from a streaming point of view. A caller can then
wrap their data into a StringIO instance.
I'll rework the patch in the manner you suggest.
New submission from anatoly techtonik:
---cut test.py---
print(-1-)
open(-2-, w).write(-3-)
---cut test.py---
C:\Python27\pythonw.exe test.py -4-
type -4-
-1-
C:\Python27\pythonw.exe test.py 2 -4-
type -4-
close failed in file object destructor:
sys.excepthook is missing
lost sys.stderr
Changes by anatoly techtonik techto...@gmail.com:
--
components: +Windows
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18298
___
___
Changes by anatoly techtonik techto...@gmail.com:
--
title: pythonw.exe fails with redirected stdett - pythonw.exe fails with
redirected stderr
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18298
anatoly techtonik added the comment:
This subprocess.communicate() call fails with pythonw.exe
--cut testhg.py--
import subprocess
hg = hg
output, _err = subprocess.Popen([hg, 'id', '-nib'],
stdout=subprocess.PIPE).communicate()
open(-hg-, w).write(output)
--cut testhg.py--
anatoly techtonik added the comment:
This was meant to be a separate issue. :/
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18298
___
___
Changes by koobs koobs.free...@gmail.com:
--
nosy: +koobs
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18296
___
___
Python-bugs-list mailing
Amaury Forgeot d'Arc added the comment:
Yes, in pythonw.exe the C stderr is not really usable, and this leads to
unpredictable results.
It's difficult to fix in python2 though; python3 has fixed this issue, but in a
way that cannot be backported.
Some workarounds:
- don't use pythonw.exe in a
R. David Murray added the comment:
It is implemented as a doctest because everything else in that test module is
implemented as a doctest. And clearly this reveals a bug of some sort.
Perhaps the dummy trick needs to be done by doctest itself? (I will need to
read your post over more
STINNER Victor added the comment:
As for the windows failures, my apologies. I knew I would need to check
windows after the commit when I wrote the code, but I forgot to actually do
it.
No problem, it's so easy to forget Windows :-) And we have buildbots
for this task (detect
Oscar Benjamin added the comment:
I'm attaching one more patch check_mno_cywin_py34.patch. This is my
preferred patch for Python 3.4 (default). It fixes building with MinGW
and removes all support for using Cygwin gcc with --compiler=mingw32.
The user would see the following error message:
'''
STINNER Victor added the comment:
Perhaps the dummy trick needs to be done by doctest itself?
The issue really comes from the readline module. The workaround is to set an
environment variable, which affects the whole process (all threads).
Only setting TERM for test_CLI() is fine, because
Antoine Pitrou added the comment:
Agreed, a file-like object is the way to go.
I don't think you need to write the logic in C, by the way. You can write a
high-level function and defer to a low-level C func for the basic API wrapping.
--
stage: patch review - needs patch
Paul added the comment:
You're absolutely right. I tested it on another machine now, with Python 2.7.3
installed and it is actually twice as fast as codecs. Thanks.
So I guess there is little interest in fixing codecs because io is the
preferred package for reading unicode files.
--
Changes by Mark Dickinson dicki...@gmail.com:
--
resolution: - duplicate
status: open - closed
superseder: - Providing invalid value to random.sample can result in
incorrect error message
___
Python tracker rep...@bugs.python.org
Serhiy Storchaka added the comment:
I guess Victor have an interest. ;)
--
versions: +Python 3.3, Python 3.4
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18291
___
Roundup Robot added the comment:
New changeset 8f22e03f5f07 by R David Murray in branch 'default':
#11390: fix test failures due to readline and windows lineneds.
http://hg.python.org/cpython/rev/8f22e03f5f07
--
___
Python tracker
R. David Murray added the comment:
Fixed for this test. It would probably be worthwhile to improve
script_helpers, I'll open a new issue for that.
--
resolution: - fixed
status: open - closed
___
Python tracker rep...@bugs.python.org
STINNER Victor added the comment:
@Serhiy: Oh, thanks for your review. My patch was far from being perfect, a
review was necessary! (I hesitated to commit it directly.)
Here is a new patch using unsigned int is most places, parsing arguments with
I format, and explicit cast to (size_t) to not
STINNER Victor added the comment:
So I guess there is little interest in fixing codecs because io is the
preferred package for reading unicode files.
I guess Victor have an interest. ;)
Ah ah, good joke. I wrote the PEP 400:
http://www.python.org/dev/peps/pep-0400/
And yes, for best
New submission from R. David Murray:
A look at a random selection of tests that use script_helper indicates that
using universal_newlines=True would either simplify or make no difference to
the usage of the script_helper assert_python functions in the majority of the
tests that use it. Even
STINNER Victor added the comment:
Here is a new patch using unsigned int is most places, parsing
arguments with I format, and explicit cast to (size_t) to not
compare unsigned with signed.
Oh oh, it's still wrong. The I parser format does not check for
integer overflow. _PyBytes_Resize() also
New submission from R. David Murray:
See issue 11390 for a discussion, but briefly: there is a bug in the readline
library that causes it, on some systems, to emit a control sequence on stdout
when readline is first initialized and TERM is set to xterm. The bug can be
avoided by setting
Changes by Barry A. Warsaw ba...@python.org:
--
nosy: +barry
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18299
___
___
Python-bugs-list mailing
Changes by R. David Murray rdmur...@bitdance.com:
--
nosy: +r.david.murray
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18293
___
___
Christian Heimes added the comment:
Thanks for the pointer about being able to get the server's DER certificate.
That will be useful. Is there some reason to return DER but not PEM? Or is
this perhaps a bug that could be fixed in a future version of Python's ssl
module?
It doesn't
koobs added the comment:
I recently updated the buildbot host to the latest 9-STABLE sources (changeset
delta is approximately 4-6 weeks)
On a hunch I asked our src committers if there had been any sendfile related
changes and was pointed to 3 changesets that were merged from current (MFC) to
Changes by Christian Heimes li...@cheimes.de:
--
nosy: +christian.heimes
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16487
___
___
Kristján Valur Jónsson added the comment:
Antoine, are you suggesting that we remove the current c-level capability to
use file system files (using open()) and just go with raw bytes data at the C
api level, and then do the 'filename or filelike object' in Python land?
--
Antoine Pitrou added the comment:
Antoine, are you suggesting that we remove the current c-level
capability to use file system files (using open()) and just go with
raw bytes data at the C api level, and then do the 'filename or
filelike object' in Python land?
Yes, I think that's
Éric Araujo added the comment:
Yes.
--
resolution: - fixed
stage: test needed - committed/rejected
status: open - closed
versions: -Python 3.3
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14264
Christian Heimes added the comment:
I didn't know about this issue and have worked on a similar feature in #18138.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16487
___
anatoly techtonik added the comment:
It is not about modifying Python in general, it is about patching pythonw.exe
or subprocess or documenting how to make subprocess calls compatible with
pythonw.exe
don't use pythonw.exe in a console
And how to debug the issue? Maybe the only solution in
Brett Cannon added the comment:
I replied on python-checkins, I'll state here as well: the fix is still off
as warnings.formatwarning is still being replaced.
On Jun 24, 2013 6:20 PM, STINNER Victor rep...@bugs.python.org wrote:
STINNER Victor added the comment:
This issue is *really*
Amaury Forgeot d'Arc added the comment:
The proper solution if you use pythonw.exe is to define sys.stdout/sys.stderr
yourself in pythonw.exe::
sys.stdout = open('c:/temp/output.txt', 'w')
IOW, do the redirect from inside the program, don't rely on the shell which (by
design?) does not
STINNER Victor added the comment:
I replied on python-checkins, I'll state here as well: the fix is still off
as warnings.formatwarning is still being replaced.
My changeset only fixes the unit test (test_idle), it's just to fix
buildbots. As I wrote, it's just a workaround.
--
Changes by Eric Snow ericsnowcurren...@gmail.com:
--
nosy: +eric.snow
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11698
___
___
Python-bugs-list
Changes by Eric Snow ericsnowcurren...@gmail.com:
--
nosy: +eric.snow
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15729
___
___
Python-bugs-list
Changes by Eric Snow ericsnowcurren...@gmail.com:
--
nosy: +eric.snow
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7434
___
___
Python-bugs-list
Zachary Ware added the comment:
Ok, I've managed to cobble together a buildbot setup to test the hang myself
and have come up with a couple possible solutions.
The first is to change the buildbot service on the slaves to allow desktop
interaction. This way, the tests can actually run. If
Antoine Pitrou added the comment:
Ha, funny. Now it's time to reconciliate your respective patches :)
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16487
___
py.user added the comment:
it was rejected by Raymond Hettinger because the proposed message wasn't
informative
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18297
___
Eric Snow added the comment:
A NamedTuple ABC doesn't have to define any API (so that part could wait?)[1].
I see it as most useful for isinstance checks. Here's a solution along those
lines:
class NamedTuple(Sequence):
@classmethod
def __subclasshook__(cls, C):
if cls is
R. David Murray added the comment:
I've had a pep8-ification of this patch sitting on my disk for a while.
Uploading it here so it doesn't get lost. It feels like there is a lot of
redundancy now in the docs. But, it also seems to make sense to provide a wsgi
version of this. So I'm
Eric Snow added the comment:
Would we also want to implement _make().
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1820
___
___
Jeremy Kloth added the comment:
Although the solution for test_ttk_guionly of disabling the gui resource is a
good quick fix, I'm curious as to why there isn't the same issue (test hangs)
when run using 3.3 on the same machine.
Note that by running as a service without desktop interaction
New submission from py.user:
http://docs.python.org/2/library/itertools.html#itertools.chain.from_iterable
class A:
... @classmethod
... def from_iterable(iterables):
... for it in iterables:
... for element in it:
... yield element
...
A.from_iterable(['ABC', 'DEF'])
py.user added the comment:
http://docs.python.org/3/library/itertools.html#itertools.chain.from_iterable
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18301
___
New submission from STINNER Victor:
test.support.import_module() catchs ModuleNotFoundError instead of ImportError
since the following changeset:
changeset: 84106:c4d7228421df
user:Brett Cannon br...@python.org
date:Wed Jun 12 20:12:30 2013 -0400
files:
Mark Shannon added the comment:
I think blaming the crash in test_marshall
http://buildbot.python.org/all/builders/AMD64%20Windows7%20SP1%203.x/builds/2009/steps/test/logs/stdio
on the new macros (change aff41a6421c2) is correct.
It may be the proximate cause, but that doesn't make it the
Roundup Robot added the comment:
New changeset c31bec42e411 by Victor Stinner in branch 'default':
Issue #17206: test.regrtest and test.script_helper enable faulthandler module
http://hg.python.org/cpython/rev/c31bec42e411
--
___
Python tracker
Jeremy Kloth added the comment:
I'm unsure as to how to get a stack trace from Visual Studio, but I can assure
you that the changes introduced by the change aff41a6421c2 *is* the cause of
the failure in test_marshal.
In a nutshell, the overflow happens in a recursion on the
Roundup Robot added the comment:
New changeset 1a9367d5aabc by Victor Stinner in branch 'default':
Issue #17206: Fix test_cmd_line and test_faulthandler for my previous change
http://hg.python.org/cpython/rev/1a9367d5aabc
--
___
Python tracker
STINNER Victor added the comment:
Can we get a full stack trace (for the C stack not the Python one) for the
failure?
Yes, using a debugger on Windows x64. I'm waiting for a renewal of my MSDN
account to get Visual Studio (full version, not the Express version limited to
32-bit).
Until
mpb added the comment:
Christian wrote:
sslsocket gives you access to the peer's cert and chain (with
#18233).
Very interesting (and useful). I've mostly been working with Python
2.7, and I had not fully noticed that Python 3.2+ has a ssl.SSLContext
class.
I'd rather not implement a full
STINNER Victor added the comment:
I enabled faulthandler in subprocesses created by test.regrtest and
test.script_helper...
Oh, it doesn't help for this issue. On Windows, faulthandler is unable to dump
the Python traceback on a stack overflow. On UNIX, it allocates a diffrent
stack for its
R. David Murray added the comment:
It is implemented as a classmethod, but the equivalent code doesn't need to
be part of the class all. I'm not sure what should be done here (say
@staticmethod? Leave the decorator off?). We should probably see what Raymond
thinks. I lean toward the
Zachary Ware added the comment:
Jeremy Kloth added the comment:
Although the solution for test_ttk_guionly of disabling the gui resource is a
good quick fix, I'm curious as to why there isn't the same issue (test hangs)
when run using 3.3 on the same machine.
As it turns out, 3.3(+)'s
Zachary Ware added the comment:
It seems all it took to backport was a copy and paste. Here's the patch.
--
Added file:
http://bugs.python.org/file30703/issue17883-add_is_gui_available.diff
___
Python tracker rep...@bugs.python.org
New submission from miscjunk:
When json.dumps() is called on a numpy.bool_ object, it crashes.
To recreate:
import numpy as np
import json
a = np.array([1,2,3,4,5,6])
a = a 5
json.dumps(a) #crash
json.dumps(a[0]) #crash
json.dumps(a.tolist()) #this works!
Example of error output
Traceback
Jeremy Kloth added the comment:
Here are some results after a detailed investigation:
- in debug, each variable declaration in a block is allocated on the stack
- in debug, r_object() uses 1416 bytes of stack
- in release, r_object() uses 512 bytes of stack
- default stack size is 1MB
- stack
miscjunk added the comment:
numpy.ndarray is also not serializable by json.dumps()
import numpy as np
import json
a = np.array([1,2,3,4])
json.dumps(a) #crash
json.dumps(a[0]) #this works!
--
title: json.dumps() claims numpy.bool_ is not serializable - json.dumps()
claims
Changes by Jesús Cea Avión j...@jcea.es:
--
nosy: +jcea
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18138
___
___
Python-bugs-list mailing list
R. David Murray added the comment:
I would (naively) not expect either of these to be serializable. They are not
base data types, which is all the json module handles unless you add extra
handlers yourself.
'crash' means interpreter crash (segfault), by the way.
--
nosy:
Łukasz Langa added the comment:
There are several reasons why `get*()` methods are redefined on the section
proxy. First of all, explicit is better than implicit. Secondly, the order of
arguments is different: `parser.get()` has the fallback argument as the last
(and keyword-only), whereas
miscjunk added the comment:
Thanks for the explanation. I suppose this should be posted to the numpy
tracker then? Would it be possible for numpy to 'just work' with the json
module? Or will the final resolution be to use a handler (the default=
parameter in json.loads) ?
Thanks
--
Gregory P. Smith added the comment:
I backported the fix to this in the subprocess32 3.2.5rc1 release I made a week
or two ago.
--
resolution: - fixed
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16114
New submission from Bryce Nesbitt:
ElementTree offers a wonderful and easy API for parsing XML... but if there is
a namespace involved it suddenly gets ugly. This is a proposal to fix that.
First an example:
--
!/usr/bin/python
# Demonstrate awkward behavior of namespaces in
Changes by Ethan Furman et...@stoneleaf.us:
--
nosy: +ethan.furman
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18303
___
___
Python-bugs-list
74 matches
Mail list logo