Charles-François Natali added the comment:
The transfer won't be faster mainly because it's really I/O bound.
But it will use less CPU, only because you're making less syscalls.
Have you actually measured this?
vanilla over Gb/s:
real0m9.035s
user0m0.523s
sys 0m1.412s
Raymond Hettinger added the comment:
+1 for the idea.
Please change failobj to default to keep the terminology consistent with
the pure Python API. For reference, here's the code from
collections.MutableMapping:
def setdefault(self, key, default=None):
try:
return
Serhiy Storchaka added the comment:
There are reasons why Ezio did not include assert*Regexp*-assert*Regex* in his
patch.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10712
___
Serhiy Storchaka added the comment:
Perhaps it was fixed in issue10181. Is it reproduced on Python 2.7 build from
current sources?
--
nosy: +serhiy.storchaka
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17360
Serhiy Storchaka added the comment:
Sorry, this is issue10182.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17360
___
___
Python-bugs-list
New submission from Raymond Hettinger:
I was working through the problem sets in The Little Book of Semaphores
(http://www.greenteapress.com/semaphores/downey08semaphores.pdf) and ran into
an issue because Python's threading.Semaphore has an unnecessary restriction
against having negative
Changes by Raymond Hettinger raymond.hettin...@gmail.com:
--
nosy: +pitrou
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17374
___
___
Raymond Hettinger added the comment:
For reference, here is the Java API for a Semaphore (
http://docs.oracle.com/javase/1.5.0/docs/api/java/util/concurrent/Semaphore.html
):
Semaphore
-
public Semaphore(int permits)
Creates a Semaphore with the given number of permits and nonfair
Tim Golden added the comment:
Dave, you seem to misunderstand what's happening here: the os.chdir
function doesn't have access to the characters which are typed in
the script or in the interpreter. It receives a Python string object.
The parser etc. which constructs the string object determines
New submission from Raymond Hettinger:
It should be an easy task fill-in the missing docstrings using the verbiage in
the regular docs.
--
assignee: docs@python
components: Documentation
keywords: easy
messages: 183645
nosy: docs@python, rhettinger
priority: normal
severity: normal
moijes12 added the comment:
Changes made according to the Sehiy's last comment. Include/Python.h has not
been modified as it doesn't need one. Also, make files have been changed.
--
keywords: +patch
nosy: +moijes12
Added file: http://bugs.python.org/file29335/16321.patch
Amaury Forgeot d'Arc added the comment:
3. When a thread increments the semaphore, if there are other
threads waiting, one of the waiting threads gets unblocked.
Is a condition missing here? if the resulting count is positive
Since the use case is different from a regular Semaphore, I
Antoine Pitrou added the comment:
We already have a Barrier class actually:
http://docs.python.org/dev/library/threading.html#barrier-objects
As for accepting negative initialization values, it sounds like a reasonable
request. One reason for rejecting would be if it makes writing a fast
Dave Humphries added the comment:
Thanks for the thoughtful response Tim,
I am obviously not being clear with the way I express this. os.chdir
uses a common string but these strings represent a special subset of
strings. I'm not sure about mac and linux but windows has arrange of
characters that
Antoine Pitrou added the comment:
_Py_GetRefTotal() wouldn't be available in non-debug builds IIRC.
--
nosy: +pitrou
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17323
___
Changes by Tshepang Lekhonkhobe tshep...@gmail.com:
--
nosy: +tshepang
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9556
___
___
Python-bugs-list
Changes by Giampaolo Rodola' g.rod...@gmail.com:
--
nosy: +giampaolo.rodola
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17338
___
___
Charles-François Natali added the comment:
As for accepting negative initialization values, it sounds like a reasonable
request. One reason for rejecting would be if it makes writing a fast
implementation harder. Also, multiprocessing.Semaphore should be kept
compatible with
New submission from Tshepang Lekhonkhobe:
Usage of 'W' type is not clear from reading the documentation, specifically how
to specify what day-of-week: Doc/library/logging.handlers.rst:291.
An example http://stackoverflow.com/q/14304954/321731.
--
assignee: docs@python
components:
New submission from Sven Slootweg:
When faced with a subclass of int like a psutil constant (such as for process
status), that actually returns a non-numeric string when used with str(), the
JSON module will serialize it as a string without quotes.
An example... Code (Python):
[...] key:
Giampaolo Rodola' added the comment:
It seems you're right, sorry. We need to take that into account then.
In the meantime I rewrote the original patch and got rid of the use_sendfile
explicit argument in order to attempt to use sendfile() by default and fall
back on using send() if bytes
Charles-François Natali added the comment:
In the meantime I rewrote the original patch and got rid of the
use_sendfile explicit argument in order to attempt to use sendfile() by
default and fall back on using send() if bytes sent were 0.
# block until socket is writable
select.select([],
Ankur Ankan added the comment:
Thanks for your comments Serhiy.
I have improved the patch according to your comments. Please have a look.
And I am writing tests.
--
Added file: http://bugs.python.org/file29337/issue_13477_v2
___
Python tracker
karl added the comment:
Here an attempt at fixing it. See issue-17375-1.patch for Python 3.3
Hope it helps.
--
keywords: +patch
nosy: +karlcow
Added file: http://bugs.python.org/file29338/issue-17375-1.patch
___
Python tracker rep...@bugs.python.org
Eli Bendersky added the comment:
Duplicate of #12768?
karl - feel free to review the patch submitted to that issue and offer your
insights.
--
nosy: +eli.bendersky
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17375
karl added the comment:
Ah bummer! :) it was already done. :) Well it seems already well commented in
the review. :)
Closing this one as duplicate?
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17375
Roundup Robot added the comment:
New changeset adeafab9a18f by Nick Coghlan in branch '3.3':
Close #15465: Document C API version macros
http://hg.python.org/cpython/rev/adeafab9a18f
New changeset a1373861f62f by Nick Coghlan in branch 'default':
Merge fix for #15465 from 3.3
New submission from Eli Bendersky:
While playing with ctypes a bit, I noticed a feature that doesn't appear to be
documented. Suppose I import the readdir_r function (assuming DIRENT is a
correctly declared ctypes.Structure):
DIR_p = c_void_p
DIRENT_p = POINTER(DIRENT)
DIRENT_pp =
Stefan Behnel added the comment:
The problem with 'default' is that it is a reserved word in C. I changed it to
defaultobj, except for the docs page, where default should work. I also
removed the register declaration from the mp argument because it is most
likely useless and just takes up
Eli Bendersky added the comment:
Doc patch for 3.2
--
keywords: +patch
Added file: http://bugs.python.org/file29340/issue17378.1.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17378
___
Changes by Eli Bendersky eli...@gmail.com:
--
nosy: +amaury.forgeotdarc, theller
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17378
___
___
R. David Murray added the comment:
Right, the appropriate thing to do there is to write a custom encoder/decoder
to handle those objects. json only automatically handles types that work like
the fundamental types, and this is a good thing, security-wise :)
--
nosy: +r.david.murray
Eli Bendersky added the comment:
The patch addresses issue16575 as well
--
nosy: +theller
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16576
___
Giampaolo Rodola' added the comment:
It's necessary because sendfile() can fail with EAGAIN.
As for your blocksize = filesize argument I changed my opinion: despite being
less CPU consuming we might incur into problems if that number is too big.
'count' parameter on Linux, for example, is
karl added the comment:
Is it better like this? See the patch.
--
keywords: +patch
nosy: +karlcow
Added file: http://bugs.python.org/file29341/issue-17376-doc-3.3.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17376
Charles-François Natali added the comment:
It's necessary because sendfile() can fail with EAGAIN.
It can fail with EAGAIN if the input FD is non-blocking, exactly like
the current implementation which calls fp.read(). Furthermore, since
sendfile actually supports only regular file and regular
Thomas Heller added the comment:
Patch looks good. Please apply.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17378
___
___
Python-bugs-list
Antoine Pitrou added the comment:
As for your blocksize = filesize argument I changed my opinion:
despite being less CPU consuming we might incur into problems if
that number is too big. 'count' parameter on Linux, for example, is
expected to be an unsigned int.
Other plarforms will also
New submission from Christian Heimes:
Tim came up with a fitting amendment to the Zen of Python. It pretty much sums
up our future Code of Conduct in one sentence. But see for yourself! ;)
--
files: zen_amendment.patch
keywords: patch
messages: 183671
nosy: christian.heimes, tim_one
Anders Hovmöller added the comment:
I've written a parser for ISO 8601: https://github.com/boxed/iso8601
Some basic tests are included and it supports most of the standard. Haven't
gotten around to the more obscure parts like durations and intervals, but those
are trivial to add...
Giampaolo Rodola' added the comment:
'count' is size_t, like for mmap() and any other function accepting a
length, so nothing wrong can happen.
Then why 'offset' and 'count' parameters have a different data type?
Linux:
sendfile(..., off_t *offset, size_t count);
Solaris:
sendfile(...,
Changes by Barry A. Warsaw ba...@python.org:
--
nosy: +barry
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17379
___
___
Python-bugs-list mailing
Antoine Pitrou added the comment:
Disagreed. This is the kind of sentence that cannot be correctly
understood without the (missing) original context.
It is also, IMHO, a rather poor wording. The categories of civilized
and barbarian, as any kind of binary thinking (us vs. them) are routinely
Barry A. Warsaw added the comment:
On Mar 07, 2013, at 03:58 PM, Antoine Pitrou wrote:
Disagreed. This is the kind of sentence that cannot be correctly
understood without the (missing) original context.
Plus, we fear change. ;)
--
___
Python
Serhiy Storchaka added the comment:
It will be good if Berker and Ankur will merge their patches. Ankur's patch has
some very useful features, but Berker's patch looks more mature.
I prefer to emulate a subset of the tar utility interface too.
--
Matthew Barnett added the comment:
I've attached fnmatch_implementation.py, which is a simple pure-Python
implementation of the fnmatch function.
It's not as susceptible to catastrophic backtracking as the current re-based
one. For example:
fnmatch('a' * 50, '*a*' * 50)
completes quickly.
R. David Murray added the comment:
Yeah, but in this case I think Antoine is right. This kind of argument is
the kind of argument that is used to shut down discussion, in form whether or
not in substance. Which is too bad, because it is nicely clever.
--
nosy: +r.david.murray
Roundup Robot added the comment:
New changeset 6ccefddc13fd by Ezio Melotti in branch '3.3':
#11732: make suppress_crash_popup() work on Windows XP and Windows Server 2003.
http://hg.python.org/cpython/rev/6ccefddc13fd
New changeset 831035bda9b7 by Ezio Melotti in branch 'default':
#11732:
Serhiy Storchaka added the comment:
I think it should be a separate issue.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8402
___
___
Charles-François Natali added the comment:
Then why 'offset' and 'count' parameters have a different data type?
Because offsets can be negative (e.g. for lseek), while a size can't.
That's why 'count' is size_t, not ssize_t.
Furthermore, since sendfile actually supports only regular file and
Changes by Charles-François Natali cf.nat...@gmail.com:
--
nosy: -neologix
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13564
___
___
Éric Araujo added the comment:
I am more in favor of having something simple and similar to zipfile, like
Lars, rather than following tar.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13477
Roundup Robot added the comment:
New changeset c0c440dcb8dd by Ezio Melotti in branch '3.2':
#11732: add a new suppress_crash_popup() context manager to test.support that
disables crash popups on Windows and use it in test_ctypes.
http://hg.python.org/cpython/rev/c0c440dcb8dd
New changeset
Serhiy Storchaka added the comment:
This can confuse users. Note that even jar (which works with zip-like files)
honors tar interface.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13477
Ezio Melotti added the comment:
GetErrorMode wasn't available on XP/2k3, so I changed the patch to use only
SetErrorMode. I also backported it to 3.2, since ctypes has the same crashing
test of 3.3/default.
If I got everything right there shouldn't be anymore crash popups while running
the
B. Kyven added the comment:
I now realized LWPCookieJar is a subclass of CookieJar but it behaves
differently. I believe there are other quirks I haven't discovered, like
expire=None which cause exception in LWPCookieJar, but works fine for
CookieJar. Sadly the doc didn't mention them.
The
Ezio Melotti added the comment:
Yes -- I was proposing to make it available on non-debug builds too, unless it
has a negative impact on the performance or other similar issues.
--
___
Python tracker rep...@bugs.python.org
Éric Araujo added the comment:
Yeah, that’s always the discussion when writing a Python utility that has a
unix equivalent: do you want to be familiar to Python users or to the unix tool
users?
I don’t have a strong opinion. I think unix users would have no reason to use
python -m tarfile,
New submission from Zbyszek Jędrzejewski-Szmek:
initproc is declared to return an int, but what returned values mean is not
documented. Noddy_init in
http://docs.python.org/3/extending/newtypes.html?highlight=initproc#adding-data-and-methods-to-the-basic-example
can be seen to return 0 on
Brett Cannon added the comment:
How about civility beats rudeness. That's clearly delineates it's about your
discourse with others and eliminates any superiority issues people were feeling
with the term barbaric.
Obviously Tim would still need to sign off on this as well.
--
nosy:
Tim Peters added the comment:
As I just clarified on the members list, the Zen is about the design of
Python-the-language. It's hard to imagine that a programming language _could_
be barbaric or rude, Perl notwithstanding ;-)
--
___
Python tracker
Antoine Pitrou added the comment:
Actually, INTERCAL mandates a certain amount of politeness (not too little, but
not too much either): http://en.wikipedia.org/wiki/INTERCAL
--
___
Python tracker rep...@bugs.python.org
Brett Cannon added the comment:
Tim has spoken, so closing the bug as rejected.
--
resolution: - rejected
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17379
___
Ezio Melotti added the comment:
change '2.4 or higher' to '2.4 to 2.7'.
Python 2 should be enough.
Perhaps we should add These instructions assume that repository/Doc/
is the current directory. Then we would not have to repeat in multiple
places.
There was a somewhat related discussion
Benjamin Peterson added the comment:
Please call it PyDict_SetDefault, though.
--
nosy: +benjamin.peterson
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17327
___
Stefan Behnel added the comment:
I had originally considered that name. However, what it really does is
PyDict_GetItem(). In a specific special case, it sets a default value and
*then* returns that. So it's still PyDict_GetItem(), just with a preceding
modification. Also, the interface mimics
Benjamin Peterson added the comment:
PyDict_SetDefault mimicks the Python API, though.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17327
___
Stefan Behnel added the comment:
Well, guess what, I kind-of figured that. So, what's wrong with
PyDict_GetItemSetDefault()? That mimics the Python method name, too, while at
the same time making it clear what actually happens and how the C-API function
behaves.
--
Antoine Pitrou added the comment:
I would simply call it PyDict_SetDefault, too. It's also shorter to type ;)
--
nosy: +pitrou
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17327
___
Stefan Behnel added the comment:
To me, PyDict_SetDefault() sounds like it's supposed to set a default value
that PyDict_GetItem() would return instead of NULL on lookup failure. Basically
a defaultdict-like extension to normal dicts.
--
___
Python
Stefan Behnel added the comment:
I'm fine with PyDict_GetItemOrSetDefault() as well.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17327
___
Eric Snow added the comment:
I'm closing this as #17037 offers a better solution and it's unlikely this
proposal would make it if that one doesn't.
--
resolution: - wont fix
status: open - closed
___
Python tracker rep...@bugs.python.org
R. David Murray added the comment:
Here's a patch. Note that this fixes a regression relative to Python2, where
fallback_charset was used in this case.
--
keywords: +patch
versions: -Python 2.7
Added file: http://bugs.python.org/file29344/collapse_rfc2231_value.patch
Changes by R. David Murray rdmur...@bitdance.com:
--
stage: needs patch - patch review
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17369
___
___
New submission from Chris Adams:
I noticed an interesting failure while using re.match / re.sub to look for
non-Cyrillic characters in allegedly Russian text:
re.sub(r'[\s\u0400-\u0527]+', ' ', 'Архангельская губерния',
flags=re.IGNORECASE)
'Архангельская губерния'
Terry J. Reedy added the comment:
Doc/make.bat assumes that this issue has already been resolved:
if %PYTHON% EQU set PYTHON=..\pcbuild\python
Even with '_d' appended, as it should be, that does not work for 3.x.
I think that line should be @rem'ed out until it does work.
Does anyone mind if
Terry J. Reedy added the comment:
Python 2 should be enough.
I thought about that. Agreed.
make -C Doc xxx will not work with make.bat. Perhaps 7.6.1. Using make
should be expanded to 7.6.1 Using make on unix and 7.6.2 Using make on
Windows added. Then the directory assumption could be put in
Roundup Robot added the comment:
New changeset 30c0f0dd0b94 by R David Murray in branch '3.2':
#14645: Generator now emits correct linesep for all parts.
http://hg.python.org/cpython/rev/30c0f0dd0b94
New changeset 1b9dc00c4d57 by R David Murray in branch '3.3':
Merge: #14645: Generator now
Changes by Tshepang Lekhonkhobe tshep...@gmail.com:
--
nosy: +tshepang
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10224
___
___
R. David Murray added the comment:
I'm not going to fix this in Python2. While the problem exists there, it
hasn't ever been reported as a bug. As noted earlier, this is probably
primarily due to the fact that it would be very exceptional to read an email in
python2 with anything other than
Raymond Hettinger added the comment:
+1 for PyDict_SetDefault. Any other name is confusing.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17327
___
New submission from Dirk Zabel:
When debugging with IDLE with checkbox Source enabled, the source window
highlights the current line only when the source window is activated. If one of
the buttons of the IDLE debug window is pressed (Step, Over or Out), the
source window is no longer active
Matthew Barnett added the comment:
The way the re handles ranges is to convert the two endpoints to lowercase and
then check whether the lowercase form of the character in the text is in that
range.
For example, [A-Z] is converted to the range [\x41-\x5A], and the lowercase
form of 'Q'
Stefan Behnel added the comment:
Ok (shrug), since everyone seems to agree, PyDict_SetDefault() it is. I
wouldn't be surprised if the same kind of discussion lead to the original
naming of dict.setdefault()...
--
Added file: http://bugs.python.org/file29345/pydict_setitemdefault.patch
Dirk Zabel added the comment:
When debugging with IDLE with checkbox Source enabled, the source window
highlights the current line only when the source window is activated. If one of
the buttons of the IDLE debug window is pressed (Step, Over or Out), the
source window is no longer active and
New submission from Piotr Kuchta:
In the 2.7 tutorial, chapter on modules:
http://docs.python.org/2/tutorial/modules.html#more-on-modules
I think the last sentence in this paragraph is incorrect:
Modules can import other modules. It is customary but not required to place
all import
Ezio Melotti added the comment:
It should probably say that they are placed in the namespace where they get
imported, but I'm not sure if the concept of namespace has been covered yet at
that point of the tutorial. The sentence probably assume that the modules are
getting imported at the
Changes by Ashwini Chaudhary monty.sin...@gmail.com:
--
nosy: +montysinngh
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17383
___
___
STINNER Victor added the comment:
It looks like PyUnicode_FromUnicode() should accept invalid UTF-16 surrogates
because the array module indirectly relies on that:
On Windows (16-bit wchar_t/Py_UNICODE), len(array.array('u', '\U0010')) is
2 and array.array('u', '\U0010')[0] is
Roundup Robot added the comment:
New changeset 1fd165883a65 by Victor Stinner in branch '3.3':
Issue #17223: the test is specific to 32-bit wchar_t type
http://hg.python.org/cpython/rev/1fd165883a65
New changeset 42970cbfc982 by Victor Stinner in branch 'default':
(Merge 3.3) Issue #17223: the
STINNER Victor added the comment:
The test should now pass on Windows.
--
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17223
___
STINNER Victor added the comment:
I don't understand why do we have specialized functions to compare strings.
Can't we reuse PyUnicode_Compare(a, b) or PyUnicode_RichCompare( a, b, Py_EQ)?
Is unicode_eq() used to inline the code?
By the way, unicode_compare_eq() (subfunction of these
STINNER Victor added the comment:
More generally though, this would be improved by precompiling some of the
information (like Argument Clinic does, perhaps).
The same idea was already proposed to optimize str%args and str.format(args).
struct.unpack() does also compile the format into an
STINNER Victor added the comment:
+parser.add_argument('--gz', '--gunzip', '--gzip', '--tgz', '-z',
+'--ungzip', action = 'store_true',
+help = 'gz compression')
+parser.add_argument('--bz2', '--bzip2', '--tbz2', '--tbz', '--tb2',
+
Roundup Robot added the comment:
New changeset a0b750ea3397 by Benjamin Peterson in branch 'default':
Add PyDict_SetDefault. (closes #17327)
http://hg.python.org/cpython/rev/a0b750ea3397
--
nosy: +python-dev
resolution: - fixed
stage: - committed/rejected
status: open - closed
Berker Peksag added the comment:
New patch(issue13477_v3.diff) attached.
Changes:
* Addressed comments from Serhiy
* Added output parameter to --extract option (from Ankur's patch)
* Updated tests and documentation
The current docstring of tarfile module does not give much
information(it just
Changes by Berker Peksag berker.pek...@gmail.com:
Removed file: http://bugs.python.org/file29291/issue13477.diff
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13477
___
Changes by Berker Peksag berker.pek...@gmail.com:
Removed file: http://bugs.python.org/file29346/issue13477_v3.diff
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13477
___
Changes by Berker Peksag berker.pek...@gmail.com:
Added file: http://bugs.python.org/file29347/issue13477_v3.diff
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13477
___
Ankur Ankan added the comment:
+parser.add_argument('--gz', '--gunzip', '--gzip', '--tgz', '-z',
+'--ungzip', action = 'store_true',
+help = 'gz compression')
+parser.add_argument('--bz2', '--bzip2', '--tbz2', '--tbz', '-- tb2',
+
1 - 100 of 107 matches
Mail list logo