New submission from Ezio Melotti:
I think it would be useful to add to the pathlib documentation a table listing
os/os.path operations and their pathlib equivalent.
This will be useful both for people porting their code to pathlib and for
people that already know os/os.path and want to get
Nathaniel Smith added the comment:
I don't see how any of those suggestions help for writing an automated test.
Spawning a shell is irrelevant; the problem is to get a tty, which is much
harder. There only way I can see that might work for an automated test is to use
New submission from Jake Garver:
In compileall.py's main, we verify that the provided destdir (-d) exists at
build time. But destdir will commonly be used to override the build time path
with a runtime path. That runtime path will usually not exist at build time.
Note that this logic was
Matthias Bussonnier added the comment:
Would `pty` even work on CI where the terminal itself might not be a TTY ?
subprocess.Popen(['bash', '-c', '''./python.exe -c import sys;
print(sys.stdin.isatty())'''], stdin=subprocess.PIPE, stderr=subprocess.STDOUT)
False
Otherwise, I can
Benedikt Sauer added the comment:
Actually I think that this may consist of multiple issues:
1. http://bugs.python.org/issue8323 (closed as wont-fix): multiprocessing.Queue
should throw a sensible error if a Queue element can't be unpickled, however
the user managed to create that
2. The
New submission from Benedikt Sauer:
When raising an exception that is unpicklable in a worker process. This used to
be the case for all exceptions that have a non-trivial constructor but this was
fixed by http://bugs.python.org/issue1692335.
I now have the concrete problem with cx_Oracle in
Jan Wagner added the comment:
Yes, hosted at svn.python.org, but without any means of externally filing a
bug report or patch for it other than here on bugs.python.org. Maybe theller
you could include this patch? Change status to closed + third party...?
--
Raymond Hettinger added the comment:
FWIW, I like Felix's original suggestion.
--
nosy: +rhettinger
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24902
___
Robert Collins added the comment:
So - I'm with Victor and Raymond here. I think modifying difflib to provide
external control over the poor-O components would permit many more benefits
than just controlling time: you could wrap them in a timer module to get what
this patch does, you could
Robert Collins added the comment:
So I've two more cases for this that I think we need to ensure works.
Firstly FunctionTestCase should be blacklistable, and its not abstract.
Secondly we're going to want nose, unittest2 etc to be able to also honour
this. I suspect that this is easy and may
New submission from shiva prasanth:
Python 2.7.9 (default, Apr 2 2015, 15:33:21)
[GCC 4.9.2] on linux2
Type help, copyright, credits or license for more information.
(2,)==(2)
False
(2,3,)==(2,3)
True
(2,3)==(2,3,)
True
s=(2,)
s2=(2)
s==s2
False
--
messages: 248880
nosy:
Changes by shiva prasanth kesavarapu.s...@gmail.com:
--
nosy: -shivaprasanth
title: single element tuple 's ending comma is different that without comma -
(2,)!=(2) and (2,3)==(2,3,) why ??? tested in each version
type: - behavior
versions: +Python 3.4
eryksun added the comment:
Refer to section 6.2.3, parenthesized forms:
https://docs.python.org/3/reference/expressions.html#parenthesized-forms
if the list contains at least one comma, it yields a tuple;
otherwise, it yields the single expression that makes up the
expression list.
Robert Collins added the comment:
Thanks for this. I think that a better approach would be the other linked bug -
we can kill many birds with one stone.
--
resolution: - duplicate
status: open - closed
___
Python tracker rep...@bugs.python.org
Terry J. Reedy added the comment:
I just realized that there is a slight but in the patch so far. When a
non-empty program runs, it necessarily executes at least one statement in the
main module. It will only execute anything else when there is a call.
Therefore, the stack trace always
Robert Collins added the comment:
There's a few interacting things here. If I can suggest some design thoughts.
buffering within a test is I think really something we should offer a test
servicing API for. There are many thirdparty ones (e.g. I have one in fixtures)
- but it should be a
Changes by Robert Collins robe...@robertcollins.net:
--
title: Add means to mark unittest.TestCases as do not run. - Add means to
mark unittest.TestCases as do not load.
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14534
Changes by Shiming He heshim...@gmail.com:
--
nosy: +Shiming He
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21423
___
___
Python-bugs-list
Changes by Robert Collins robe...@robertcollins.net:
Removed file: http://bugs.python.org/file36315/01438f18ee18.diff
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14534
___
Robert Collins added the comment:
Removed the bogus huge diff.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14534
___
___
Python-bugs-list
Robert Collins added the comment:
I'm torn on whether this needs a test or not. It would be hard to regress, but
testing this properly really wants hypothesis with a
valid-python-identifier-strategy.
I think on balance we do need one.
So - we need a test in test_discover that mocks the
Robert Collins added the comment:
I'm going to review on rietvald - I see a lot of changes needed - sorry - and
some are a bit bikesheddy. But, if we do them I'll commit it asap and do any
final fixup needed.
--
___
Python tracker
Robert Collins added the comment:
Ok so, design thoughts here.
assertLogs really does two things. Firstly it takes a copy of the logs so it
can do its assertion.
Secondly it disables all other logging, cleaning up noisy tests.
Your specific need only conflicts with the second case.
The way
Terry J. Reedy added the comment:
We should take a look as the stackviewer part of the debugger ui.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24790
___
Robert Collins added the comment:
(for the trivial case of CLI discover without a parameter - so translate that
to the lower level API and then test that)
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23882
Robert Collins added the comment:
reviewed in rietvald, but here too just in case.
The hunk that saves/restores _top_level_dir feels wrong to me - and not part of
this bug, please remove it.
The rest of the patch is fine today.
But it also needs to add two specifically namespace tests:
Changes by Alex Grönholm alex.gronholm+pyt...@nextday.fi:
--
nosy: +alex.gronholm
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24900
___
___
Robert Collins added the comment:
It did that because you did not specify a top level directory. Without that,
the cwd is not on the path and that breaks many environments.
We should probably document it better. The workaround for your needs is to
either just run 'unittest discover', or run
Robert Collins added the comment:
I've put a fairly comprehensive comment into issue22197.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24355
___
Robert Collins added the comment:
@Randy - ok thanks. So, please do improve the prose in the error message,
should be a very straight forward patch.
--
stage: test needed - needs patch
___
Python tracker rep...@bugs.python.org
Mark Roseman added the comment:
Regarding the setting background for the multiple elements.. one possibility is
that the first time in a session they change the background of an element that
was same as the background, we ask if they'd like to apply that change to the
other program elements
Alex Grönholm added the comment:
I've implemented my background-calling code in my framework via
run_in_executor() now, so this has become a non-issue for me. I have no more
interest in this patch.
--
___
Python tracker rep...@bugs.python.org
Eric Snow added the comment:
Hybrid Nathaniel/Brett approach LGTM
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24305
___
___
Python-bugs-list
Russell Keith-Magee added the comment:
What hardware architecture are you compiling for? If it's ARM64, and you're
not using a trunk version of libffi, that segfault in test_ctypes is to be
expected.
Does this mean I can safely ignore the segfault?
Well, safely in the sense that everything
Raymond Hettinger added the comment:
In general, it isn't good design to incorporate timeout logic in computation
logic. What would be better is a general purpose, reusable, decoupled tool:
run_with_time_limit(some_computation, some_args, time_limit). Such a tool
might be based on separate
Changes by Raymond Hettinger raymond.hettin...@gmail.com:
--
nosy: +tim.peters
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24904
___
___
Robert Collins added the comment:
Thank you very much for writing your patch in backwards compatible style - it
will make backporting to unittest2 much easier.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24263
Tim Peters added the comment:
It is really bad that roundtripping current microsecond datetimes doesn't work.
About half of all microsecond-resolution datetimes fail to roundtrip correctly
now. While the limited precision of a C double guarantees roundtripping of
microsecond datetimes far
Nathaniel Smith added the comment:
If pty is going to work at all then it should work regardless of whether the
tests themselves are being run under a tty, yes.
I personally would not want to merge a test based on making isatty lie, because
the point of tests is to increase confidence that
Eric Snow added the comment:
That said...
What's the benefit of it being a decorator? The docstring? Access to
func.__name__? It could just as well be:
class attribute:
_name = None
def __get__(self, instance, owner):
if instance is None:
Cyd Haselton added the comment:
A few questions for Russell:
What hardware architecture are you compiling for? If it's ARM64, and you're
not using a trunk version of libffi, that segfault in test_ctypes is to be
expected.
Does this mean I can safely ignore the segfault?
Are you using the
Emanuel Barry added the comment:
I figured. I guess it makes more sense to do that on a per-library basis. Eric
does have a valid point, and perhaps this addition is not needed :) I realize
now that this isn't really needed, backing off and closing :)
--
John Taylor added the comment:
I am seeing something similar in difflib.HtmlDiff.make_file() under Python
3.4.3 (windows 7). Do I need to file a separate bug report?
File H:\test\test.py, line 522, in print_differ
diff = html.make_file(file1_data,file2_data,dir 1,dir 2,True)
File
Matthias Bussonnier added the comment:
Astonishingly isatty appear to work on windows:
http://bugs.python.org/issue18553
Up to core python for istty().
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24294
R. David Murray added the comment:
Well, it sounds like there may be no way around the fact that people may
already be doing the extra needed quoting escaping internal quotes) and
therefore that this change would break those use cases. (I note that any such
code must be conditional on
Jim Jewett added the comment:
On windows, when python is started from the command line without a GUI,
os.isatty(sys.stdin) raises an error, but os.isatty(sys.stdin.fileno()) returns
true.
Within IDLE, os.isatty(sys.stdin.fileno()) also raises an error, but
os.isatty(0), os.isatty(1), and
R. David Murray added the comment:
That line isn't checking the existence of destdir, but rather of the (single,
because we have only one destdir to use) directory to compile.
What bug are you actually seeing?
--
nosy: +r.david.murray
___
Python
Eric Snow added the comment:
This sort of thread belongs on python-id...@python.org, not on the tracker.
Please post there (feel free to reference this issue; also add a link to the
thread here). TBH, I think there's a larger discussion to be had regarding the
topic of other useful
R. David Murray added the comment:
So you are basically wanting to be able to create read only attributes that
don't have a _ in front of them even internally.
I don't think that's something Python core should add. Read only attributes
should be an exceptional case in most python programs.
R. David Murray added the comment:
*I'm* not suggesting using Popen. That would be a more significant change to
the code, and I don't see a motivation for it. I'm just suggesting using
list2cmdline for the quoting. (If we were rewriting distutils it would be a
different story, but we're
R. David Murray added the comment:
This is a nice idea, but I think it would be better to add it to the message
rather than change the message (and we'd still break some people's programs,
I'm sure):
Serving HTTP on 0.0.0.0 port 8000 (http://0.0.0.0:8000) ...
--
nosy:
Skip Montanaro added the comment:
I'm missing the point too, I think. I don't see class attributes in your
initial Foo class, then your second one as a __new__ method, but references
self. I'm quite confused at this point.
--
nosy: +skip.montanaro
New submission from Felix Kaiser:
http.server: on startup, show host/port as URL
Old:
% python3 -m http.server
Serving HTTP on 0.0.0.0 port 8000 ...
New:
% ./python -m http.server
Serving http://0.0.0.0:8000/ ...
This is useful because (modern) terminals will auto-detect URLs and make
R. David Murray added the comment:
So, given that that does something useful, it appears that the error message
(which is what is in 2.7 as well) is wrong to refer to 'directory argument',
and we should just eliminate the isdir check (and fix the error message).
The patch will need a test.
Jan Hudec added the comment:
Oh, I see I misunderstood Gerhard's last commit.
So now the problem should be only if there is a DML statement followed by DDL
statement and no commit afterwards. Well, that is indeed probably stupid.
--
___
Python
Ted Lemon added the comment:
Hm, okay, that explains it. I was previously mystified. How about this as a
refinement on your proposal, though:
Return the lowest index in the string where substring sub is found within the
string. Optional arguments start and end restrict the search to the
Felix Kaiser added the comment:
I'm not sure - that'd be redundant, and I find it harder to read. It also
breaks for badly configured terminals where (/) are part of the
select-by-word character set (but thats a very minor issue -- users with
parentheses in the set will probably be used to
R. David Murray added the comment:
I do it in a number of test suites (you pass in localhost and port 0, then
parse the output to find out what port got used). I'm sure other people do it
as well. The parens could be dropped. I don't think it is really redundant,
as the two ways of
Steve Dower added the comment:
Maybe a better starting point is to monkey-patch via setuptools? I know it's
nasty, but it'll give us a chance to actually iterate on this before committing
to a distutils change. (IMO the biggest problem with distutils is that it gets
basically no testing
Raymond Hettinger added the comment:
[Ned]
the out-of-date Apple-supplied Tk *might* be in use.
It also happens to me and my students periodically. Our Tk is up-to-date.
--
___
Python tracker rep...@bugs.python.org
Steve Dower added the comment:
FYI - the Tcl and Tk changes have been committed upstream:
http://core.tcl.tk/tcl/tktview/00189c4afcb9e2586301d711f71383e48817a72d
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24847
Eric Snow added the comment:
No worries, Emanuel. Thanks for bringing it up. I'd still be interested to
see what sort discussion ensued if you took this to python-ideas. Starting a
thread on the topic has been on my todo list for a while but other matters
always end up taking precedence.
Jake Garver added the comment:
Thanks for the response and sorry for the mis-read.
In 2.7, I did something like:
python -m compileall -d /runtime/path foo.py
But in 3.4, I get:
-d destdir requires exactly one directory argument
I'm doing this during a build. Then we package the pyc file into
Jan Hudec added the comment:
While I agree that the current behaviour is a bug (this bug), and one that
renders the package unusable for me (I used apsw or different language
instead), I unfortunately have to disagree with Gerhard that the change is not
a problem. It can be.
The implicit
R. David Murray added the comment:
Actually, it looks like it is a bit more potentially complex than that. The
original code would issue the error only if there were more than one argument
and the first one was not a directory. So it would in fact compile more than
one argument as long as
Brett Cannon added the comment:
Could someone do a quick code review of my latest patch? If the design looks
sane I might be able to steal some time tomorrow to start on the C
implementation.
--
___
Python tracker rep...@bugs.python.org
New submission from John Taylor:
SequenceMatcher in the difflib module contain ratio() and quick_ratio() methods
which can take a long time to run with certain input. One example is two
slightly different versions of jquery.min.js.
I have written a patch against python-350b4 that adds a
Chris Hogan added the comment:
Since issue 8972 has been resolved by fixing the broken behavior, I think we
should just use list2cmdline.
We could leave _nt_quote_args alone and replace the call to it in _spawn_nt
with:
cmd = [list2cmdline([arg]) for arg in cmd]
I verified that this
Steve Dower added the comment:
The problem is I can easily find plenty of cases where it won't work.
My biggest concern is that list2cmdline will require already-quoted arguments,
which is going to break anyone who's already worked around distutils failing to
do so (which makes it really
Steve Dower added the comment:
FWIW, the problem in the original post is that '-DMODULE_VERSION=1.0.5' is
not quoted by distutils and the quotes are eaten.
This can be fixed by specifying '-DMODULE_VERSION=\1.0.5\'. There are no
spaces in the argument, so the problem is that cl.exe eats
Matthias Bussonnier added the comment:
Hum, working on the automated test. It is slightly annoying as with subprocess
python is not in a tty, so there will be no change in behavior. I'm not sure
how to proceed.
At a minimum, an interactive test should be written and added to the
Guido van Rossum added the comment:
I don't have that laptop any more. It's likely that the screen resolution
change caused Tcl/Tk to be confused. That's probably a Tcl/Tk bug.
--
___
Python tracker rep...@bugs.python.org
Jim Jewett added the comment:
Instead of using python directly in a subprocess, try calling a shell command
that in turns calls python. (Admittedly, this may look like the pipe
scenario...)
In theory, you could even drive another python interactively, using a GUI
runner, but I'm not sure
Changes by Guido van Rossum gu...@python.org:
--
nosy: -gvanrossum
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24893
___
___
Python-bugs-list
STINNER Victor added the comment:
I'm not sure that it's a good idea to add a timeout to such algorithm. It can
be very surprising to have a difference result depending on the system load
(CPU usage of _other_ applications) and on the CPU performances.
If you really want this result, I would
75 matches
Mail list logo