New submission from Roy:
In the documentation in 15.2 (https://docs.python.org/3/library/hmac.html),
under hmac.new(key, msg=None, digestmod=None), it says "Paramter digestmod",
which should be "Parameter digestmod"
--
messages: 222623
nosy: thosehippos
prior
Roy Smith added the comment:
It's nice to see this is still being worked on after all these years :-)
I'm not actually convinced the proposed fix makes sense. It swaps out one
incorrect behavior for a different incorrect behavior. If it really is more
effort than it's wo
Roy Smith added the comment:
I agree that this is confusing and that what we need is an assertion for the
top-level mock having specific calls in a specific order, and ignores any
intervening extra calls to mocked functions. In other words, a version of
assert_has_calls() which looks at
New submission from Roy Assis :
problem:
---
Python raises exception when piping to head. Exception is not caught by try
except.
code:
#sample.py
import sys
from time import sleep
try:
for line in sys.stdin:
print(line, flush=True)
sleep(2)
except:
print(&q
Roy Assis added the comment:
Resolution in this post:
https://stackoverflow.com/questions/26692284/how-to-prevent-brokenpipeerror-when-doing-a-flush-in-python/26738736
code was changed to:
#sample.py
import sys
from time import sleep
try:
for line in sys.stdin:
print(line
New submission from Roy Smith :
The docs list the arguments in the order:
class argparse.ArgumentParser([description][, epilog][, prog]...
but the code (I'm looking at the 2.7.2 source) lists them as:
class ArgumentParser(_AttributeHolder, _ActionsContainer):
[...]
def __init__
Roy Smith added the comment:
An Nth place is in the docstring:
Keyword Arguments:
- prog -- The name of the program (default: sys.argv[0])
- usage -- A usage
Roy Smith added the comment:
I'm working on a doc patch now...
--
___
Python tracker
<http://bugs.python.org/issue13249>
___
___
Python-bugs-list m
Roy Smith added the comment:
Patch attached. I just deal with putting all the items into the same order,
not terry.reedy's idea for separating them into two groups.
Added a recommendation to only use keywords, which seems sane given the number
of arguments.
--
keywords: +
Roy Smith added the comment:
PS -- this is against the 2.7 branch.
--
___
Python tracker
<http://bugs.python.org/issue13249>
___
___
Python-bugs-list mailin
Roy Smith added the comment:
New patch uploaded.
The added recommendation is around line 161 (look for 'Recommended usage is to
only use keyword arguments')
--
Added file: http://bugs.python.org/file23667/Issue13249-2.patch
___
Pyth
Roy Smith added the comment:
Before I build another patch, would you be OK with leaving it as a note, but
adding the "due to the number of arguments" language? There's a lot of text
here, and people tend to just zoom in on the bits and pieces they need right
now. I think th
Roy Smith added the comment:
Another patch, with the most recent review suggestions incorporated.
--
Added file: http://bugs.python.org/file23703/Issue13249-3.patch
___
Python tracker
<http://bugs.python.org/issue13
New submission from Roy Fox :
Hi,
When you type (not copy-paste!) into an IDLE shell a string literal followed by
(
you get a calltip.
When the string contains a bad unicode escaping you get an error (see example
below), which makes some sense.
But when the string is raw, it isn't tr
New submission from Roy Liu :
When testing urllib.request.urlopen in Python 3, I found that it gave empty
responses for some sites. In other words, reading from the file-like object
gives zero bytes. Python 2.x's urllib2.urlopen did not give this behavior. I
isolated the problem down t
New submission from Roy Smith :
While investigating issue7322, I wrote a test case to demonstrate the issue. I
made a mistake and called settimeout() on the wrong socket, but the result
appears to demonstrate a different bug. When I run the attached
test-issue7322.py on my OSX-10.6.5
Roy Smith added the comment:
I'm looking into this now. In the meantime, I've opened a marginally-related
bug, issue10473
--
nosy: +roysmith
___
Python tracker
<http://bugs.python.
Roy Smith added the comment:
Ataching a test case which demonstrates the bug.
--
Added file: http://bugs.python.org/file19711/test-issue7322.py
___
Python tracker
<http://bugs.python.org/issue7
Roy Smith added the comment:
Thank you for the detailed analysis. That certainly explains what I observed.
Would it make sense for socket.makefile() to check to see if the socket is in
blocking mode (assuming there is some reliable/portable way to perform this
check), and raise some
Roy Smith added the comment:
This is kind of ugly. On the one hand, I'm all for adding a check in
makefile() to catch it being called on a non-blocking socket.
On the other hand, you are correct that a user could change the mode leter.
Even if we added checks for this in socket.setblo
Roy Smith added the comment:
The answer depends on what the socket module is trying to do. Is the goal
simply to provide a pythonic thin wrapper over the underlying OS interfaces
without altering their semantics, or to provide a completely homogeneous
abstraction? Having attempted the
Roy Smith added the comment:
I got into this by starting with Issue7322, which reports a scenario where data
is lost using makefile(). The docs for makefile() say, "The socket must be in
blocking mode (it can not have a timeout)". So, we've got published
documentation wh
Roy Smith added the comment:
Responding to msg122013:
I think he exactly meant to equate the two.
The original problem described in issue882297 is that the makefile()
documentation only stated that the socket could not be in non-blocking mode.
The test case presented didn't appear t
New submission from Roy Smith :
The documentation for the threading.Thread constructor says:
"target is the callable object to be invoked by the run() method. Defaults to
None, meaning nothing is called."
This could be improved by explicitly stating that target is called in a stati
Roy Smith added the comment:
What I meant was whether target should be declared as @staticmethod or not.
--
___
Python tracker
<http://bugs.python.org/issue11
Roy Smith added the comment:
Here's the code I ended up writing:
class Foo():
def __init__(self):
self.thread = Thread(target=Foo.runner, args=[self])
self.thread.start()
@staticmethod
def runner(self):
# blah, blah, blah
It was not immediately clear fro
New submission from Clinton Roy <[EMAIL PROTECTED]>:
This patch adds pkg-config support to the python build, a python.pc file
is installed in the pkgconfig directory such that autoconf buildsystems
can trivially link against the python library.
Diff made against revision
Clinton Roy <[EMAIL PROTECTED]> added the comment:
Thanks for the comments Amaury, this patch uses ${VERSION} throughout so
that it can be applied across branches.
cheers,
Added file: http://bugs.python.org/file11152/pkgconfig.diff
___
Python t
Clinton Roy <[EMAIL PROTECTED]> added the comment:
This version sets Libs.private for static compiles.
Any chance this will make it into the 2.6/3.0 release candidates ?
cheers,
Added file: http://bugs.python.org/file11368/pkgconfig.diff
___
Python t
New submission from Roy Smith <[EMAIL PROTECTED]>:
Unless I'm missing something, the only way to tell if a deque is empty is
to try and pop() something and catch the resulting IndexError. This is
not only awkward, but mutates the data structure when you may not want to.
It should
Roy Smith <[EMAIL PROTECTED]> added the comment:
I just realized my request may have been ambiguous; empty() is a
predicate, not a verb. Doc should be something like:
"""Return true if the deque is empty. Return false otherwise."""
__
Roy Smith <[EMAIL PROTECTED]> added the comment:
Sigh. It looks like you can do what I want after all, by just using the
deque object itself, i.e.:
q = deque()
while (q):
...
This should be changed to a docs bug -- the doc page for deque should
mention this, or include an example o
Roy Smith <[EMAIL PROTECTED]> added the comment:
In retrospect, it's obvious that "while mydeque" is indeed the way to
process the queue, yet, when I was reading the docs, I didn't come away
with that.
The statement, "list objects support similar operations&qu
New submission from Roy Smith <[EMAIL PROTECTED]>:
The third argument, places, is optional, but no indication is given what
value is used if it is omitted.
--
assignee: georg.brandl
components: Documentation
messages: 73447
nosy: georg.brandl, roysmith
severity: normal
status
Roy Smith <[EMAIL PROTECTED]> added the comment:
I think you're missing the point. Imagine you are somebody who doesn't know
Python internals. You're looking at the doc page for deque and ask yourself
the question, "How do I tell if one of these is empty?".
New submission from Roy Smith:
At http://docs.python.org/lib/thread-objects.html, under join(), it says:
"As join() always returns None, you must call isAlive() to decide whether a
timeout
happened."
This would be better if it were more explicit, i.e.
"As join() always re
New submission from Roy Smith <[EMAIL PROTECTED]>:
http://docs.python.org/lib/node528.html (17.1.1 Using the subprocess
Module) describes the "env" parameter thusly:
If env is not None, it defines the environment variables for the new
process.
This is too vague to be usef
New submission from Roy Smith <[EMAIL PROTECTED]>:
Note: this is (sort of) related to Issue2633.
http://docs.python.org/lib/os-process.html (14.1.5 Process Management).
The docs for os.execvpe() say, "the env parameter must be a mapping which
is used to define the environment va
New submission from Roy Smith <[EMAIL PROTECTED]>:
The current doc says, "Copy the contents of the file named src to a file
named dst". Anybody used to the unix shell "cp" command would assume that
dst could be a directory, in which case the true destination is a fi
Roy Smith <[EMAIL PROTECTED]> added the comment:
Reading closer, I see that copy() has the shell-like semantics I was
expecting copyfile() to have. Perhaps the right fix is to include a note in
the copyfile() docs saying, "dst must be a file path; see also copy() for a
version w
New submission from Roy Smith <[EMAIL PROTECTED]>:
If you pass csv.reader() a filename as its first argument:
csv.reader('filename')
instead of a file object like you're supposed to, you don't get an error.
You instead get a reader object which returns the cha
New submission from Roy Smith <[EMAIL PROTECTED]>:
The docs say:
Return a string containing the hostname of the machine where the Python
interpreter is currently executing. If you want to know the current
machine's IP address, you may want to use gethostbyname(gethostname()).
Thi
New submission from Roy Smith <[EMAIL PROTECTED]>:
It would be useful if ctypes included limiting constants for the various
fixed-size integers, i.e. MAX_INT_32, MIN_INT_32, etc.
Maybe it does and I just missed just didn't see it in the docs?
--
assignee: theller
compone
New submission from Roy Smith :
It would be nice if Queue.Queue included a way to access the high-water
mark, i.e. the largest value which qsize() has ever reached. This is
often useful when assessing application performance.
I am assuming this is cheap, i.e. O(1), to provide
Roy Smith added the comment:
I'm suppose you could implement this in a subclass, but it would be
inefficient. You'd have to over-ride put() and get(), call qsize(),
then delegate to Base.put() and Base.get().
A cleaner solution would be in the C implementation of deque,
Roy Smith added the comment:
I'm not actually sure what the use case is for clear(). It's easy
enough to just create a new deque. If you can do that, why do you need
clear()? Since I don't ever see a reason anybody would want to call
clear(), I'm not 100% if it should
Roy Smith added the comment:
And, FWIW, I did figure out a use case for clear(). I create a queue and
pass it to two threads. One side or the other decides to abandon processing
of the events currently in the queue. I can't just create a new queue,
because you have no way to tel
Clinton Roy added the comment:
Is there anything I can do to move this forward at all?
cheers,
___
Python tracker
<http://bugs.python.org/issue3585>
___
___
Python-bug
Roy Wood added the comment:
This patch would be very useful to me, so I'm sad to see it's been
languishing for so long. :-(
Is there any way to encourage the maintainer to merge this into the
current branch?
--
nosy: +rrwood
___
Pyth
Roy Wood added the comment:
Thanks! :-)
On Wed, Feb 11, 2009 at 9:28 PM, Daniel Diniz wrote:
>
> Daniel Diniz added the comment:
>
> @Roy: we can try :)
>
> Patch updated, tests pass. However, keeping the default output and
> adding an option to prettyprint should keep
New submission from Roy Smith :
In https://docs.python.org/3.5/reference/import.html#importsystem, section "5.2
Packages", second sentence, the word "naming" is broken across two lines.
In 3.7.5rc1 as well. Didn't check any others.
--
assignee: docs@python
Roy Smith added the comment:
Yeah, that's weird. Looks like this may be a Chrome bug. I'm seeing it in
Chrome (Version 77.0.3865.90 (Official Build) (64-bit)), but not Safari. This
is on MacOS (High Sierra).
In the attached screenshot, I narrowed the window a bit. In
New submission from Roy Smith :
See https://docs.python.org/3.7/library/bz2.html
For bz2.open(), the section header says:
bz2.open(filename, mode='r' ...)
but the text says:
The mode argument ... The default is 'rb'.
As I understand it, 'r' and 'rb'
Change by Roy Smith :
--
nosy: +roysmith
___
Python tracker
<https://bugs.python.org/issue24258>
___
___
Python-bugs-list mailing list
Unsubscribe:
Roy Smith added the comment:
The https://bitbucket.org/cliff/cpython#python24258 URL 404's
Looking at the attached bz2.py diff, I would change:
if isinstance(filename, (str, bytes, os.PathLike)):
self._fp = _builtin_open(filename, mode)
+self.fil
New submission from Roy Smith :
At https://docs.python.org/3.9/library/unittest.mock.html#unittest.mock.Mock,
it says:
unsafe: By default if any attribute starts with assert or assret will raise an
AttributeError.
That's not an English sentence. I think what was intended was, "
Roy Smith added the comment:
Just for the archives:
https://bugs.chromium.org/p/chromium/issues/detail?id=1022011
--
___
Python tracker
<https://bugs.python.org/issue38
Roy Smith added the comment:
I just got bit by this in Python 3.5.3.
I get why it does this. I also get why it's impractical to change the behavior
now. But, it really isn't the obvious behavior, so it should be documented at
https://docs.python.org/3.5/library/argparse.html
Roy Smith added the comment:
Just as another edge case, type() can do the same thing:
Foo = type("Foo", (object,), {"a b": 1})
f = Foo()
for example, will create a class attribute named "a b". Maybe this actually
calls setattr() under the covers, but if i
New submission from Roy Wellington :
The documentation for os.rename (e.g., here,
https://docs.python.org/3/library/os.html#os.rename but also for 3.8 and 3.9)
currently reads,
> On Unix, if src is a file and dst is a directory or vice-versa, anq:q
> IsADirectoryErro
New submission from Roy Williams:
```
from fileinput import FileInput
from pathlib import Path
p = Path('.')
FileInput(p)
```
Results in:
Traceback (most recent call last):
File "", line 1, in
File
"/usr/local/Cellar/python3/3.6.0/Frameworks/Python.framework/V
Changes by Roy Williams :
--
pull_requests: +1822
___
Python tracker
<http://bugs.python.org/issue30432>
___
___
Python-bugs-list mailing list
Unsubscribe:
Roy Williams added the comment:
@arp11 sorry for the too-minimal repro :D - the issue is with FileInput
attempting to cast `files` to a tuple. Instead, if passed a PathLike object
FileInput should set `files` to a tuple just as it does with a str
New submission from Roy Williams:
import re
re.compile(br'^(.*?)$(?m)')
--
components: Regular Expressions
messages: 295473
nosy: Roy Williams, ezio.melotti, mrabarnett
priority: normal
severity: normal
status: open
title: re.compile fails when compiling bytes under `-bb` mod
Roy Williams added the comment:
Repro:
```
import re
re.compile(br'^(.*?)$(?m)')
```
Results in
```
Traceback (most recent call last):
File "test_compile.py", line 2, in
re.compile(br'^(.*?)$(?m)')
File "/usr/lib/python3.6/re.py", line 233
Changes by Roy Williams :
--
pull_requests: +2081
___
Python tracker
<http://bugs.python.org/issue30605>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from Roy Williams :
Repro:
```python
from pathlib import Path
import subprocess
subprocess.run([Path('/bin/ls')]) # Works Fine
subprocess.run(Path('/bin/ls')) # Fails
```
The problem seems to originate from here:
https://github.com/python/cpython/blob/mast
Roy Williams added the comment:
Ignore my comment re: pathlib, it looks like PathLike is defined in `os` and
not `pathlib`.
--
___
Python tracker
<https://bugs.python.org/issue31
New submission from Roy Belio :
Following issue 18259 which was solved by extern sethostname I managed to build
python 3.7 on solaris only after patching away the ifdef for _AIX.
We need to add SOLARIS flag and check for that also in the same line of
#ifdef _AIX.
This error only appears in
Roy Belio added the comment:
Also happens on suse 11 x86_64 with python 3.7
Same issue exactly building locally (but with cross compiling flag for system
independency)
Building our own libffi 3.2.1 and adding it in the CPPFLAGS includes.
--
nosy: +rbelio
Roy Belio added the comment:
Sure, I'll attach it. one more thing to mention is that during configure it
printed: configure: WARNING: --with(out)-system-ffi is ignored on this platform
We are also providing all the dependency libraries ourselves (building,
linking, h files and what no
Roy Belio added the comment:
as seen in the config.log:
LIBFFI_INCLUDEDIR='/root/rc3/dist/lib/libffi-3.2.1/include'
I'm attaching the config.log just in case
--
Added file: https://bugs.python.org/file47729/config.log
___
Python
New submission from nilanjan roy :
As xml package make the availability of separate global name-space by *__all__*
so considerably *etree* should have included of all the parser files in its
initialize(i.e. in *__init__.py*).
So if any script consider as "from xml import *" t
nilanjan roy added the comment:
@scoder: *xml* package organization have little confusion
1. Current xml have exposed all the sub-packages from *__all__* scope from the
initializer - so there are possibilities to write code from script
a. *import xml as x* or *import xml.somepackage as x
nilanjan roy added the comment:
@serhiy.storchaka:
If I concur with your comment then probably declaration of *__all__** over xml
initializer(__init__) is little contradictory - because whenever we declare
__all__ to enable global-scope means API provides the flexibility to use *
during
New submission from Roy Smith:
http://docs.python.org/2/library/unittest.html#assert-methods
The docs say, "The TestCase class provides a number of methods to check for and
report failures, such as", and then when you scroll a couple of screens down,
there's another list,
Roy Smith added the comment:
Adding a note that there are more methods in the tables below would be useful.
Otherwise, you assume you've seen them all when you've read the first table.
I agree that the assertions about exceptions and warnings belong in a different
group, but I don
New submission from Roy Smith :
The docs don't say what happens if you call random.sample() with a population
smaller than k. Experimentally, it raises ValueError, but this should be
documented.
I would have guessed it would return IndexError, by analogy to random.c
Roy Smith added the comment:
The docs describe population as a "sequence". Your patch describes it as a
"list". I would go with:
If *len(population)* is less than *k*, raises :exc:`ValueError`.
--
___
Python tracker
<
New submission from Roy Smith:
Opening this bug at Ben Finney's request. See
https://groups.google.com/forum/?fromgroups#!topic/comp.lang.python/wmDUrpW2ZCU
for the full thread discussing the problem. Here's a significant excerpt:
---
Roy Smith added the comment:
We need to define the scope of what input strings will be accepted. ISO-8601
defines a lot of stuff which we may not wish to accept.
Do we want to accept both basic format (MMDD) and extended format
(-MM-DD)?
Do we want to accept things like "1985-
Roy Smith added the comment:
I see I mis-stated my example. When I wrote:
s = str(d1)
d2 = datetime.datetime(s)
assert d1 == d2
what I really meant was:
s = d1.isoformat()
d2 = datetime.datetime(s)
assert d1 == d2
But, now I realize that while that is certainly an absolute lower bound, it
Roy Smith added the comment:
I've started collecting some test cases. I'll keep adding to the collection.
I'm going to start trolling ISO 8601:2004(E) for more. Let me know if there
are other sources I should be considering.
--
___
Roy Smith added the comment:
Ooops, clicked the wrong button.
--
Added file: http://bugs.python.org/file27165/test-cases.py
___
Python tracker
<http://bugs.python.org/issue15
New submission from Roy Smith:
Running this code:
---
import argparse
p = argparse.ArgumentParser()
p.add_argument('--foo',
help=u'This is a very long help string. ex:
"--s3\u00A0s3://my.bucket/dir1/
Roy Jacobson added the comment:
This bug is a really annoying one, any chance it will be fixed in 2.7? It's
really a matter when you want to deploy a program using distutils (my case),
because you cannot really require your clients to edit the registry themselves
:/
Is there any problem
Changes by Roy Smith :
--
nosy: +roysmith
___
Python tracker
<http://bugs.python.org/issue14452>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from Roy Smith:
The following code, when run with "--help", omits the trailing newlines from
the epilog. It should just emit the string verbatim. If the developer didn't
want the extra newlines, he/she wouldn't have put them there.
im
New submission from Roy Smith:
# Python 2.7.3
# Ubuntu 12.04
import re
pattern = r"( ?P.*)"
regex = re.compile(pattern, re.VERBOSE)
The above raises an exception in re.compile():
Traceback (most recent call last):
File "./try.py", line 6, in
regex = re.compile
Changes by Roy Smith :
--
nosy: +roysmith
___
Python tracker
<http://bugs.python.org/issue15606>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Roy Smith :
--
nosy: +roysmith
___
Python tracker
<http://bugs.python.org/issue11204>
___
___
Python-bugs-list mailing list
Unsubscribe:
Roy Smith added the comment:
The new text suggested by terry.reedy works for me.
--
___
Python tracker
<http://bugs.python.org/issue19006>
___
___
Python-bug
New submission from Roy Smith:
http://docs.python.org/2/library/nntplib.html contains intra-page references
such as:
NNTP.next()
Send a NEXT command. Return as for stat().
The problem is that the link for "stat" points to the stat module (i.e.
http://docs.python.org/2/library
New submission from Roy Smith:
https://mail.python.org/pipermail/python-list/2014-June/674188.html
--
messages: 221846
nosy: roysmith
priority: normal
severity: normal
status: open
title: str.format() gives poor diagnostic on placeholder mismatch
Roy Smith added the comment:
(ugh, hit return too soon)
>>> '{1}'.format()
Traceback (most recent call last):
File "", line 1, in
IndexError: tuple index out of range
This is a confusing error message. The user hasn't written any tuples, so a
message abo
Audrey Roy added the comment:
> Since it isn't linked from the 3.4 index, it may be more effort than
> it is worth to get someone to delete the file from the 3.4 tree on the
> server.
It would be worthwhile to delete or fix it in the 2.7 and 3.4 tree.
It accidentally gets
Audrey Roy added the comment:
Mark, I and a number of others simply misinterpreted the text in that section.
--
___
Python tracker
<http://bugs.python.org/issue21
New submission from Roy Wellington:
Inheriting from collections.MutableSet mixes in several methods, however, it
does not mix in a .update method. This can cause a variety of confusion if you
expect a MutableSet to act like a set. Moreover, MutableMapping does provide a
.update method, which
New submission from Roy Smith:
For background, see:
https://mail.python.org/pipermail/python-list/2014-August/676291.html
In a nutshell, the iglob() docs say, "Return an iterator which yields the same
values as glob() without actually storing them all simultaneously." The
Roy Smith added the comment:
The thread that led to this started out with the use case of a directory that
had 200k files in it. If I ran iglob() on that and discovered that it had
internally generated a list of all 200k names in memory at the same time, I
would be pretty darn surprised
1 - 100 of 160 matches
Mail list logo