Phillip M. Feldman added the comment:
I'd forgotten about ''.join; this is a good solution. I withdraw my
comment.
On Mon, Sep 7, 2020 at 3:25 PM Steven D'Aprano
wrote:
>
> Steven D'Aprano added the comment:
>
> Marco, sum should be as fast as pos
New submission from Phillip M. Feldman :
I'm not sure whether this is a bug or a feature request, but it seems as though
the following should produce the same result:
In [1]: 'a' + 'b' + 'c'
Out[1]: 'abc'
In [2]: sum(('a', 'b',
New submission from Phillip Mackintosh :
I'm looking for the equivalent windows functionality to the posix `/dev/null`
file, and I discovered `NUL:`
This snippet works on a windows OS, proving that it is indeed a writable file:
`Path('NUL:').write_text('abcd
Change by Phillip Schanely :
--
nosy: +pschanely
___
Python tracker
<https://bugs.python.org/issue16397>
___
___
Python-bugs-list mailing list
Unsubscribe:
Phillip Middleton added the comment:
I have the same issue installing v3.7.3 on RHEL6.8. The standard version came
with openssl v1.0.1c, which would not configure. I installed openssl 1.0.2s in
/usr/local and created a file /etc/profile.d/openssl.sh adding the following
lines:
# /etc
Phillip M. Feldman added the comment:
'Should include "_ssl" somewhere in the message?' Exactly so. If a given
import statement imports 30 items, it would be helpful to know which one
caused the hickup. Thanks!
On Wed, Mar 13, 2019 at 12:28 PM Steve Dower wrote:
&g
Phillip M. Feldman added the comment:
Hello Steve,
I'm buying only 50 percent of this. The Python interpreter must know what
module it was trying to import, and can at least be able to report that.
Phillip
On Tue, Mar 12, 2019 at 8:42 AM Steve Dower wrote:
>
> Steve Dower
New submission from Phillip M. Feldman :
I have a module that contains an import statement that imports a large number
of items. This import was failing with the following error message:
ImportError: DLL load failed: The specified module could not be found.
The message would be so much more
Phillip M. Feldman added the comment:
My apologies for the tone of my remark. I am grateful to you and others
who donate their time to develop the code.
I'm attaching the wrapper code that I created to work around the problem.
Phillip
def expander(paths='./*'):
"&qu
Phillip M. Feldman added the comment:
It appears that the `importlib` package has the same issue: One can't
provide an iterator for the path. When searching a large folder tree for
an item that is likely to be found early in the search process (i.e., at a
high level in the folder tree)
New submission from Phillip M. Feldman :
`imp.find_module` goes down in flames if one tries to pass an iterator rather
than a list of folders. Firstly, the message that it produces is somewhat
misleading:
RuntimeError: sys.path must be a list of directory names
Secondly, it would be
Phillip M. Feldman added the comment:
That works. Thanks!
I think that this boils down to a documentation issue. The following says
that the default behavior is to line-wrap the help messages. At least to
me, this doesn't imply that whitespace is getting eaten.
RawDescriptionHelpForm
New submission from Phillip M. Feldman :
With `argparse`, I'm providing a triple-quoted string via the `description`
argument of the constructor. When I invoke the script with the -h or --help
argument, all formatting in the triple-quoted string is lost, i.e., all
paragraphs ar
Phillip added the comment:
I could definitely understand that. After all, if it's slightly askew (or
strikes some as such) it forces critical thinking, which is good. I didn't
think calling run() was indicative of the three likely pathways to handle
the client socket in the following
New submission from Phillip :
Very small, but,
https://docs.python.org/2/howto/sockets.html
https://docs.python.org/3/howto/sockets.html
have :
while True:
# accept connections from outside
(clientsocket, address) = serversocket.accept()
# now do something with the clientsocket
Phillip J. Eby added the comment:
All that being said, I took out some time to get actual numbers, and
found my original guesstimate of overhead was incorrect; it's only 3
times slower, not "orders of magnitude". ;-)
And even on a relatively old machine, that 3 times slower amou
Phillip J. Eby added the comment:
Antoine Pitrou added the comment:
> -1. Exposing a function allows to modify the underlying implementation
> without breaking any API.
This doesn't make any sense. Once you've exposed an API that gives
out a value for this, you can't chan
Phillip J. Eby added the comment:
Please expose this as an attribute of the class or module, not as a function.
A function is orders of magnitude slower than attribute access, and the entire
point of exposing this is to allow caches to be invalidated.
In order to be useful for cache
Phillip J. Eby added the comment:
It looks like maybe basic2 should be importing basic, not basic2.
Otherwise, you might as well just import basic2 directly and be done
with it. ;-) Likewise, I think indirect should be importing from
indirect2, not from itself? i.e., I'd expect that te
Phillip J. Eby added the comment:
On Sun, Apr 14, 2013 at 3:51 AM, Nick Coghlan wrote:
> Your analysis is one of the pieces that was missing,
Unfortunately, I just noticed it's actually incorrect in a pretty
important part In my original example, I said, "because of the
circulari
Phillip J. Eby added the comment:
I don't care much one way or the other about it being considered a bug
in 2.x, but it might be worth considering a bug in 3.x.
Either way, though, the language reference for "from import" should
reflect the change, and "alternative implem
Phillip J. Eby added the comment:
...and I thought of *one* more way to trigger the changed behavior,
which looks like:
#b.py
from .b import util
import .a
util = util.util
#b/util.py
def util(): pass
(with the other files the same as before).
I'm including it only for completeness&
Phillip J. Eby added the comment:
Actually, after a little reflection, I can see that there are more
complex conditions to analyze, if 'b' doesn't import 'b.util', but
some other module imports b and sets b.util. But that's just freaking
insane and whoever does t
Phillip J. Eby added the comment:
On Fri, Apr 5, 2013 at 9:07 AM, Kristján Valur Jónsson
wrote:
> But I can think of contrived examples where this could break things:
> #a.py:
> from .b import util
>
> #b.py
> from . import a
> from .util import util
>
> Because o
Phillip J. Eby added the comment:
Just a note: the zip files produced by the distutils and friends (sdist,
bdist_dumb, eggs) do not include entries for plain directories. I would guess
that this is also true for wheels at the moment, unless something was
specifically done to work around this
Phillip J. Eby added the comment:
> Wouldn't it be possible to amend PEP ?
Sure... except then it would also be necessary to amend PEP , and also all
WSGI applications already written that assume this, any time in the last nine
years.
This is a known and intended consistent
Phillip J. Eby added the comment:
FYI, this looks like a bug in wsgiref.handlers.BaseHandler.finish_response(),
which should probably be using a try/finally to ensure .close() gets called.
(Which would catch a failed write() to the client.)
I'm kind of amazed this has gone undetected
Phillip J. Eby added the comment:
Per Nick's request that I redirect this here instead of #15295...
(w/already-fixed things deleted):
Hope I'm not too late to the bikeshed painting party; just wanted to chip in
with the suggestion of "self-contained package" for no
Phillip J. Eby added the comment:
Hope I'm not too late to the bikeshed painting party; just wanted to chip in
with the suggestion of "self-contained package" for non-namespace packages.
(i.e., a self-contained package is one that cannot be split across different
sys.path ent
Phillip J. Eby added the comment:
On Sat, Jul 7, 2012 at 2:37 PM, Terry J. Reedy wrote:
> Phillip, this is a trivial wsgiref patch. Do you have any opinion?
>
Nope.
--
___
Python tracker
<http://bugs.python.org/
Phillip J. Eby added the comment:
Just adding a data point: I use the "mingw32" compiler setting with the Cygwin
GCC installation, to compile extensions for standard Windows Python (*not*
Cygwin Python). It would be good if any change doesn't break this scenario --
assuming i
New submission from Phillip Feldman :
The first example below works; the second one produces output containing
garbage characters. (This came up while I was creating a set of examples for a
tutorial on regular expressions).
import re
text= "The cat ate the rat."
print("before
Phillip J. Eby added the comment:
I don't have the code you're talking about in front of me; just wanted to
give you a lead on the likely cause.
--
___
Python tracker
<http://bugs.python.o
Phillip J. Eby added the comment:
The problem might be that you're iterating over more than just the top
level; if you look for submodules then the parent package has to be
imported... and that might make that window load, if there's module-level
code in the package __init__ that
Phillip M. Feldman added the comment:
Hello Steven,
I'm embarrassed to report that I can't reproduce the problem. The
input line is parsed correctly if I enclose the string 'Demo IO' in
double quotes. It is parsed incorrectly if I enclose it in single
quotes, but it loo
New submission from Phillip Feldman :
I tried switching from `optparse` to `argparse`, but ended up reverting back
because `argparse` does not respect double quotes. For example, `optparse`
correctly parses the following, while `argparse` does not:
python myprog.py --ng --INP="De
Phillip M. Feldman added the comment:
I'm beginning to understand the reasoning. This is quite a bit more complex
than I initially thought, and I appreciate the explanations.
Phillip
On Sun, Oct 16, 2011 at 10:53 PM, Raymond Hettinger
wrote:
>
> Raymond Hettinger added the com
Phillip M. Feldman added the comment:
Hello Martin,
This is a fine example of the so-called "is-ought" controversy. The error
message is indeed telling me exactly what the problem is, but the underlying
problem is that this scheme was poorly thought out. Clearly, the stripping
o
Changes by Phillip Feldman :
--
versions: +Python 2.7
___
Python tracker
<http://bugs.python.org/issue13185>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from Phillip Feldman :
When I try to run a Python script that contains curvy quotes inside comments,
the interpreter gets upset:
SyntaxError: Non-ASCII character '\x92' in file ... on line 20198, but no
encoding declared; see http://www.python.org/peps/pep-0263.html f
Phillip Feldman added the comment:
Raymond-
I think that you may have overestimated the complexity of the problem. In
about 5 hours, I coded, debugged, and documented a set of generator functions
to solve the general formulation (including box limits) for three occupancy
problems
Phillip Feldman added the comment:
With the exception of the "empty boxes forbidden" category, I've come across
all of these at one time or another, many in the context of error control
coding (data communications). Much of the early work on occupancy problems was
motivated
Phillip Feldman added the comment:
Ideally, I'd like to see support for all combinations of the following
occupancy problem features:
- Labeled and unlabeled boxes
- Labeled and unlabeled balls
- Empty boxes allowed and empty boxes forbidden
- Boxes with no capacity limits and with cap
Phillip Feldman added the comment:
Mark: I disagree with your claim that "in its basic form, this is covered by
itertools.combinations". If you open the attached text on elementary
combinatorics and go to page 11, you will see a table that lays out six of the
eight most basi
Phillip Feldman added the comment:
"The itertools module should only have a few of the most generally useful,
especially in combination with other tools."
Balls-in-boxes _is_ one of the most basic of the canonical combinatorial
problems. You can verify this by opening a
Phillip M. Feldman added the comment:
Here's an example of a problem from an entirely different domain:
An error control coding scheme can correct up to 3 errors in the header of a
packet and up to one error in the body of a packet. A given message is
divided into four consecutive pa
Phillip M. Feldman added the comment:
Hello Mark,
This is a fair question. Suppose that I have three boxes with capacity
limits of 3, 2, and 1, and that there are three balls in total. Two of the
possible distributions are the following:
2, 0, 1
2, 1, 0
Capacity limits of the individual
New submission from Phillip Feldman :
The current set of combinatorial functions in `itertools` does not include
unlabelled balls in labeled boxes and unlabelled balls in unlabelled boxes. If
the boxes have no capacity limits (i.e., can store an unlimited number of
balls), then the
Phillip J. Eby added the comment:
No, I only consolidated the two copies of the code to a single function, in
order to more easily add the PEP 302 support. The feature was already there.
--
___
Python tracker
<http://bugs.python.org/issue6
Phillip J. Eby added the comment:
That change to the spec is fine, though you might also want to add something
like, "Like all other WSGI specification types", since *all* types specified in
WSGI are 'type()' not 'isinstance()'.
--
Phillip J. Eby added the comment:
Yes, the 'b' is a docs error.
I previously removed this in:
http://hg.python.org/cpython-fullhistory/rev/2697326d4a77
It appears to have been reverted during a merge, here:
http://hg.python.org/cpython-fullhistory/rev/88d04f0143c7
My brows
Phillip J. Eby added the comment:
Just as an FYI, it *is* possible to do generic functions that work with
Python's ABCs (PEAK-Rules supports it for Python 2.6), but it requires caching,
and a way of handling ambiguities. In PEAK-Rules' case, unregistering is
simply ignored, and
Phillip J. Eby added the comment:
> It is not uncommon that developers provide web applications
to the public in which the HTTP response headers are not filtered for
newlines but are controlled by the user.
Really? Which applications, and which response headers?
> Therefore, I sugg
Phillip J. Eby added the comment:
Looks good to me.
--
___
Python tracker
<http://bugs.python.org/issue5800>
___
___
Python-bugs-list mailing list
Unsubscribe:
Phillip J. Eby added the comment:
1. WSGI is a *Python* spec, not a *CPython* spec, so CPython implementation
details have little bearing on how the spec should work.
Most non-CPython implementations have a native string type optimized for their
runtime or VM (i.e. Jython and IronPython
Phillip J. Eby added the comment:
Implicit knowledge in your own head about what might or might not be a good
idea to program is not the same thing as a specification. "type(x) is str" is
a good specification in this context, while "string subclasses, but only if
they'
Phillip J. Eby added the comment:
PyString_AsString() only "works on subclasses" if their internal representation
is the same as type str. So we can't say "subclass of str" without *also*
specifying that the subclass store its contents in exactly the same way
Phillip J. Eby added the comment:
One of the original reasons was to make it easier for server authors writing C
code to interface with WSGI. C APIs that operate on lists and dicts often do
not do what you would expect, when called on a subclass. Essentially, this
could lead to an app that
Phillip J. Eby added the comment:
Doesn't matter how unpythonic it is: the spec calls for exact types and has
done so for six years already, so it's a bit late to do anything about it.
(And any version of Python that allowed string subclasses was in violation of
the spec and there
Phillip J. Eby added the comment:
You say it "would" do this. Have you actually *tested* it?
Looking at the code in wsgiref again, I don't think it does what you think it
does. The '_' substitution is done to keyword arguments for header
*parameters* only; it
Phillip J. Eby added the comment:
I'm still baffled. How does this matter to anything?
The HTTP headers you describe would end up in an HTTP_REMOTE_USER environment
variable, with no impact on REMOTE_USER. REMOTE_USER could only be set by an
actual web server, not via an HTTP header.
Phillip J. Eby added the comment:
I don't understand. HTTP_REMOTE_USER is not the name of a standard CGI
variable - it's REMOTE_USER.
It would help if you could show code for what client/proxy/server combination
has this problem, what happens when that code runs, and what you want
Phillip M. Feldman added the comment:
Why was this removed?
On Mon, Dec 20, 2010 at 8:30 PM, Alexander Belopolsky <
rep...@bugs.python.org> wrote:
>
> Changes by Alexander Belopolsky :
>
>
> Removed file: http://bugs.python.
Phillip M. Feldman added the comment:
I eventually determined that a call to `subprocess.Popen` was responsible
for the message, but could have determined this much more quickly if the
message had included the name of the file that could not be opened
(executed).
Phillip
On Mon, Dec 20, 2010
Phillip J. Eby added the comment:
So, do you have any suggestions for a specific change to the patch?
--
___
Python tracker
<http://bugs.python.org/issue10
New submission from Phillip Feldman :
The error message "OSError: [Errno 2] No such file or directory" would be far
more helpful if it specified the name of the file or directory that cannot be
found.
--
messages: 124108
nosy: Phillip.M.Feldman
priority: normal
severity: nor
Phillip J. Eby added the comment:
The urgency was only that I didn't want the other contributors to this issue to
feel as though the bar on their contributions were being raised higher every
time they jumped the previous bar.
IOW, I did it to make them feel like somebody was doing *some
Phillip J. Eby added the comment:
Whoops, my bad... I misread Eric's earlier message as throwing it back onto
*Daniel* to produce a test, not that *he* (Eric) was working on the test.
IOW, I thought that progress had been stalled a second time on this, and went
ahead to pick up the
Phillip J. Eby added the comment:
Committed Daniel's patch to r86978 in the 2.7 maintenance branch.
(The 2.x trunk still has this bug, but is permanently closed to new checkins.)
--
stage: needs patch -> committed/rejected
versions: -3rd party, Python 3.1, Py
Phillip J. Eby added the comment:
Given that this is a pure bugfix to revert a problem in 2.7 -- where no *new*
development is being done -- a test isn't actually needed for this patch.
There is no point in holding up a distutils1 fix for distutils2's benefit.
Daniel: thanks for
Phillip M. Feldman added the comment:
I would like to unsubscribe from this thread, but haven't been able to
figure out how to do it.
Phillip
On Mon, Nov 22, 2010 at 11:50 PM, Georg Brandl wrote:
>
> Georg Brandl added the comment:
>
> Yes, please do apply. You don
Phillip J. Eby added the comment:
Yes, please consider the type->isinstance part of the change rejected. I just
got done reverting a bunch of those in 3.2. Where WSGI specifies types, it
means "type() is", not "isinstance".
(The 3.x version of wsgiref does not need
Phillip J. Eby added the comment:
It looks to me as though this patch reintroduces issue9199, as it passes
multiple arguments to self.announce() once again. The patch needs to be made
against the SVN version of Python, not the released version
Phillip J. Eby added the comment:
Confirmed - issue10367 is not a dupe. This bug was that a *successful* upload
would crash; issue10367 occurs only in the HTTPError case, and isn't fixed by
this issue's patch. Reclosing this and reopening 10367.
--
stage: commit review -&
Phillip J. Eby added the comment:
Btw, a quick review of the 3.x trunk code for this shows that it does *not*
have this problem; this is specific to 2.7 and AFAICT *only* 2.7.
(This problem was introduced in r73436, btw, as of the move to urllib2 vs.
httplib
Phillip J. Eby added the comment:
To better show what the problem is, here's a change that would fix the problem
(albeit in an ugly way):
--- upload.py 2010-07-07 20:16:33.0 -0400
+++ /home/pje/upload.new2010-11-09 14:30:21.0 -0500
@@ -167,6 +
Phillip J. Eby added the comment:
Committed to Py3K in r86146, with added docs and a larger list of transcodable
CGI variables.
--
___
Python tracker
<http://bugs.python.org/issue10
New submission from Phillip J. Eby :
When showing a server response (--show-response), the upload command crashes
with the following traceback:
Traceback (most recent call last):
File "setup.py", line 94, in
scripts = scripts,
File "/usr/lib/python2.7/distutils/core.py
New submission from Nathan Phillip Brink :
http://docs.python.org/py3k/faq/programming.html#what-does-unicodeerror-ascii-decoding-encoding-error-ordinal-not-in-range-128-mean
When I try to use unicode() from within python3, the call fails. I would
actually expect that the FAQ should contain
Phillip J. Eby added the comment:
Will I be able to do what? I have a kludgy test and a patch in my checkout, I
was just waiting for word back from you (since Feb 19) on whether that would be
ok.
--
___
Python tracker
<http://bugs.python.
Phillip J. Eby added the comment:
What sort of test did you have in mind? To test the desired outcome, it seems
we'd need to poison os.environ, reload wsgiref.handlers, remove the poison, and
then make sure it didn't get in. That seems a bit like overkill (as well as
hard to
Phillip J. Eby added the comment:
ISTM there may be two ways to fix this problem; one was to change the
.exe header produced by bdist_wininst, but in retrospect, it can't fix
this because it's likely Windows' 64-to-32 bit conversion (Wow6432Node)
that's changing the regist
New submission from Phillip M. Feldman :
It appears that there is currently no way to import from a file whose
name contains a hyphen or blank. This makes it difficult to encode a
version number or date in the file name. The solution that I favor
would be to allow the name of the file to be
Phillip M. Feldman added the comment:
As a temporary workaround, you can use the `wrap` function in my strnum
module (http://pypi.python.org/pypi/strnum/2.4).
Phillip
--
nosy: +pfeld...@verizon.net
___
Python tracker
<http://bugs.python.
Phillip Hellewell added the comment:
Please apply the patch ASAP. This bug is affecting downstream product
viewvc in a very adverse way. See
http://viewvc.tigris.org/issues/show_bug.cgi?id=436
It's sad that I spent several hours tracking down this bug only to find
out that henryl fou
Phillip J. Eby added the comment:
I've forwarded the suggested fix to the GAE team; it is to add this line:
os_environ = {} # Handle GAE and other multi-run CGI use cases
to the class body of CGIHandler. This should also be done in the Python
stdlib.
Btw, this fix can al
Phillip J. Eby added the comment:
Hm. In retrospect, CGIHandler should probably just set os_environ to an
empty dictionary in its class body (thereby not using the cached
environ), and this would then work correctly for repeated uses.
This would be a clean bugfix and wouldn't affect beh
Phillip J. Eby added the comment:
This is not an issue with CGI, but an issue with using an inappropriate
WSGI handler for a long-running process environment that only emulates CGI.
That is, in a true CGI environment, there can't be *multiple* requests
made to CGIHandler, and so it can
Phillip M. Feldman added the comment:
Thanks for the response!
I can indeed catch SystemExit, but I would like to be able to take one
action (terminate the program) if the user supplied an unknown option,
and another action (prompt for a new value) if the user supplied a bad
value for an
Phillip M. Feldman added the comment:
The current behavior of optparse is contrary to how most of Python
works. optparse should throw a named exception that can be trapped and
identified by the calling program. Doing a SystemExit is unacceptable.
I can't believe that this is such a hard
Phillip J. Eby added the comment:
FYI, a fix allowing setuptools to work with 2.6.3 is now checked in, and
will be released soon (preferably in a few days, unless new bugs turn
up). If you are experiencing issues with this and would like to try the
fixed version(s), please see the announcement
Phillip J. Eby added the comment:
I appreciate the change being made. The specific code in setuptools is
relying on an erroneous reading of get_ext_filename()'s docstring (which
as of 2.3 at least, implied to me at least that it is always called with
an extension's full dotted name)
Phillip M. Feldman added the comment:
You are right-- the documentation does say this, although it took me a
while to understand what it means. Thanks!
It seems as though there's a flaw in the design here, because there
should be some mechanism for grouping elements of a regular expre
New submission from Phillip M. Feldman :
As per the Python documentation, the following regular expression should
produce a list containing the strings '6.7', 7.33', and '9':
re.findall('(-?\d+[.]\d+)|(-?\d+[.]?)|(-?[.]\d+)', 'asdf6.77.33ff9
New submission from Phillip M. Feldman :
The online documentation describes functions cmath.phase and
cmath.polar, but when I try to import these, I get "cannot import name"
errors.
--
assignee: georg.brandl
components: Documentation
messages: 91330
nosy: georg.bra
Phillip Sitbon added the comment:
Tabified new code and removed one C++-style comment.
--
Added file: http://bugs.python.org/file14114/thread_nt.h.patch
___
Python tracker
<http://bugs.python.org/issue6
Changes by Phillip Sitbon :
Removed file: http://bugs.python.org/file14096/thread_nt.h.patch
___
Python tracker
<http://bugs.python.org/issue6132>
___
___
Python-bug
Phillip Sitbon added the comment:
> I'm not competent to review Windows-specific stuff, but
> some style notes:
> - your indentation is inconsistent with the original file
> (you should use tabs)
> - please don't use any C++-style comments
Thanks- I was only suppl
Changes by Phillip Sitbon :
Added file: http://bugs.python.org/file14097/LockingTest.py
___
Python tracker
<http://bugs.python.org/issue6132>
___
___
Python-bugs-list m
New submission from Phillip Sitbon :
At the suggestion of others on the Python-Dev list, I'm going to outline
what I've been doing with the GIL and where I see possiblity for
improvement.
Discussion:
http://mail.python.org/pipermail/python-dev/2009-May/089746.html
Detail:
Currently
1 - 100 of 131 matches
Mail list logo