[issue18667] missing HAVE_FCHOWNAT

2013-08-05 Thread Petr.Salinger

New submission from Petr.Salinger:

During test on kfreebsd:

test_chown_dir_fd (test.test_posix.PosixTester) ... skipped 'test needs dir_fd 
support in os.chown()'

But all *AT syscalls are supported.
It looks like posixmodule.c misses propagation of that fact.

--- a/Modules/posixmodule.c
+++ b/Modules/posixmodule.c
@@ -12004,6 +12004,10 @@
 "HAVE_FCHOWN",
 #endif
 
+#ifdef HAVE_FCHOWNAT
+"HAVE_FCHOWNAT",
+#endif
+
 #ifdef HAVE_FEXECVE
 "HAVE_FEXECVE",
 #endif

--
components: Extension Modules
messages: 194529
nosy: Petr.Salinger
priority: normal
severity: normal
status: open
title: missing HAVE_FCHOWNAT
versions: Python 3.4

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18562] Regex howto: revision pass

2013-08-05 Thread Ezio Melotti

Changes by Ezio Melotti :


--
components: +Regular Expressions
nosy: +mrabarnett
type:  -> enhancement

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18665] Typos in frame object related code

2013-08-05 Thread Vajrasky Kok

Vajrasky Kok added the comment:

Okay, attached the patch to fix the typo.

--
keywords: +patch
Added file: http://bugs.python.org/file31171/fix_typo_frame_object.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16245] Update html.entities.html5 dictionary and parseentities.py

2013-08-05 Thread Ezio Melotti

Ezio Melotti added the comment:

I run Tools/scripts/parse_html5_entities.py and it says that "The current 
dictionary is updated.".  We should check this again, and eventually close the 
issue, when 3.4 is released.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18662] re.escape should not escape the hyphen

2013-08-05 Thread Ezio Melotti

Ezio Melotti added the comment:

In #2650 re.escape() was updated to match Perl's behavior.  I don't think 
there's any actual reason to change it -- it brings no benefits and it might 
break some code (even if admittedly it's not very likely).

--
type: behavior -> enhancement
versions:  -Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3, Python 
3.5

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18665] Typos in frame object related code

2013-08-05 Thread Ezio Melotti

Ezio Melotti added the comment:

Can you attach the patch to the issue?
Full stops for one-sentence comments can be omitted.

--
nosy: +ezio.melotti
stage:  -> needs patch
type:  -> enhancement
versions: +Python 2.7, Python 3.3

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18666] Unused variable in test_frame.py

2013-08-05 Thread Vajrasky Kok

New submission from Vajrasky Kok:

There is a unused variable in Lib/test/test_frame.py.

def test_clear_executing_generator(self):
# Attempting to clear an executing generator frame is forbidden.
endly = False
def g():
nonlocal endly
try:
1/0
except ZeroDivisionError as e:
f = e.__traceback__.tb_frame
with self.assertRaises(RuntimeError):
f.clear()
with self.assertRaises(RuntimeError):
f.f_back.clear()
yield f
finally:
endly = True
gen = g()
f = next(gen)
self.assertFalse(endly)

The variable f is hanging without any purpose.

Attached the patch to give purpose to variable f.

--
components: Tests
files: test_frame.patch
keywords: patch
messages: 194524
nosy: pitrou, vajrasky
priority: normal
severity: normal
status: open
title: Unused variable in test_frame.py
versions: Python 3.4
Added file: http://bugs.python.org/file31170/test_frame.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18665] Typos in frame object related code

2013-08-05 Thread Vajrasky Kok

New submission from Vajrasky Kok:

See the patch for details:

diff -r 438cdc97d8ee Include/frameobject.h
--- a/Include/frameobject.h Mon Aug 05 23:35:43 2013 +0200
+++ b/Include/frameobject.h Tue Aug 06 12:38:15 2013 +0800
@@ -36,7 +36,7 @@
non-generator frames. See the save_exc_state and swap_exc_state
functions in ceval.c for details of their use. */
 PyObject *f_exc_type, *f_exc_value, *f_exc_traceback;
-/* Borrowed referenced to a generator, or NULL */
+/* Borrowed reference to a generator, or NULL */
 PyObject *f_gen;
 
 PyThreadState *f_tstate;
diff -r 438cdc97d8ee Lib/test/test_frame.py
--- a/Lib/test/test_frame.pyMon Aug 05 23:35:43 2013 +0200
+++ b/Lib/test/test_frame.pyTue Aug 06 12:38:15 2013 +0800
@@ -93,7 +93,7 @@
 
 @support.cpython_only
 def test_clear_refcycles(self):
-# .clear() doesn't leave any refcycle behin
+# .clear() doesn't leave any refcycle behind.
 with support.disable_gc():
 class C:
 pass


About the second comment, I am not sure to put dot or not. In that file, I saw 
some comments use dot, others don't.

--
assignee: docs@python
components: Documentation
messages: 194523
nosy: docs@python, pitrou, vajrasky
priority: normal
severity: normal
status: open
title: Typos in frame object related code
versions: Python 3.4

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18659] test_precision in test_format.py is not executed and has unused variable

2013-08-05 Thread Vajrasky Kok

Vajrasky Kok added the comment:

Attached the third patch. The importing _testcapi part was moved inside the 
test. Added cpython support only decorator for this test.

--
Added file: http://bugs.python.org/file31169/test_precision_v3.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18664] occasional test_threading failure

2013-08-05 Thread STINNER Victor

Changes by STINNER Victor :


--
nosy: +christian.heimes, serhiy.storchaka

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18664] occasional test_threading failure

2013-08-05 Thread STINNER Victor

STINNER Victor added the comment:

> Assertion failed: !PyErr_Occurred(), file ..\Objects\object.c, line 451

This error means that PyObject_Repr() was called with an exception set. It 
would help to know which function called PyObject_Repr() and when.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1565525] tracebacks eat up memory by holding references to locals and globals when they are not wanted

2013-08-05 Thread STINNER Victor

STINNER Victor added the comment:

> frame.clear() was committed in issue17934.

How should it be used to workaround this issue ("tracebacks eat up memory by 
holding references to locals and globals when they are not wanted")?

We need maybe an helper to clear all frames referenced by a traceback?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18659] test_precision in test_format.py is not executed and has unused variable

2013-08-05 Thread STINNER Victor

STINNER Victor added the comment:

I realized that the new tests checking that precision larger with
INT_MAX fail should be marked as specific to CPython. The import of
_testcapi should be moved to a CPython specific test.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18579] Dereference after NULL check in listobject.c merge_hi()

2013-08-05 Thread Alexander Belopolsky

Alexander Belopolsky added the comment:

According to this comment, ssb.values can be null:

/* A sortslice contains a pointer to an array of keys and a pointer to
 * an array of corresponding values.  In other words, keys[i]
 * corresponds with values[i].  If values == NULL, then the keys are
 * also the values.
 *
 * Several convenience routines are provided here, so that keys and
 * values are always moved in sync.
 */ 


However, is ssb.values is null, dest.values must be null as well and 
sortslice_copy_decr() will not dereference either of the pointers.

Looks like a false positive to me, but I wonder if a strategically placed 
assert will silence coverity:

Py_LOCAL_INLINE(void)
sortslice_copy_decr(sortslice *dst, sortslice *src)
{
*dst->keys-- = *src->keys--;
if (dst->values != NULL) {
assert(src->values != NULL);
*dst->values-- = *src->values--;
}
}

--
nosy: +belopolsky

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18664] occasional test_threading failure

2013-08-05 Thread Antoine Pitrou

New submission from Antoine Pitrou:

http://buildbot.python.org/all/builders/AMD64%20Windows%20Server%202008%20%5BSB%5D%203.x/builds/1021

==
FAIL: test_finalize_with_trace (test.test_threading.ThreadTests)
--
Traceback (most recent call last):
  File 
"E:\home\cpython\buildslave\x64\3.x.snakebite-win2k8r2sp1-amd64\build\lib\test\test_threading.py",
 line 323, in test_finalize_with_trace
""")
  File 
"E:\home\cpython\buildslave\x64\3.x.snakebite-win2k8r2sp1-amd64\build\lib\test\script_helper.py",
 line 54, in assert_python_ok
return _assert_python(True, *args, **env_vars)
  File 
"E:\home\cpython\buildslave\x64\3.x.snakebite-win2k8r2sp1-amd64\build\lib\test\script_helper.py",
 line 46, in _assert_python
"stderr follows:\n%s" % (rc, err.decode('ascii', 'ignore')))
AssertionError: Process return code is 3, stderr follows:
Assertion failed: !PyErr_Occurred(), file ..\Objects\object.c, line 451
Fatal Python error: Aborted

Thread 0x0e14:
  File "", line 8 in killer
  File 
"E:\home\cpython\buildslave\x64\3.x.snakebite-win2k8r2sp1-amd64\build\lib\threading.py",
 line 599 in run
  File 
"E:\home\cpython\buildslave\x64\3.x.snakebite-win2k8r2sp1-amd64\build\lib\threading.py",
 line 642 in _bootstrap_inner
  File 
"E:\home\cpython\buildslave\x64\3.x.snakebite-win2k8r2sp1-amd64\build\lib\threading.py",
 line 619 in _bootstrap

Current thread 0x06c4:

--
components: Interpreter Core, Tests
messages: 194517
nosy: haypo, pitrou
priority: normal
severity: normal
status: open
title: occasional test_threading failure
type: crash
versions: Python 3.4

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18652] Add itertools.first_true (return first true item in iterable)

2013-08-05 Thread Antoine Pitrou

Antoine Pitrou added the comment:

(but you don't have to trust me: itertools also has izip_longest() and 
combinations_with_replacement())

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18652] Add itertools.first_true (return first true item in iterable)

2013-08-05 Thread Antoine Pitrou

Antoine Pitrou added the comment:

I would like to chime in and say that the fact that the functions exists in SQL 
(and possibly Lisp, Snobol and PHP) sells me on the idea!

Okay, only joking, but I do think this is a useful addition.
"first_true" should be its name, but itertools already has a tradition of 
nonunderscorednames, so it should be "firsttrue", which may look weird because 
of the doubled t.

--
nosy: +pitrou

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1565525] tracebacks eat up memory by holding references to locals and globals when they are not wanted

2013-08-05 Thread Antoine Pitrou

Antoine Pitrou added the comment:

frame.clear() was committed in issue17934.

--
nosy: +pitrou

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9815] assertRaises as a context manager keeps tracebacks and frames alive

2013-08-05 Thread Antoine Pitrou

Antoine Pitrou added the comment:

frame.clear() was committed in issue17934, it would allow a less brutal 
resolution.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17934] Add a frame method to clear expensive details

2013-08-05 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Ok, I committed the RuntimeError-raising version.

--
resolution:  -> fixed
stage: patch review -> committed/rejected
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17934] Add a frame method to clear expensive details

2013-08-05 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 862ab99ab570 by Antoine Pitrou in branch 'default':
Issue #17934: Add a clear() method to frame objects, to help clean up expensive 
details (local variables) and break reference cycles.
http://hg.python.org/cpython/rev/862ab99ab570

--
nosy: +python-dev

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4885] mmap enhancement request

2013-08-05 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 1754b7900da1 by Antoine Pitrou in branch 'default':
Issue #4885: Add weakref support to mmap objects.  Patch by Valerie Lambert.
http://hg.python.org/cpython/rev/1754b7900da1

--
nosy: +python-dev

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4885] mmap enhancement request

2013-08-05 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Your patch is now committed. Thanks for contributing!

--
resolution:  -> fixed
stage: patch review -> committed/rejected
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14465] xml.etree.ElementTree: add feature to prettify XML output

2013-08-05 Thread Alex Henderson

Alex Henderson added the comment:

Proposed patch copied over from duplicate issue 17372.

--
keywords: +patch
nosy: +alex.henderson
Added file: http://bugs.python.org/file31168/issue14465.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18078] threading.Condition to allow notify on a specific waiter

2013-08-05 Thread Raymond Hettinger

Changes by Raymond Hettinger :


--
assignee:  -> rhettinger

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14323] Normalize math precision in RGB/YIQ conversion

2013-08-05 Thread Mark Dickinson

Mark Dickinson added the comment:

LGTM too.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18472] Update PEP 8 to encourage modern conventions

2013-08-05 Thread R. David Murray

R. David Murray added the comment:

Technically a bytes object is sequence of integers, not a sequence of bytes.  
That is, if you iterate it, you get integers.  Python doesn't have a 'byte' 
type.

--
nosy: +r.david.murray

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18472] Update PEP 8 to encourage modern conventions

2013-08-05 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Ezio 2. Explicitly say "use 'as' instead of ','". Someone who does not know 
that 'as' is available since 2.6 may not understand.

3. 'byte' may be interpreted as 'char', especially for someone using 2.x 
'bytes'.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14323] Normalize math precision in RGB/YIQ conversion

2013-08-05 Thread Terry J. Reedy

Terry J. Reedy added the comment:

I agree. Go ahead and push.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18606] Add statistics module to standard library

2013-08-05 Thread Mark Dickinson

Mark Dickinson added the comment:

> My only objection is to having a class xyz such that isinstance(xyz(..),
> xyz) is false.

Yep.  Use a set of functions (median, median_low);  use an instance of a class 
as Alexander describes;  use a single median function that takes an optional 
"method" parameter;  create a statistics.median subpackage and put the various 
median functions in that.  Any of those options are fairly standard, 
unsurprising, and could reasonably be defended.

But having `median` be a class whose `__new__` returns a float really *is* 
nonstandard and peculiar.  There's just no need for such perversity in what 
should be a straightforward and uncomplicated module.  Special cases aren't 
special enough to break the rules and all that.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18606] Add statistics module to standard library

2013-08-05 Thread Alexander Belopolsky

Alexander Belopolsky added the comment:

On Mon, Aug 5, 2013 at 2:14 PM, Steven D'Aprano wrote:

> > As you say, there's no state to be stored.  So why not simply have
> separate functions `median`, `median_low`, `median_high`, `median_grouped`,
> etc.?
>
> Why have a pseudo-namespace median_* when we could have a real namespace
> median.* ?

I am with Steven on this one.  Note that these functions are expected to be
used interactively and with standard US keyboards "." is much easier to
type than "_".

My only objection is to having a class xyz such that isinstance(xyz(..),
xyz) is false.  While this works with CPython, it may present problems for
other implementations.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18585] Add a text truncation function

2013-08-05 Thread Antoine Pitrou

Antoine Pitrou added the comment:

> Looking just at the proposed functionality (taking a prefix) and
> ignoring the requested complexification :), the usual name for the
> text produced by this process is a
> "lead" (http://en.wikipedia.org/wiki/Wikipedia:Manual_of_Style/Lead_section), 
> although formally a lead is actually written to be used as such, as opposed 
> to just taking a prefix, so that word really has the same problem as 
> 'summarize'.

Good point.

> The placeholder argument could alternatively be named 'ellipsis', but
> placeholder is certainly fine.

I would certainly like ellipsis if it didn't already mean something else
in Python.

> shorten would probably be better if you are going with the expanded
> version, but I like truncate.  It is probably significant that that is
> what the title of the issue calls it :)

I'm a bit negative towards truncate(), mostly because I've worked on the
I/O stack and truncate means something much less careful there (e.g.
StringIO.truncate()).
But really, I'm fine with either shorten() or truncate(). I agree
summarize() may try to look a bit too smart.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2528] Change os.access to check ACLs under Windows

2013-08-05 Thread Tim Golden

Changes by Tim Golden :


Removed file: http://bugs.python.org/file9919/os_access-r62091.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18273] Simplify calling and discovery of json test package

2013-08-05 Thread Ned Deily

Ned Deily added the comment:

Make sure the tests still work when run from an installed Python rather than 
just from a build directory.  In particular, if you rename test directories, 
you will need to change LIBSUBDIRS in Makefile.pre.in to ensure the directories 
and their files are installed.

--
nosy: +ned.deily

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18606] Add statistics module to standard library

2013-08-05 Thread Steven D'Aprano

Steven D'Aprano added the comment:

On 06/08/13 03:08, Mark Dickinson wrote:
>
> I too find the use of a class that'll never be instantiated peculiar.

I'll accept "unusual", but not "peculiar". It's an obvious extension to classes 
being first-class objects. We use classes as objects very frequently, we call 
methods on classes directly (e.g. int.fromhex). This is just a trivial 
variation where I am using a class-as-object as a function.

But if this is really going to be a sticking point, I can avoid using a class. 
I'll make median a plain function. Will that be acceptable?

> As you say, there's no state to be stored.  So why not simply have separate 
> functions `median`, `median_low`, `median_high`, `median_grouped`, etc.?

Why have a pseudo-namespace median_* when we could have a real namespace 
median.* ?

I discussed my reasons for this here:
http://mail.python.org/pipermail/python-ideas/2013-August/022612.html

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18663] In unittest.TestCase.assertAlmostEqual doc specify the delta description

2013-08-05 Thread py.user

New submission from py.user:

http://docs.python.org/3/library/unittest.html#unittest.TestCase.assertAlmostEqual
"If delta is supplied instead of places then the difference between first and 
second must be less (or more) than delta."

--
assignee: docs@python
components: Documentation
files: issue.diff
keywords: patch
messages: 194498
nosy: docs@python, py.user
priority: normal
severity: normal
status: open
title: In unittest.TestCase.assertAlmostEqual doc specify the delta description
type: enhancement
versions: Python 3.4
Added file: http://bugs.python.org/file31167/issue.diff

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18662] re.escape should not escape the hyphen

2013-08-05 Thread James Laver

James Laver added the comment:

Quite right, it does say that in the documentation. The documentation is 
perfectly correct, but the behaviour is wrong in my opinion and as you suggest, 
we should be escaping metacharacters only.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18662] re.escape should not escape the hyphen

2013-08-05 Thread Matthew Barnett

Matthew Barnett added the comment:

The help says:

""">>> help(re.escape)
Help on function escape in module re:

escape(pattern)
Escape all the characters in pattern except ASCII letters, numbers and '_'.
"""

The complementary approach is to escape _only_ the metacharacters.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18662] re.escape should not escape the hyphen

2013-08-05 Thread James Laver

New submission from James Laver:

Traceback (most recent call last):
  File "/Users/jlaver/retest.py", line 6, in test_escape
self.assertEquals(re.escape('-'), '-')
AssertionError: '\\-' != '-'

The only place you can do bad things with hyphens is in a character class. I 
fail to see how you'd be in the situation of wanting to use escape()d data in a 
character class. Even if I could think of a reason to do that, it's decidedly 
not the usual case.

It's http://bugs.python.org/issue2650 all over again, just with a different 
character (in that case, underscore).

While we're at it, what else shouldn't it be escaping?

--
components: Regular Expressions
files: rebugtest.py
messages: 194495
nosy: ezio.melotti, jjl, mrabarnett
priority: normal
severity: normal
status: open
title: re.escape should not escape the hyphen
type: behavior
versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3, Python 
3.4, Python 3.5
Added file: http://bugs.python.org/file31166/rebugtest.py

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18606] Add statistics module to standard library

2013-08-05 Thread Mark Dickinson

Mark Dickinson added the comment:

I too find the use of a class that'll never be instantiated peculiar.

As you say, there's no state to be stored.  So why not simply have separate 
functions `median`, `median_low`, `median_high`, `median_grouped`, etc.?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18661] Typo in grpmodule.c

2013-08-05 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 395ac61ebe1a by Mark Dickinson in branch '2.7':
Issue #18661: typo in grp.struct_group docstring.
http://hg.python.org/cpython/rev/395ac61ebe1a

New changeset 791034a0ae1e by Mark Dickinson in branch '3.3':
Issue #18661: typo in grp.struct_group docstring.  Thanks Vajrasky Kok.
http://hg.python.org/cpython/rev/791034a0ae1e

New changeset f534960c2c02 by Mark Dickinson in branch 'default':
Issue #18661: typo in grp.struct_group docstring (fix merged from 3.3).  Thanks 
Vajrasky Kok.
http://hg.python.org/cpython/rev/f534960c2c02

--
nosy: +python-dev

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18661] Typo in grpmodule.c

2013-08-05 Thread Mark Dickinson

Mark Dickinson added the comment:

Fixed.  Thanks for the report!

--
resolution:  -> fixed
stage:  -> committed/rejected
status: open -> closed
type:  -> behavior
versions: +Python 2.7, Python 3.3

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18606] Add statistics module to standard library

2013-08-05 Thread Mark Dickinson

Changes by Mark Dickinson :


--
nosy: +mark.dickinson

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17372] provide pretty printer for xml.etree.ElementTree

2013-08-05 Thread Laszlo Papp

Laszlo Papp added the comment:

This has just made me switching away from xml.etree.ElementTree today, sadly.

What a pity; it would have been all kind of cool to stick to this minimal, 
otherwise working parser and builder.

--
nosy: +lpapp

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2528] Change os.access to check ACLs under Windows

2013-08-05 Thread Tim Golden

Tim Golden added the comment:

... and to answer Amaury's question in msg109871 it creates a reasonable 
consistency between the results of os.access and the user's actual ability to 
read / write a file. eg, you might have no permissions whatsoever on the file 
but as long as it wasn't read-only, os.access would return True for reading, 
writing and executing.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2528] Change os.access to check ACLs under Windows

2013-08-05 Thread Tim Golden

Tim Golden added the comment:

Here's an updated patch against trunk with tests & doc changes

--
status: languishing -> open
Added file: http://bugs.python.org/file31165/issue2528.2.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18606] Add statistics module to standard library

2013-08-05 Thread Steven D'Aprano

Steven D'Aprano added the comment:

On 03/08/13 13:22, Alexander Belopolsky wrote:
>
> Alexander Belopolsky added the comment:
>
> The implementation of median and mode families of functions as classes is 
> clever,

So long as it is not too clever.

> but I am not sure it is a good idea to return something other than an 
> instance of the class from __new__().

Returning foreign instances is supported behaviour for __new__. (If the object 
returned from __new__ is not an instance, __init__ is not called.) I believe 
the current implementation is reasonable and prefer to keep it. If I use the 
traditional implementation, there will only be one instance, with no state, 
only methods. That's a rather poor excuse for an instance, and a class already 
is a singleton object with methods and (in this case) no state, so creating an 
instance as well adds nothing.

I will change the implementation if the consensus among senior devs is against 
it, but would prefer not to.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18472] Update PEP 8 to encourage modern conventions

2013-08-05 Thread Ezio Melotti

Ezio Melotti added the comment:

I'm a bit late but I still have a few comments:

+  The paren-using form also means that when the exception arguments are
+  long or include string formatting, you don't need to use line
+  continuation characters thanks to the containing parentheses.

This paragraph doesn't add much and could be removed IMHO.


+- When binding caught exceptions to a name, prefer the explicit name
+  binding syntax added in Python 2.6::
+
+  try:
+  process_data()
+  except Exception as exc:
+  raise DataProcessingFailedError(str(exc))

It took me a bit to realize that this is talking about "as".  I think it would 
be better to be more explicit, and simplify the example a bit so that it's not 
as distracting.


+  Note that in Python 3, ``unicode`` and ``basestring`` no longer exist
+  (there is only ``str``) and a bytes object is no longer a kind of
+  string (it is a sequence of integers instead)

Is there any specific reason to use "sequence of integers" instead of "sequence 
of bytes"?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18585] Add a text truncation function

2013-08-05 Thread R. David Murray

R. David Murray added the comment:

Looking just at the proposed functionality (taking a prefix) and ignoring the 
requested complexification :), the usual name for the text produced by this 
process is a "lead" 
(http://en.wikipedia.org/wiki/Wikipedia:Manual_of_Style/Lead_section), although 
formally a lead is actually written to be used as such, as opposed to just 
taking a prefix, so that word really has the same problem as 'summarize'.

I think 'truncate' would be a better name.  Or, if you don't mind being 
wordier, extract_prefix.  The fact that it is part of the textwrap module 
should be enough clue that the truncation happens at whitespace.  Truncate 
could also apply to the expanded version if you squint a little, if Antoine is 
interested in that.  On the other hand, the use case presented for that is not 
going to be served by this function anyway, since this function (being part of 
textwrap) breaks on whitespace...it shouldn't (IMO) elide text other than at 
whitespace.  If you want that functionality it belongs in some other module, I 
think.

The placeholder argument could alternatively be named 'ellipsis', but 
placeholder is certainly fine.

shorten would probably be better if you are going with the expanded version, 
but I like truncate.  It is probably significant that that is what the title of 
the issue calls it :)

--
nosy: +r.david.murray

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18659] test_precision in test_format.py is not executed and has unused variable

2013-08-05 Thread Vajrasky Kok

Vajrasky Kok added the comment:

Okay, I guess the fix for this ticket should be kept simple.

If we want to merge the exception message or touch the code base or do 
something smarter than fixing the test, maybe we should create a separate 
ticket.

So I used Serhiy Storchaka's suggestion to use _testcapi.INT_MAX for the second 
patch.

--
Added file: http://bugs.python.org/file31164/test_precision_v2.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18585] Add a text truncation function

2013-08-05 Thread Ezio Melotti

Ezio Melotti added the comment:

Perhaps "shorten" would be a better name -- "summarize" sounds smarter than it 
actually is :)

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18585] Add a text truncation function

2013-08-05 Thread Ezio Melotti

Ezio Melotti added the comment:

[...] and ASCII are fine with me.

> Perhaps there could be an argument controlling where to truncate
> (left, right or centre). A good use-case for the new Enums, perhaps? :-)

I wrote a similar function once and in addition to the width it had this 
feature too (defaulting on "center"), so it sounds like a reasonable addition 
to me.  Back then I was simply passing a "left"/"right"/"center" string -- not 
sure it's worth adding an enum for this (FWIW for text alignment there are 3 
separate methods: ljust, center, and rjust).

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18078] threading.Condition to allow notify on a specific waiter

2013-08-05 Thread João Bernardo

João Bernardo added the comment:

Seems like "just because I never used I don't support". Boost C++ libraries has 
a wait_for_any functionality to synchronize futures. C# has a WaitAny in the 
WaitHandle class (like our Condition).

Another problem is: the Condition class cannot be easily subclassed because all 
the important bits are _protected... Can you add an interface for the 
"_waiters" list and "_lock" objects?? If you do that I'll be happy subclassing 
it.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14323] Normalize math precision in RGB/YIQ conversion

2013-08-05 Thread Ezio Melotti

Ezio Melotti added the comment:

LGTM.

--
stage: patch review -> commit review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18273] Simplify calling and discovery of json test package

2013-08-05 Thread Ezio Melotti

Ezio Melotti added the comment:

I like the patch.
Can you make "./python Lib/test/test_json/" work too?  Currently it doesn't 
seem to work (it works for e.g. "./python Lib/test/test_email/").

--
stage:  -> patch review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18659] test_precision in test_format.py is not executed and has unused variable

2013-08-05 Thread Vajrasky Kok

Vajrasky Kok added the comment:

For the passers-by who want to help:

The "precision too big" exception is raised in Python/formatter_unicode.c line 
1168 and 1002.

The "Too many decimal digits..." exception is raised in 
Python/formatter_unicode.c line 71.

So the question is whether it is beneficial to differentiate the exception 
message. If not, we can change the exception message or test whether the digit 
passes INT_MAX first before checking with sys.max_size. If yes, we need to add 
test case for sys.max_size and use _testcapi.INT_MAX for current unit test case.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18659] test_precision in test_format.py is not executed and has unused variable

2013-08-05 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

We have _testcapi.INT_MAX.

I guess different exceptions raised on 64-bit platform. First parser checks 
that a number can be represented as Py_ssize_t (i.e. <= PY_SSIZE_T_MAX). Here 
"Too many decimal digits in format string" can be raised. Then precision passed 
to internal function which accepts int and checked to be <= INT_MAX before cast 
to int. Here "precision too big" can be raised.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18659] test_precision in test_format.py is not executed and has unused variable

2013-08-05 Thread STINNER Victor

STINNER Victor added the comment:

I added the test in the following commit:

changeset:   84266:ef5175d08e7e
branch:  3.3
parent:  84263:7ecca1a98220
user:Victor Stinner 
date:Sun Jun 23 14:54:30 2013 +0200
files:   Lib/test/test_format.py Misc/NEWS Python/formatter_unicode.c
description:
Issue #18137: Detect integer overflow on precision in float.__format__() and
complex.__format__().

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18659] test_precision in test_format.py is not executed and has unused variable

2013-08-05 Thread STINNER Victor

STINNER Victor added the comment:

The IN module must not be used, it is hardcoded and never regenerated.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13083] _sre: getstring() releases the buffer before using it

2013-08-05 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Agree.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13083] _sre: getstring() releases the buffer before using it

2013-08-05 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
resolution:  -> duplicate
stage:  -> committed/rejected
status: open -> closed
superseder:  -> Segfault when using re.finditer over mmap

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18659] test_precision in test_format.py is not executed and has unused variable

2013-08-05 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
nosy: +haypo, serhiy.storchaka

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18515] zipfile._ZipDecryptor generates wasteful crc32 table on import

2013-08-05 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

The objection to zipfile-no-crc32.patch is that binascii.crc32() and _crc32() 
have different signatures. binascii.crc32() accepts a byte object while 
_crc32() accepts a single integer. With packing this value into a bytes object 
_crc32() will be much slower.

As for zdlazy.patch, there is a proposed patch in issue10030 which speedups 
pure Python decryption. I'm afraid that with zdlazy.patch this path will lose a 
part of it's speedup.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18652] Add itertools.first_true (return first true item in iterable)

2013-08-05 Thread Hynek Schlawack

Hynek Schlawack added the comment:

> +1 on the name 'first_true'.  Does exactly what it says on the tin.

I fully agree.

***

I assume what's missing now is a permission from Raymond to mess with his turf?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18652] Add itertools.first_true (return first true item in iterable)

2013-08-05 Thread Mark Dickinson

Mark Dickinson added the comment:

+1 on the name 'first_true'.  Does exactly what it says on the tin.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18659] test_precision in test_format.py is not executed and has unused variable

2013-08-05 Thread Vajrasky Kok

Vajrasky Kok added the comment:

For now, instead of hardcoding INT_MAX to 2147483647 in test, maybe we can use 
module:

>>> import IN
>>> IN.INT_MAX
2147483647

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18660] os.read behavior on Linux

2013-08-05 Thread Ronald Oussoren

Changes by Ronald Oussoren :


--
nosy: +ronaldoussoren

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18659] test_precision in test_format.py is not executed and has unused variable

2013-08-05 Thread Vajrasky Kok

Vajrasky Kok added the comment:

Let me help you to debug this issue.

ethan@amiau:~/Documents/code/python/cpython$ cat /tmp/a.py
import sys

INT_MAX = sys.maxsize
f = 1.2
format(f, ".%sf" % (INT_MAX + 1))
ethan@amiau:~/Documents/code/python/cpython$ ./python /tmp/a.py
Traceback (most recent call last):
  File "/tmp/a.py", line 5, in 
format(f, ".%sf" % (INT_MAX + 1))
ValueError: Too many decimal digits in format string
ethan@amiau:~/Documents/code/python/cpython$ cat /tmp/b.py
import sys

INT_MAX = 2147483647
f = 1.2
format(f, ".%sf" % (INT_MAX + 1))
ethan@amiau:~/Documents/code/python/cpython$ ./python /tmp/b.py
Traceback (most recent call last):
  File "/tmp/b.py", line 5, in 
format(f, ".%sf" % (INT_MAX + 1))
ValueError: precision too big

My question is whether we should have different exception message for these two 
cases?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18659] test_precision in test_format.py is not executed and has unused variable

2013-08-05 Thread Mark Dickinson

Mark Dickinson added the comment:

Sample buildbot output here:

http://buildbot.python.org/all/builders/x86%20RHEL%206%203.x/builds/2485/steps/test/logs/stdio

Relevant snippet:

test_precision (test.test_format.FormatTest) ... FAIL

==
FAIL: test_precision (test.test_format.FormatTest)
--
Traceback (most recent call last):
  File 
"/home/buildbot/buildarea/3.x.coghlan-redhat/build/Lib/test/test_format.py", 
line 338, in test_precision
self.assertEqual(str(cm.exception), "precision too big")
AssertionError: 'Too many decimal digits in format string' != 'precision too 
big'
- Too many decimal digits in format string
+ precision too big


--
Ran 5 tests in 0.011s

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18659] test_precision in test_format.py is not executed and has unused variable

2013-08-05 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 9bee1fd64ee6 by Mark Dickinson in branch 'default':
Issue #18659: Backed out changeset cfd875bcbe41 after buildbot failures.
http://hg.python.org/cpython/rev/9bee1fd64ee6

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18659] test_precision in test_format.py is not executed and has unused variable

2013-08-05 Thread Mark Dickinson

Mark Dickinson added the comment:

Okay, that caused some buildbots to fail.  I'm going to back out the change 
until I have time to figure out what's going on.

--
resolution: fixed -> 
status: closed -> open

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18661] Typo in grpmodule.c

2013-08-05 Thread Mark Dickinson

Mark Dickinson added the comment:

{0} is fine;  some compilers will warn about it, but I believe it's valid C.

--
nosy: +mark.dickinson

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18661] Typo in grpmodule.c

2013-08-05 Thread Vajrasky Kok

New submission from Vajrasky Kok:

I guess, there is a typo in Modules/grpmodule.c. See the patch below:

diff -r f4f81ebc3de9 Modules/grpmodule.c
--- a/Modules/grpmodule.c   Sun Aug 04 15:50:08 2013 -0400
+++ b/Modules/grpmodule.c   Mon Aug 05 17:40:33 2013 +0800
@@ -10,7 +10,7 @@
{"gr_name", "group name"},
{"gr_passwd", "password"},
{"gr_gid", "group id"},
-   {"gr_mem", "group memebers"},
+   {"gr_mem", "group members"},
{0}
 };

I am not sure whether the line after typo should be {0} or {0, 0}.

--
assignee: docs@python
components: Documentation
messages: 194465
nosy: docs@python, vajrasky
priority: normal
severity: normal
status: open
title: Typo in grpmodule.c
versions: Python 3.4

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18659] test_precision in test_format.py is not executed and has unused variable

2013-08-05 Thread Mark Dickinson

Mark Dickinson added the comment:

Fixed.  Thanks!

--
assignee:  -> mark.dickinson
resolution:  -> fixed
stage:  -> committed/rejected
status: open -> closed
type:  -> behavior

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18659] test_precision in test_format.py is not executed and has unused variable

2013-08-05 Thread Roundup Robot

Roundup Robot added the comment:

New changeset cfd875bcbe41 by Mark Dickinson in branch 'default':
Issue #18659: fix test_format test that wasn't being executed.  Thanks Vajrasky 
Kok for the patch.
http://hg.python.org/cpython/rev/cfd875bcbe41

--
nosy: +python-dev

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18659] test_precision in test_format.py is not executed and has unused variable

2013-08-05 Thread Mark Dickinson

Mark Dickinson added the comment:

Patch looks good to me.

--
nosy: +mark.dickinson

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18660] os.read behavior on Linux

2013-08-05 Thread Louis RIVIERE

New submission from Louis RIVIERE:

A call to os.read that used to work on older Linux kernel, doesn't anymore with 
newer Linux kernel.
As a workaroud we can use libc.read (ctypes) instead of os.read.
But I feel like os.read should work, as it used to.

The code (and comments) can be seen here : 
http://code.activestate.com/recipes/576375-low-level-inotify-wrapper/

--
components: IO
messages: 194461
nosy: dugres
priority: normal
severity: normal
status: open
title: os.read behavior on Linux
type: behavior
versions: Python 2.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14323] Normalize math precision in RGB/YIQ conversion

2013-08-05 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

> Can you add a reference for the coefficients?

I have only link to Wikipedia which refers to Code of Federal Regulations 
§73.682. This link (http://en.wikipedia.org/wiki/YIQ) already mentioned at the 
top of the file.

> (You claim about the current rounding is not exactly correct. While .28*g 
> rounds .277 rather than .274, the current .52*g rounds the non-FCC .523 
> rather than the FCC .5251. So I avoided making the claim in the suggested 
> entry. It is not important.)

A sum of coefficients in this line should be 0 (Q=0 for R=G=B).

Patch updated. I added a What's New entry and update to use of unittest.main(), 
rewrite rgb_to_yiq() in the form as in Wikipedia (it uses less multiplications) 
and write coefficients in yiq_to_rgb() with maximal precision (as calculated 
with Python).

--
Added file: http://bugs.python.org/file31163/colorsys_yiq_fcc_2.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18659] test_precision in test_format.py is not executed and has unused variable

2013-08-05 Thread Vajrasky Kok

New submission from Vajrasky Kok:

There is test_precision in Lib/test_format.py which is not being unit tested.

Also, there is a unused variable inside test_precision.

Attached the patch to fix these problems.

--
components: Tests
files: test_precision.patch
keywords: patch
messages: 194459
nosy: vajrasky
priority: normal
severity: normal
status: open
title: test_precision in test_format.py is not executed and has unused variable
versions: Python 3.4
Added file: http://bugs.python.org/file31162/test_precision.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18658] Mercurial CPython log ticket link is broken

2013-08-05 Thread Ned Deily

Ned Deily added the comment:

While it looks unusual, the commit list is fine.  It reflects what you see 
currently in a "hg log".  What happened is that someone imported an older local 
change set or something similar.  It's not always easy to tell from the log.

--
resolution:  -> invalid
stage:  -> committed/rejected
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6057] sqlite3 error classes should be documented

2013-08-05 Thread timm

timm added the comment:

I would find it useful to have the exception classes listed in the Python 
documentation rather than having to refer to two documents, but I don't have 
strong feelings on this.

Given that nobody has fixed this for 4 years, should we just close the ticket? 
I'd be happy to do the necessary work if this is something we want changed, but 
I don't want to prepare a patch for a ticket that's never going to go anywhere.

--
nosy: +timm

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18658] Mercurial CPython log ticket link is broken

2013-08-05 Thread Ezio Melotti

Ezio Melotti added the comment:

This is a separate issue though, isn't it?
Have you tried to ctrl+f5 the page?

(Also this is probably something that should be reported to the Mercurial bug 
tracker, since -- unlike the issue links -- is not something we modified.)

--
nosy: +ezio.melotti

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18658] Mercurial CPython log ticket link is broken

2013-08-05 Thread Vajrasky Kok

Vajrasky Kok added the comment:

Wait, something weird is happening in CPython commits log website, 
http://hg.python.org/cpython .

These are the latest four commits.

age author  description
45 hours agoJason R. Coombs Issue 18532: Added tests and 
documentation to formally specify the .name attribute on hashlib 
objects.default tip
105 minutes ago Raymond Hettinger   Silence compiler warning for 
unused declaration.2.7
11 hours agoR David Murray  Merge: #18657: remove duplicate entries from 
Misc/ACKS. [#18657]
11 hours agoR David Murray  #18657: remove duplicate entries from 
Misc/ACKS. [#18657]3.3

The "age" column is screwed up. 11 hours ago goes to 105 minutes ago then goes 
back to 45 hours ago.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com