[issue8902] add datetime.time.now() for consistency

2012-06-07 Thread anatoly techtonik

anatoly techtonik techto...@gmail.com added the comment:

I'd say no consensus was reached due to lack of participation. My enthusiasm 
was killed by the issue8903 resolution.

My opinion is that:
   datetime.time.now()
is much better than:
   datetime.datetime.now().time()

--

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



[issue8902] add datetime.time.now() for consistency

2012-06-07 Thread anatoly techtonik

anatoly techtonik techto...@gmail.com added the comment:

And I certainly don't agree with you that usability changes in API are not use 
cases.

--

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



[issue15022] types.SimpleNamespace needs to be picklable

2012-06-07 Thread Eric Snow

Eric Snow ericsnowcurren...@gmail.com added the comment:

I've attached a patch that gives types.SimpleNamespace pickle support.  To do 
it I had to change the name of the type from namespace to 
types.SimpleNamespace.  That's fine.

I also added __eq__/__ne__ support so I could use it during tests.

--
keywords: +needs review, patch
stage: needs patch - patch review
versions: +Python 3.3
Added file: http://bugs.python.org/file25855/issue15022_pickle.diff

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



[issue15003] make PyNamespace_New() public

2012-06-07 Thread Eric Snow

Changes by Eric Snow ericsnowcurren...@gmail.com:


--
stage: needs patch - patch review

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



[issue15004] add weakref support to types.SimpleNamespace

2012-06-07 Thread Eric Snow

Changes by Eric Snow ericsnowcurren...@gmail.com:


--
stage: needs patch - patch review

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



[issue15024] Split enhanced assertion support out as a unittest.TestCase base class

2012-06-07 Thread Nick Coghlan

New submission from Nick Coghlan ncogh...@gmail.com:

The unittest module has some lovely enhanced comparison operations, but they're 
currently hard to access outside a test run.

It would be rather convenient if they were split out into a separate base class 
so they could be used directly without needing to create an actual test case.

Possible API:

  class Assertions:
# All the enhanced assertion machinery goes here
# Nothing related to actually running test cases

  class TestCase(Assertions):
# This adds support for setUp, tearDown, addCleanup etc, etc

My current workaround is to just define a dummy runTest method in a subclass 
and use that:

 class Assertions(unittest.TestCase):
... def runTest(self): pass
... 
 check = Assertions()
 check.assertEqual([], ())
Traceback (most recent call last):
  File stdin, line 1, in module
  File /usr/lib64/python2.7/unittest/case.py, line 511, in assertEqual
assertion_func(first, second, msg=msg)
  File /usr/lib64/python2.7/unittest/case.py, line 504, in _baseAssertEqual
raise self.failureException(msg)
AssertionError: [] != ()
 check.assertEqual([1], [2])
Traceback (most recent call last):
  File stdin, line 1, in module
  File /usr/lib64/python2.7/unittest/case.py, line 511, in assertEqual
assertion_func(first, second, msg=msg)
  File /usr/lib64/python2.7/unittest/case.py, line 740, in assertListEqual
self.assertSequenceEqual(list1, list2, msg, seq_type=list)
  File /usr/lib64/python2.7/unittest/case.py, line 722, in assertSequenceEqual
self.fail(msg)
  File /usr/lib64/python2.7/unittest/case.py, line 408, in fail
raise self.failureException(msg)
AssertionError: Lists differ: [1] != [2]

First differing element 0:
1
2

- [1]
+ [2]

--
messages: 162463
nosy: michael.foord, ncoghlan
priority: normal
severity: normal
status: open
title: Split enhanced assertion support out as a unittest.TestCase base class

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



[issue3754] cross-compilation support for python build

2012-06-07 Thread Ray Donnelly

Ray Donnelly mingw.andr...@gmail.com added the comment:

Re Android

Ah of course. In that case, there's always the NDK built by Dmitry (his latest 
is v7 AFAIK):

http://www.crystax.net/en/android/ndk

--

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



[issue3871] cross and native build of python for mingw32 with packaging

2012-06-07 Thread Ray Donnelly

Ray Donnelly mingw.andr...@gmail.com added the comment:

Thanks for the details. I've got more fixes but I want to get the whole thing 
building (at least) before I post them.

--

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



[issue15020] Poor default value for progname

2012-06-07 Thread Antoine Pitrou

Changes by Antoine Pitrou pit...@free.fr:


--
nosy: +loewis
versions: +Python 3.3

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



[issue15024] Split enhanced assertion support out as a unittest.TestCase base class

2012-06-07 Thread Michael Foord

Michael Foord mich...@voidspace.org.uk added the comment:

Why not just instantiate a TestCase instance and use that?

 from unittest import TestCase
 t = TestCase()
 t.assertEqual('foo', 'bar')
Traceback (most recent call last):
  File stdin, line 1, in module
  File /compile/py3k-cpython/Lib/unittest/case.py, line 642, in assertEqual
assertion_func(first, second, msg=msg)
  File /compile/py3k-cpython/Lib/unittest/case.py, line 1021, in 
assertMultiLineEqual
self.fail(self._formatMessage(msg, standardMsg))
  File /compile/py3k-cpython/Lib/unittest/case.py, line 509, in fail
raise self.failureException(msg)
AssertionError: 'foo' != 'bar'
- foo
+ bar

--

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



[issue10037] multiprocessing.pool processes started by worker handler stops working

2012-06-07 Thread Ask Solem

Ask Solem a...@celeryproject.org added the comment:

Well, I still don't know exactly why restarting the socket read made it work, 
but the patch solved an issue where newly started pool processes would be stuck 
in socket read forever (happening to maybe 1/500 new processes)

This and a dozen other pool related fixes are in my billiard fork of 
multiprocessing, e.g. what you
describe in your comment:
# trying res.get() would block forever
works in billiard, where res.get() will raise WorkerLostError in that
case.

https://github.com/celery/billiard/

Earlier commit history for the pool can be found in Celery:
https://github.com/ask/celery/commits/2.5/celery/concurrency/processes/pool.py

My eventual goal is to merge these fixes back into Python, but except
for people using Python 3.x, they would have to use billiard for quite some 
time anyway, so I don't feel in a hurry.


I think this issue can be closed, the worker handler is simply borked and  we 
could open up a new issue deciding how to fix it (merging billiard.Pool or 
someting else).

(btw, Richard, you're sbt? I was trying to find your real name to give
you credit for the no_execv patch in billiard)

--

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



[issue11618] Locks broken wrt timeouts on Windows

2012-06-07 Thread Kristján Valur Jónsson

Kristján Valur Jónsson krist...@ccpgames.com added the comment:

Possibly the patch had a mixup
I'm going to rework it a bit and post as a separate issue.

--
status: open - closed

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



[issue15024] Split enhanced assertion support out as a unittest.TestCase base class

2012-06-07 Thread Nick Coghlan

Nick Coghlan ncogh...@gmail.com added the comment:

Because that doesn't work in 2.x (it fails with a ValueError due to runTest 
being missing) and I forgot you had already changed that behaviour to make it 
more convenient in 3.x :)

--
resolution:  - out of date
status: open - closed

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



[issue15025] httplib and http.client are missing response messages for defined WEBDAV responses, e.g., UNPROCESSABLE_ENTITY (422)

2012-06-07 Thread Craig Loftus

New submission from Craig Loftus cr...@wildknowledge.co.uk:

Calling httplib.responses[httplib.UNPROCESSABLE_ENTITY] in 2.7, or 
http.client.responses[http.client.UNPROCESSABLE_ENTITY] raises KeyError: 422.

The expected behaviour would be to return Unprocessable Entity.

This is the specific issue that I have hit, but the same is true of all the 
WEBDAV status codes that constants are defined for.

--
components: Library (Lib)
messages: 162470
nosy: craigloftus
priority: normal
severity: normal
status: open
title: httplib and http.client are missing response messages for defined WEBDAV 
responses, e.g., UNPROCESSABLE_ENTITY (422)
type: behavior
versions: Python 2.7, Python 3.4

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



[issue9256] plistlib should create non-naïve datetime objects

2012-06-07 Thread R. David Murray

R. David Murray rdmur...@bitdance.com added the comment:

An alternative is to do what the email package in 3.3 does, and treat naive 
datetimes as exactly UTC referenced but with no information as to what local 
timezone they originated in.  Either way, a program using the plistlib is 
going to have to know about this and handle the distinction itself, since as 
you say datetime doesn't have a way to make this differentiation (other than 
naive vs aware).  So it needs to be documented clearly if it isn't already.

--

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



[issue8084] pep-0370 on osx duplicates existing functionality

2012-06-07 Thread Daniel Holth

Daniel Holth dho...@fastmail.fm added the comment:

Please mention Apple's OS X Python behavior in the PEP. The Python that comes 
with OS X Lion doesn't seem to follow the PEP regarding ~/.local ; this 
deserves a mention.

--
nosy: +dholth

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



[issue15026] Faster UTF-16 encoding

2012-06-07 Thread Serhiy Storchaka

New submission from Serhiy Storchaka storch...@gmail.com:

In pair to issue14624 here is a patch than speed up UTF-16 encoding in several 
times. In addition, it fixes an unsafe check of an integer overflow.

Here are the results of benchmarking. See benchmark tools in 
https://bitbucket.org/storchaka/cpython-stuff repository.

On 32-bit Linux, AMD Athlon 64 X2 4600+ @ 2.4GHz:

Py2.7Py3.2Py3.3patched

457 (+575%)  458 (+573%)  1077 (+186%) 3083   encode  utf-16le  'A'*1
457 (+579%)  493 (+529%)  1084 (+186%) 3102   encode  utf-16le  '\x80'*1
489 (+534%)  458 (+577%)  1081 (+187%) 3102   encode  utf-16le
'\x80'+'A'*
457 (+1261%) 493 (+1161%) 1116 (+457%) 6219   encode  utf-16le  '\u0100'*1
489 (+1266%) 458 (+1358%) 1126 (+493%) 6678   encode  utf-16le
'\u0100'+'A'*
489 (+1263%) 458 (+1355%) 1129 (+490%)    encode  utf-16le
'\u0100'+'\x80'*
457 (+1240%) 493 (+1142%) 1118 (+448%) 6125   encode  utf-16le  '\u8000'*1
489 (+1271%) 458 (+1363%) 1127 (+495%) 6702   encode  utf-16le
'\u8000'+'A'*
489 (+1271%) 458 (+1364%) 1129 (+494%) 6705   encode  utf-16le
'\u8000'+'\x80'*
489 (+1135%) 458 (+1218%) 1136 (+432%) 6038   encode  utf-16le
'\u8000'+'\u0100'*
498 (+128%)  505 (+125%)  630 (+80%)   1137   encode  utf-16le  
'\U0001'*1
489 (+35%)   458 (+44%)   360 (+83%)   659encode  utf-16le
'\U0001'+'A'*
489 (+35%)   458 (+44%)   359 (+84%)   660encode  utf-16le
'\U0001'+'\x80'*
489 (+36%)   458 (+45%)   361 (+84%)   663encode  utf-16le
'\U0001'+'\u0100'*
489 (+36%)   458 (+45%)   361 (+84%)   663encode  utf-16le
'\U0001'+'\u8000'*

447 (+507%)  493 (+450%)  1086 (+150%) 2712   encode  utf-16be  'A'*1
447 (+513%)  493 (+456%)  1080 (+154%) 2739   encode  utf-16be  '\x80'*1
489 (+458%)  458 (+496%)  1079 (+153%) 2729   encode  utf-16be
'\x80'+'A'*
447 (+498%)  494 (+441%)  1118 (+139%) 2672   encode  utf-16be  '\u0100'*1
489 (+464%)  458 (+502%)  1128 (+144%) 2756   encode  utf-16be
'\u0100'+'A'*
489 (+463%)  458 (+502%)  1131 (+144%) 2755   encode  utf-16be
'\u0100'+'\x80'*
447 (+500%)  493 (+444%)  1119 (+139%) 2680   encode  utf-16be  '\u8000'*1
489 (+463%)  458 (+502%)  1126 (+145%) 2755   encode  utf-16be
'\u8000'+'A'*
489 (+464%)  458 (+502%)  1129 (+144%) 2757   encode  utf-16be
'\u8000'+'\x80'*
489 (+479%)  458 (+518%)  1137 (+149%) 2829   encode  utf-16be
'\u8000'+'\u0100'*
499 (+102%)  506 (+99%)   630 (+60%)   1009   encode  utf-16be  
'\U0001'*1
489 (+6%)458 (+13%)   360 (+44%)   519encode  utf-16be
'\U0001'+'A'*
489 (+6%)458 (+13%)   359 (+44%)   518encode  utf-16be
'\U0001'+'\x80'*
489 (+6%)458 (+13%)   361 (+44%)   519encode  utf-16be
'\U0001'+'\u0100'*
489 (+6%)458 (+13%)   361 (+44%)   519encode  utf-16be
'\U0001'+'\u8000'*

--
components: Interpreter Core, Unicode
files: encode-utf16.patch
keywords: patch
messages: 162473
nosy: Arfrever, asvetlov, ezio.melotti, haypo, pitrou, storchaka
priority: normal
severity: normal
status: open
title: Faster UTF-16 encoding
type: performance
versions: Python 3.3
Added file: http://bugs.python.org/file25856/encode-utf16.patch

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



[issue15027] Faster UTF-32 encoding

2012-06-07 Thread Serhiy Storchaka

New submission from Serhiy Storchaka storch...@gmail.com:

In pair to issue14625 here is a patch than speed up UTF-32 encoding in several 
times. In addition, it fixes an unsafe check of an integer overflow.

Here are the results of benchmarking. See benchmark tools in 
https://bitbucket.org/storchaka/cpython-stuff repository.

On 32-bit Linux, AMD Athlon 64 X2 4600+ @ 2.4GHz:

Py2.7Py3.2Py3.3patched

541 (+1032%) 541 (+1032%) 844 (+626%)  6125   encode  utf-32le  'A'*1
543 (+1056%) 541 (+1060%) 844 (+643%)  6275   encode  utf-32le  '\x80'*1
544 (+1010%) 542 (+1014%) 843 (+616%)  6037   encode  utf-32le
'\x80'+'A'*
541 (+799%)  542 (+797%)  764 (+537%)  4864   encode  utf-32le  '\u0100'*1
544 (+781%)  542 (+784%)  767 (+525%)  4793   encode  utf-32le
'\u0100'+'A'*
544 (+789%)  542 (+792%)  766 (+531%)  4834   encode  utf-32le
'\u0100'+'\x80'*
542 (+799%)  541 (+801%)  764 (+538%)  4874   encode  utf-32le  '\u8000'*1
544 (+779%)  542 (+782%)  767 (+523%)  4780   encode  utf-32le
'\u8000'+'A'*
544 (+793%)  542 (+796%)  766 (+534%)  4859   encode  utf-32le
'\u8000'+'\x80'*
544 (+819%)  542 (+823%)  766 (+553%)  5001   encode  utf-32le
'\u8000'+'\u0100'*
430 (+867%)  427 (+874%)  860 (+383%)  4157   encode  utf-32le  
'\U0001'*1
543 (+655%)  543 (+655%)  861 (+376%)  4101   encode  utf-32le
'\U0001'+'A'*
543 (+658%)  543 (+658%)  861 (+378%)  4116   encode  utf-32le
'\U0001'+'\x80'*
543 (+670%)  543 (+670%)  859 (+387%)  4180   encode  utf-32le
'\U0001'+'\u0100'*
543 (+666%)  543 (+666%)  860 (+383%)  4158   encode  utf-32le
'\U0001'+'\u8000'*

541 (+880%)  543 (+876%)  844 (+528%)  5300   encode  utf-32be  'A'*1
541 (+872%)  542 (+870%)  844 (+523%)  5256   encode  utf-32be  '\x80'*1
544 (+843%)  542 (+846%)  843 (+509%)  5130   encode  utf-32be
'\x80'+'A'*
541 (+363%)  542 (+362%)  764 (+228%)  2505   encode  utf-32be  '\u0100'*1
544 (+366%)  542 (+368%)  766 (+231%)  2534   encode  utf-32be
'\u0100'+'A'*
544 (+363%)  542 (+365%)  766 (+229%)  2519   encode  utf-32be
'\u0100'+'\x80'*
542 (+363%)  541 (+364%)  764 (+228%)  2509   encode  utf-32be  '\u8000'*1
544 (+366%)  542 (+368%)  766 (+231%)  2534   encode  utf-32be
'\u8000'+'A'*
544 (+363%)  542 (+364%)  766 (+229%)  2517   encode  utf-32be
'\u8000'+'\x80'*
544 (+372%)  542 (+374%)  766 (+235%)  2568   encode  utf-32be
'\u8000'+'\u0100'*
430 (+428%)  427 (+432%)  860 (+164%)  2270   encode  utf-32be  
'\U0001'*1
543 (+317%)  541 (+318%)  861 (+163%)  2262   encode  utf-32be
'\U0001'+'A'*
543 (+320%)  541 (+321%)  861 (+165%)  2279   encode  utf-32be
'\U0001'+'\x80'*
543 (+322%)  541 (+323%)  859 (+167%)  2290   encode  utf-32be
'\U0001'+'\u0100'*
543 (+322%)  541 (+324%)  860 (+167%)  2292   encode  utf-32be
'\U0001'+'\u8000'*

--
components: Interpreter Core, Unicode
files: encode-utf32.patch
keywords: patch
messages: 162474
nosy: Arfrever, asvetlov, ezio.melotti, haypo, pitrou, storchaka
priority: normal
severity: normal
status: open
title: Faster UTF-32 encoding
type: performance
versions: Python 3.3
Added file: http://bugs.python.org/file25857/encode-utf32.patch

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



[issue11354] argparse: nargs could accept range of options count

2012-06-07 Thread Alex Frase

Alex Frase fr...@cs.wisc.edu added the comment:

I'm new here so I apologize if this is considered poor etiquette, but I'm just 
commenting to 'bump' this issue.  My search for a way to accomplish exactly 
this functionality led me here, and it seems a patch was offered but no action 
has been taken on it for over a year now.  Alas, it seems I must write a custom 
Action handler instead.

--
nosy: +atfrase

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



[issue14185] Failure to build _dbm with ndbm on Arch Linux

2012-06-07 Thread su

su purepurple2...@yahoo.com added the comment:

Same thing happens with pyhton-3.2.3 on fedora 17

*** WARNING: renaming _dbm since importing it failed: 
build/lib.linux-x86_64-3.2/_dbm.cpython-32m.so: undefined symbol: dbm_nextkey

Failed to build these modules:
_dbm

--
nosy: +su715

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



[issue15023] listextend (and therefore list.extend and list.__init__) peek at len before iter

2012-06-07 Thread Benjamin Peterson

Benjamin Peterson benja...@python.org added the comment:

It's an optimization. No one says we can't call __len__().

--
nosy: +benjamin.peterson

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



[issue4442] document immutable type subclassing via __new__

2012-06-07 Thread Mateusz Loskot

Changes by Mateusz Loskot mate...@loskot.net:


--
nosy: +mloskot

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



[issue15028] PySys_SetArgv escapes quotes in argv[]

2012-06-07 Thread R.M.Bianchi

New submission from R.M.Bianchi riccardomaria.bian...@gmail.com:

Embedding Python in C++ I saw that if I pass this string below to the 
PySys_SetArgv, as one of the command-line arguments passed to an embedded 
script:

--net-label-name='(DC1,eth1)'

PySys_Argv transforms it escaping the single quotes, and in the Python side I 
get this value for sys.argv[i]:

'--net-label-name=\'(DC1,eth1)\''

It does not seem a problem of converting strings or char in the C++ sides, I 
checked them.

The problem appears just after the PySys_Argv call.

=== cut ===
Qt-Debug: python script command-line args: 
(/afs/cern.ch/work/r/rbianchi/private/tdaq_4_0_0/dbe/cmt/pm_farm.py, 
--safe-hw-tags, --add='pcatd143', --net-label-name='(DC1,eth1)', 
newdb.data.xml)
[...]
pyout: sys.argv:
pyout:
pyout: ['/afs/cern.ch/work/r/rbianchi/private/tdaq_4_0_0/dbe/cmt/pm_farm.py', 
'--safe-hw-tags', --add='pcatd143', '--net-label-name=\'(DC1,eth1)\'', 
'newdb.data.xml']
=== cut ===

Please notice that the same script works perfectly with the same argument list 
in stand-alone mode (i.e. not embedded in C++).

Please also notice that in the embedded side the problem does not appear if I 
substitute the string passed as command line parameter from the original one:

--net-label-name='(DC1,eth1)'

to this one below, where I omit a level of quotes and I skip the double quotes:

--net-label-name=('DC1','eth1')

In this last case the embedded script also works fine in the embedded world.

It seems to me an issue in PySys_SetArgv, while parsing the strings. But maybe 
I'm missing something.

Best regards,

  R.M.Bianchi

--
components: Interpreter Core
messages: 162478
nosy: RMBianchi
priority: normal
severity: normal
status: open
title: PySys_SetArgv escapes quotes in argv[]
type: behavior
versions: Python 2.6

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



[issue4442] document immutable type subclassing via __new__

2012-06-07 Thread Mateusz Loskot

Mateusz Loskot mate...@loskot.net added the comment:

Is this report about documenting of the concept of immutable types in Python in 
general or regarding existing built-in types, like datetime.datetime?

Generally, the concept of immutable type with relation to tp_new is mentioned 
(sneaked) here:

1) http://docs.python.org/release/3.2.2/c-api/typeobj.html

A good rule of thumb is that for immutable types, all initialization should 
take place in tp_new, while for mutable types, most initialization should be 
deferred to tp_init.

2) http://www.python.org/dev/peps/pep-0253/

Note that for immutable object types, the initialization
cannot be done by the tp_init() slot: this would provide the Python 
user with a way to change the initialization.  Therefore, immutable
objects typically have an empty tp_init() implementation and do
all their initialization in their tp_new() slot.

IMHO, it deserves a dedicated section/chapter in the docs.

--

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



[issue15029] Update Defining New Types chapter according to PEP 253

2012-06-07 Thread Mateusz Loskot

New submission from Mateusz Loskot mate...@loskot.net:

The chapter '2. Defining New Types in the Python 3.2 documentation [1] does 
not cover all important elements, especially in the subsection 2.1.4. 
Subclassing other types.

The accepted PEP 253 [2] provides much more detailed and thorough explanation 
for Python C API users willing to define and subclass new types, than the 
official manual.

I'd like to suggest update of the manual with information enclosed in the PEP 
253. In fact, the PEP's sections like

* Preparing a type for subtyping
* Creating a subtype of a built-in type in C

could be copied with little editing, IMHO.

The PEP 253 really seems to be a must-read document for Python C API users.

[1] http://docs.python.org/release/3.2.2/extending/newtypes.html
[2] http://www.python.org/dev/peps/pep-0253/

--
assignee: docs@python
components: Documentation
messages: 162480
nosy: docs@python, mloskot
priority: normal
severity: normal
status: open
title: Update Defining New Types chapter according to PEP 253
type: enhancement
versions: Python 3.2

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



[issue15029] Update Defining New Types chapter according to PEP 253

2012-06-07 Thread Mateusz Loskot

Mateusz Loskot mate...@loskot.net added the comment:

Similar request has been rejected in response to the Issue 621526 [1],
but I'm not proposing to include PEP into docs, but to update and improve docs 
with material discussed in accepted PEPs. 

[1] http://bugs.python.org/issue621526

--

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



[issue621526] docs do not include spec info from PEPs

2012-06-07 Thread Mateusz Loskot

Mateusz Loskot mate...@loskot.net added the comment:

I reported issue 15029 [1] which may be related to this one.

[1] http://bugs.python.org/issue15029

--
nosy: +mloskot

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



[issue14908] datetime.datetime should have a timestamp() method

2012-06-07 Thread Alexander Belopolsky

Alexander Belopolsky alexander.belopol...@gmail.com added the comment:

Updated patch adds a few more tests and improves error handling in C 
implementation.

--
nosy: +haypo
Added file: http://bugs.python.org/file25858/issue14908.diff

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



[issue14908] datetime.datetime should have a timestamp() method

2012-06-07 Thread Alexander Belopolsky

Changes by Alexander Belopolsky alexander.belopol...@gmail.com:


Removed file: http://bugs.python.org/file25854/issue14908.diff

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



[issue15021] xmlrpc server hangs

2012-06-07 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc amaur...@gmail.com added the comment:

What kind of xmlrpc server do you run?  And how exactly?
Try to set a timeout to all sockets:
   socket.setdefaulttimeout(10)
Does this change something? Which exception (and traceback) do you get?

--
nosy: +amaury.forgeotdarc

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



[issue11823] disassembly needs argument counts on calls with keyword args

2012-06-07 Thread Alexander Belopolsky

Alexander Belopolsky alexander.belopol...@gmail.com added the comment:

Bumping priority as a reminder to get this in.

--
priority: normal - high

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



[issue15030] PyPycLoader can't read cached .pyc files

2012-06-07 Thread Ronan Lamy

New submission from Ronan Lamy ronan.l...@gmail.com:

PyPycLoader can't read or write .pyc files created by the core import 
machinery. I'm attaching a failing test case demonstrating the issue: if you 
import a .py file using standard mechanisms, thus creating a .pyc, and then (in 
a separate process, say) attempt to make use of that cached file with 
PyPycLoader, the import fails with 'ValueError: bad marshal data (unknown type 
code)'.

It looks like that there has been a change in the binary format of .pyc files 
but PyPycLoader wasn't updated.

--
components: Library (Lib)
files: test_PyPyc.diff
keywords: patch
messages: 162486
nosy: Ronan.Lamy, brett.cannon
priority: normal
severity: normal
status: open
title: PyPycLoader can't read cached .pyc files
type: behavior
versions: Python 3.3
Added file: http://bugs.python.org/file25859/test_PyPyc.diff

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



[issue11823] disassembly needs argument counts on calls with keyword args

2012-06-07 Thread Roundup Robot

Roundup Robot devn...@psf.upfronthosting.co.za added the comment:

New changeset 22dc0a433b0e by Alexander Belopolsky in branch 'default':
Issue #11823: disassembly now shows argument counts on calls with keyword args
http://hg.python.org/cpython/rev/22dc0a433b0e

--
nosy: +python-dev

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



[issue11823] disassembly needs argument counts on calls with keyword args

2012-06-07 Thread Alexander Belopolsky

Changes by Alexander Belopolsky alexander.belopol...@gmail.com:


--
stage: needs patch - committed/rejected
type: behavior - enhancement
versions:  -Python 2.7, Python 3.1, Python 3.2

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



[issue11823] disassembly needs argument counts on calls with keyword args

2012-06-07 Thread Alexander Belopolsky

Changes by Alexander Belopolsky alexander.belopol...@gmail.com:


--
status: open - closed

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



[issue15030] PyPycLoader can't read cached .pyc files

2012-06-07 Thread Jesús Cea Avión

Jesús Cea Avión j...@jcea.es added the comment:

Ronan, can you confirm if 2.7 or 3.2 are affected too?

--
nosy: +jcea

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



[issue15031] Split .pyc parsing from module loading

2012-06-07 Thread Ronan Lamy

New submission from Ronan Lamy ronan.l...@gmail.com:

I think it would be beneficial to extract the handling of the binary format of 
bytecode files from the rest of the loader/finder code in importlib._bootstrap. 
That means exposing, internally at least, functions that do nothing more than 
convert the binary contents of a .pyc file to/from metadata + code object. They 
would help in testing and implementing alternate loaders and would prevent the 
kind of code duplication that led to issue 15030.

I'm adding a patch implementing extracting a _loads_pyc() function from 
_bytes_to_bytecode(). Note that:

* _loads_pyc() has only one parameter, instead of 5 for _bytes_from_bytecode.
* The raising of exceptions is more consistent: _loads_pyc being an IO helper, 
it never raises ImportError. Thanks to exception chaining, no information is 
lost, though.

Obviously, this should be complemented with a _dumps_pyc(). Then there's the 
question of whether these functions should be public and what the best 
interface is - I actually feel that the natural home of both functions is in a 
lower level module, either imp or marshal.

So, should I get on with it, or are there things I overlooked that make this a 
bad idea?

--
components: Interpreter Core
files: loads_pyc.diff
keywords: patch
messages: 162489
nosy: Ronan.Lamy, brett.cannon, ncoghlan
priority: normal
severity: normal
status: open
title: Split .pyc parsing from module loading
type: enhancement
versions: Python 3.3
Added file: http://bugs.python.org/file25860/loads_pyc.diff

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



[issue15023] listextend (and therefore list.extend and list.__init__) peek at len before iter

2012-06-07 Thread R. David Murray

Changes by R. David Murray rdmur...@bitdance.com:


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

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



[issue14635] telnetlib uses select instead of poll - limited to FD_SETSIZE fds

2012-06-07 Thread Akintayo Holder

Akintayo Holder akint...@google.com added the comment:

Is my approach ok or is the plan to follow  neologix's suggestion and make one 
fix that works for all the select.select issues.

--

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



[issue15030] PyPycLoader can't read cached .pyc files

2012-06-07 Thread Ronan Lamy

Ronan Lamy ronan.l...@gmail.com added the comment:

2.7 doesn't have PyPycLoader. For 3.2, it's such a pain to create a working 
concrete subclass of PyPycLoader that I gave up. But just by reading the code, 
it doesn't seem affected, as there's no discrepancy with importlib._bootstrap: 
they both consider that metadata are the first 8 bytes (in default, _bootstrap 
switched to using 12 bytes).

--

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



[issue15028] PySys_SetArgv escapes quotes in argv[]

2012-06-07 Thread R. David Murray

R. David Murray rdmur...@bitdance.com added the comment:

Could you please clarify the inputs and outputs.  I can't tell from your 
description what exact byte string you are passing in from C++ or what exact 
string you are seeing on the Python side.  For example, if:

  '--net-label-name=\'(DC1,eth1)\''

is the python repr of a string, it is equivalent to the ASCII byte sequence:

  --net-label-name='(DC1,eth1)'

Most likely that is what you are passing in from C++, in which case everything 
seems to be to be working as expected.  So if that is not the case, please 
clarify.

--
nosy: +r.david.murray

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



[issue13854] multiprocessing: SystemExit from child with non-int, non-str arg causes TypeError

2012-06-07 Thread Roundup Robot

Roundup Robot devn...@psf.upfronthosting.co.za added the comment:

New changeset 4346cba353b4 by Richard Oudkerk in branch '3.2':
Issue #13854: Properly handle non-integer, non-string arg to SystemExit
http://hg.python.org/cpython/rev/4346cba353b4

New changeset 3585cb1388f2 by Richard Oudkerk in branch 'default':
Merge fixes for #13854 and #12157.
http://hg.python.org/cpython/rev/3585cb1388f2

New changeset da5b370f41a1 by Richard Oudkerk in branch '2.7':
Issue #13854: Properly handle non-integer, non-string arg to SystemExit
http://hg.python.org/cpython/rev/da5b370f41a1

--
nosy: +python-dev

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



[issue12157] join method of multiprocessing Pool object hangs if iterable argument of pool.map is empty

2012-06-07 Thread Roundup Robot

Roundup Robot devn...@psf.upfronthosting.co.za added the comment:

New changeset 1b3d4ffcb4d1 by Richard Oudkerk in branch '3.2':
Issue #12157: pool.map() does not handle empty iterable correctly
http://hg.python.org/cpython/rev/1b3d4ffcb4d1

New changeset 3585cb1388f2 by Richard Oudkerk in branch 'default':
Merge fixes for #13854 and #12157.
http://hg.python.org/cpython/rev/3585cb1388f2

New changeset 7ab7836894c4 by Richard Oudkerk in branch '2.7':
Issue #12157: pool.map() does not handle empty iterable correctly
http://hg.python.org/cpython/rev/7ab7836894c4

--
nosy: +python-dev

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



[issue10037] multiprocessing.pool processes started by worker handler stops working

2012-06-07 Thread Richard Oudkerk

Richard Oudkerk shibt...@gmail.com added the comment:

 I think this issue can be closed, the worker handler is simply borked and  
 we could open up a new issue deciding how to fix it (merging billiard.Pool 
 or someting else).

OK.  I am not sure which option under Resolution should be chosen.  Later?

 (btw, Richard, you're sbt?

Yes.

 I was trying to find your real name to give you credit for the no_execv 
 patch in billiard)

The execv stuff certainly won't go in by Py3.3.  There has not been consensus 
that adding it is a good idea.

(I also have the unit tests passing with a fork server: the server process is 
forked at the beginning of the program and then forked children of the server 
process are started on request.  It is about 10 times faster then using execv, 
and almost as fast as simple forking.)

--

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



[issue13405] Add DTrace probes

2012-06-07 Thread Marc Abramowitz

Marc Abramowitz msabr...@gmail.com added the comment:

Hi jcea,

Sorry, I've been away from this for a while.

I'm getting undefined symbols now while trying to link:

```

(12:47pm) [last: 0] marca@scml-marca:~/src$ hg clone 
http://hg.python.org/cpython...
(12:55pm) [last: 0] marca@scml-marca:~/src$ cd cpython
[last: 0] marca@scml-marca:~/src/cpython$ hg tip
changeset:   77378:da5b370f41a1
branch:  2.7
tag: tip
user:Richard Oudkerk shibt...@gmail.com
date:Wed Jun 06 19:01:14 2012 +0100
summary: Issue #13854: Properly handle non-integer, non-string arg to 
SystemExit

[last: 0] marca@scml-marca:~/src/cpython$ curl -s 
http://bugs.python.org/file25203/4a072278b866.diff | patch -p1
patching file .hgignore
Hunk #1 succeeded at 81 (offset 8 lines).
patching file Doc/library/debug.rst
patching file Doc/library/dtrace.rst
patching file Include/code.h
patching file Include/pydtrace.d
patching file Include/pydtrace.h
patching file Include/pydtrace_offsets.c
patching file Include/pydtrace_offsets.sh
patching file Lib/test/dtrace_sample.py
patching file Lib/test/test_dtrace.py
patching file Makefile.pre.in
Hunk #2 succeeded at 462 (offset 1 line).
Hunk #3 succeeded at 491 (offset 1 line).
Hunk #4 succeeded at 502 (offset 1 line).
Hunk #5 succeeded at 607 (offset 17 lines).
Hunk #6 succeeded at 733 (offset 19 lines).
Hunk #7 succeeded at 1429 (offset 45 lines).
Hunk #8 succeeded at 1461 (offset 45 lines).
patching file Modules/dtracemodule.c
patching file Modules/gcmodule.c
Hunk #2 FAILED at 791.
Hunk #3 succeeded at 1059 with fuzz 1 (offset 112 lines).
1 out of 3 hunks FAILED -- saving rejects to file Modules/gcmodule.c.rej
patching file Objects/codeobject.c
patching file Objects/frameobject.c
Hunk #1 succeeded at 714 (offset 2 lines).
patching file Objects/typeobject.c
patching file Python/ceval.c
Hunk #9 succeeded at 3149 (offset 7 lines).
Hunk #10 succeeded at 3842 (offset 12 lines).
Hunk #11 succeeded at 3911 (offset 12 lines).
patching file configure
patching file configure.ac
patching file pyconfig.h.in
patching file setup.py
Hunk #1 succeeded at 575 (offset 4 lines).


[last: 0] marca@scml-marca:~/src/cpython$ ./configure --enable-framework  make
...
gcc -o Python.framework/Versions/3.3/Python   -dynamiclib \
  -all_load libpython3.3m.a -Wl,-single_module \
  -install_name 
/Library/Frameworks/Python.framework/Versions/3.3/Python \
  -compatibility_version 3.3 \
  -current_version 3.3 \
  -framework CoreFoundation -ldl  -framework CoreFoundation;
Undefined symbols:
  _PYTHON_LINE_ENABLED, referenced from:
  _PyEval_EvalFrameEx in libpython3.3m.a(ceval.o)
  _PyEval_EvalFrameEx in libpython3.3m.a(ceval.o)
  _PyEval_EvalFrameEx in libpython3.3m.a(ceval.o)
  _PyEval_EvalFrameEx in libpython3.3m.a(ceval.o)
  _PyEval_EvalFrameEx in libpython3.3m.a(ceval.o)
```

--

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



[issue8865] select.poll is not thread safe

2012-06-07 Thread Gregory P. Smith

Changes by Gregory P. Smith g...@krypto.org:


--
assignee:  - gregory.p.smith
nosy: +gregory.p.smith

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



[issue10037] multiprocessing.pool processes started by worker handler stops working

2012-06-07 Thread Ask Solem

Ask Solem a...@celeryproject.org added the comment:

Later works, or just close it.  I can open up a new issue to merge the 
improvements in billiard later.

 The execv stuff certainly won't go in by Py3.3.  There has not been 
 consensus that adding it is a good idea.

 (I also have the unit tests passing with a fork server: the server process 
 is forked at the beginning of the program and then forked children of the 
 server process are started on request.  It is about 10 times faster then 
 using execv, and almost as fast as simple forking.)

Ah, a working 'fork server' would be just as good.
Btw, Billiard now supports running Pool without threads, using 
epoll/kqueue/select instead. So Celery uses that when it can be nonblocking, 
and execv when it can't.  It performs way better without threads, and in 
addition shutdown + replacing worker processes is much more responsive.  
Changing the default Pool is not going to happen, but ncluding a simple 
select() based Pool would be possible, and then it could also easily work with 
Twisted, Eventlet, Gevent, etc. (especially now that the Connection is 
rewritten in pure python).

--

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



[issue15032] Provide a select.select implemented using select.poll

2012-06-07 Thread Gregory P. Smith

New submission from Gregory P. Smith g...@krypto.org:

Many random bits of the standard library were originally written using 
select.select.  This is an ancient API that is available everywhere, but these 
days you'd be hard pressed to find _any_ system that does not implement the 
superior poll() API which does not suffer from the file descriptor limits 
problem of select().

A select.select() work-a-like should be possible to write that is implemented 
using poll.poll().

I am attaching my untested work in progress version of something like that as I 
don't have time to work on this further at the moment.  Someone else can pick 
it up if desired. (sorry about the code being in Google style rather than PEP-8)

--
files: poll_select-gps001.txt
messages: 162498
nosy: gregory.p.smith
priority: normal
severity: normal
status: open
title: Provide a select.select implemented using select.poll
type: enhancement
versions: Python 3.3
Added file: http://bugs.python.org/file25861/poll_select-gps001.txt

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



[issue14635] telnetlib uses select instead of poll - limited to FD_SETSIZE fds

2012-06-07 Thread Gregory P. Smith

Gregory P. Smith g...@krypto.org added the comment:

I think your approach is fine.

BTW for anyone who wants to chase the larger idea of dealing with all 
select.select use, take a look at the prototype for a select.select() 
implemented using poll.poll() that I just put in 
http://bugs.python.org/issue15032.

--

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



[issue13405] Add DTrace probes

2012-06-07 Thread Marc Abramowitz

Marc Abramowitz msabr...@gmail.com added the comment:

The 2.7 patch doesn't apply cleanly for me against the latest on the 2.7 branch:

[last: 0] marca@scml-marca:~/src$ hg clone http://hg.python.org/cpython  cd 
cpython  hg update 2.7  hg branch  hg tip  curl -s 
http://bugs.python.org/file25192/aa2dcffa267f.diff | patch -p1
destination directory: cpython
requesting all changes
adding changesets
adding manifests
adding file changes
added 77379 changesets with 172430 changes to 9646 files (+1 heads)
updating to branch default
3917 files updated, 0 files merged, 0 files removed, 0 files unresolved
3574 files updated, 0 files merged, 945 files removed, 0 files unresolved
2.7
changeset:   77378:da5b370f41a1
branch:  2.7
tag: tip
user:Richard Oudkerk shibt...@gmail.com
date:Wed Jun 06 19:01:14 2012 +0100
summary: Issue #13854: Properly handle non-integer, non-string arg to 
SystemExit

patching file .hgignore
patching file Doc/library/debug.rst
patching file Doc/library/dtrace.rst
patching file Include/code.h
patching file Include/pydtrace.d
patching file Include/pydtrace.h
patching file Include/pydtrace_offsets.c
patching file Include/pydtrace_offsets.sh
patching file Lib/test/dtrace_sample.py
patching file Lib/test/test_dtrace.py
patching file Makefile.pre.in
patching file Modules/dtracemodule.c
patching file Modules/gcmodule.c
Hunk #2 succeeded at 873 (offset 51 lines).
Hunk #3 succeeded at 1038 (offset 54 lines).
patching file Objects/classobject.c
Hunk #2 succeeded at 557 (offset 10 lines).
Hunk #3 succeeded at 622 (offset 10 lines).
Hunk #4 succeeded at 676 (offset 10 lines).
Hunk #5 succeeded at 758 (offset 10 lines).
patching file Objects/codeobject.c
patching file Objects/typeobject.c
Hunk #4 succeeded at 931 (offset 5 lines).
patching file Python/ceval.c
patching file Python/sysmodule.c
patching file configure
Hunk #1 succeeded at 619 (offset 8 lines).
Hunk #2 succeeded at 768 (offset 8 lines).
Hunk #3 succeeded at 1444 (offset 8 lines).
Hunk #4 FAILED at 2616.
Hunk #5 FAILED at 3548.
Hunk #6 FAILED at 3663.
Hunk #7 FAILED at 3706.
Hunk #8 FAILED at 3765.
Hunk #9 FAILED at 3817.
Hunk #10 FAILED at 4360.
Hunk #11 FAILED at 6713.
Hunk #12 FAILED at 6746.
Hunk #13 FAILED at 6779.
Hunk #14 FAILED at 6812.
Hunk #15 FAILED at 6845.
Hunk #16 FAILED at 6878.
Hunk #17 FAILED at 6911.
Hunk #18 FAILED at 6944.
Hunk #19 FAILED at 6977.
Hunk #20 FAILED at 7037.
Hunk #21 FAILED at 7098.
Hunk #22 FAILED at 7159.
Hunk #23 FAILED at 7207.
Hunk #24 FAILED at 7248.
Hunk #25 FAILED at 7310.
Hunk #26 FAILED at 7381.
Hunk #27 succeeded at 9464 (offset 8 lines).
Hunk #28 FAILED at 12456.
Hunk #29 FAILED at 12508.
Hunk #30 FAILED at 12627.
Hunk #31 FAILED at 12893.
Hunk #32 FAILED at 14693.
Hunk #33 FAILED at 15008.
Hunk #34 FAILED at 15036.
Hunk #35 FAILED at 15063.
31 out of 35 hunks FAILED -- saving rejects to file configure.rej
can't find file to patch at input line 2128
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--
|diff -r 70274d53c1dd -r aa2dcffa267f configure.in
|--- a/configure.in Mon Apr 09 19:04:04 2012 -0400
|+++ b/configure.in Thu Apr 12 12:51:51 2012 +0200
--
File to patch:

--

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



[issue15033] Different exit status when using -m

2012-06-07 Thread Kamil Kisiel

New submission from Kamil Kisiel ka...@kamilkisiel.net:

Python returns a different exit status when an exception is raised and -m is 
used as opposed to just running a module.

A short example, let's call it foo.py:

def main():
raise ValueError()

if __name__ == '__main__':
main()

When run with python foo.py the exit status of the process is 1. If run with 
python -mfoo the exit status of the process is 255.

--
messages: 162501
nosy: kisielk
priority: normal
severity: normal
status: open
title: Different exit status when using -m
type: behavior
versions: Python 2.6, Python 2.7, Python 3.2

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



[issue10037] multiprocessing.pool processes started by worker handler stops working

2012-06-07 Thread Richard Oudkerk

Richard Oudkerk shibt...@gmail.com added the comment:

 Ah, a working 'fork server' would be just as good.

Only problem is that it depends on fd passing which is apparently broken on 
MacOSX.

 Btw, Billiard now supports running Pool without threads, using 
 epoll/kqueue/select instead. So Celery uses that when it can be 
 nonblocking, and execv when it can't.  It performs way better without 
 threads, and in addition shutdown + replacing worker processes is much 
 more responsive.

If it were not for Windows I would have tried to avoid using threads.

--

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



[issue15030] PyPycLoader can't read cached .pyc files

2012-06-07 Thread Jesús Cea Avión

Jesús Cea Avión j...@jcea.es added the comment:

Could you write a patch for 3.3?

--

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



[issue13405] Add DTrace probes

2012-06-07 Thread Marc Abramowitz

Marc Abramowitz msabr...@gmail.com added the comment:

If I do `/configure --with-dtrace --enable-framework  make` then I get:

```
...
gcc -c -fno-strict-aliasing -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall 
-Wstrict-prototypes-I. -I./Include-DPy_BUILD_CORE -o Modules/gcmodule.o 
Modules/gcmodule.c
Modules/gcmodule.c:1088: error: conflicting types for ‘collect’
Modules/gcmodule.c:849: error: previous definition of ‘collect’ was here
Modules/gcmodule.c: In function ‘collect’:
Modules/gcmodule.c:1093: warning: implicit declaration of function ‘collect2’
make: *** [Modules/gcmodule.o] Error 1
```

--

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



[issue15032] Provide a select.select implemented using select.poll

2012-06-07 Thread Jesús Cea Avión

Changes by Jesús Cea Avión j...@jcea.es:


--
nosy: +jcea

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



[issue13405] Add DTrace probes

2012-06-07 Thread Marc Abramowitz

Marc Abramowitz msabr...@gmail.com added the comment:

I hacked around the previous error (duplicate definitions of `collect`) and 
then ran into:

gcc -fno-strict-aliasing -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall 
-Wstrict-prototypes-I. -I./Include-DPy_BUILD_CORE -o 
./Include/pydtrace_offsets \
./Include/pydtrace_offsets.c
./Include/pydtrace_offsets.c: In function ‘main’:
./Include/pydtrace_offsets.c:26: warning: format ‘%d’ expects type ‘int’, but 
argument 2 has type ‘long int’
./Include/pydtrace_offsets.c:29: warning: format ‘%d’ expects type ‘int’, but 
argument 2 has type ‘long unsigned int’
./Include/pydtrace_offsets.c:31: warning: implicit declaration of function 
‘offsetof’
./Include/pydtrace_offsets.c:31: error: expected expression before 
‘PyCompactUnicodeObject’
./Include/pydtrace_offsets.c:33: error: expected expression before 
‘PyCompactUnicodeObject’
make: *** [Include/pydtrace_offsets.h] Error 1

I was able to fix this by adding #include stddef.h.

--

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



[issue13405] Add DTrace probes

2012-06-07 Thread Jesús Cea Avión

Jesús Cea Avión j...@jcea.es added the comment:

Marc, please, check your GTalk/XMPP window :-)

--

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



[issue12157] join method of multiprocessing Pool object hangs if iterable argument of pool.map is empty

2012-06-07 Thread Richard Oudkerk

Changes by Richard Oudkerk shibt...@gmail.com:


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

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



[issue13854] multiprocessing: SystemExit from child with non-int, non-str arg causes TypeError

2012-06-07 Thread Richard Oudkerk

Changes by Richard Oudkerk shibt...@gmail.com:


--
resolution:  - fixed
stage:  - committed/rejected
status: open - closed

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



[issue15009] urlsplit can't round-trip relative-host urls.

2012-06-07 Thread Ankit Toshniwal

Ankit Toshniwal ankitoshni...@gmail.com added the comment:

Hello,

Did some initial investigation, so looks like as per the code in parse.py, 
under the function urlunsplit, we take the 5-tuple returned by urlsplit . In 
the case of foo we get:
SplitResult(scheme='yelp', netloc='', path='/foo', query='', fragment='')

Now this tuple is passed to urlunsplit. We have a if statement under the 
urlunsplit function 

if netloc or (scheme and scheme in uses_netloc and url[:2] != '//'):

which checks if the netloc exists in the url (in our case it does not) then we 
check if the scheme in the url is part of the uses_netloc list (predefined list 
in parse.py with the list of common types of schemes used like http, ftp, file, 
rsync etc). In our case since yelp is not part of it we fail at the if 
statement and then we just return the url instead of modifying it. What we need 
was that if the above statement fails we do an else which does something like 
this:

if netloc or (scheme and scheme in uses_netloc and url[:2] != '//'):
if url and url[:1] != '/':
  url = '/' + url
url = '//' + (netloc or '') + url
else:
if url and url[:1] != '/':
  url = '/' + url
url = '//' + (netloc or '') + url

In that case we get the right url back.

After changing the code here is what i get on local dev machines:
 urlunparse(urlparse('yelp:///foo'))
'yelp:///foo'
 urlunsplit(urlsplit('file:///tmp'))
'file:///tmp'
 urlunsplit(urlsplit('yelp:///foo'))
'yelp:///foo'

Thanks,
Ankit.

P.S : I am new to python trying to learn it and also work on small projects let 
me know what you think if this is the right approach.

--
nosy: +ankitoshniwal
Added file: http://bugs.python.org/file25862/parse.py

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



[issue5004] socket.getfqdn() doesn't cope properly with purely DNS-based setups

2012-06-07 Thread Ankit Toshniwal

Ankit Toshniwal ankitoshni...@gmail.com added the comment:

I cannot reproduce this issue. I just tested this on my mac.

atoshniw@prusev-mn:~/Documents/code/python-dev/bin #hostname -f
prusev-mn.helloworld.com
atoshniw@prusev-mn:~/Documents/code/python-dev/bin #python
Python 2.6.1 (r261:67515, Feb 11 2010, 00:51:29) 
[GCC 4.2.1 (Apple Inc. build 5646)] on darwin
Type help, copyright, credits or license for more information.
 import socket
 socket.getfqdn()
'prusev-mn.helloworld.com'

--
nosy: +ankitoshniwal

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



[issue15009] urlsplit can't round-trip relative-host urls.

2012-06-07 Thread Buck Golemon

Buck Golemon b...@yelp.com added the comment:

Well i think the real issue is that you can't enumerate the protocals that use 
netloc. All protocols are allowed to have a netloc. the smb: protocol 
certainly does, but it's not in the list.

The core issue is that smb:/foo and smb:///foo are different urls, and should 
be represented differently when split. The /// form has a netloc, it's just the 
empty-string. The single-slash form has no netloc, so I propose that 
urlsplit('smb:/foo') return SplitResult(scheme='smb', netloc=None, path='/foo', 
query='', fragment='')

--

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



[issue12510] IDLE: calltips mishandle raw strings and other examples

2012-06-07 Thread Roundup Robot

Roundup Robot devn...@psf.upfronthosting.co.za added the comment:

New changeset 02b4c62ce393 by Terry Jan Reedy in branch '3.2':
Issue #12510: Revise and triple # of calltip tests, with an eye to unittest
http://hg.python.org/cpython/rev/02b4c62ce393

New changeset 03b5f75ddac7 by Terry Jan Reedy in branch 'default':
Merge from 3.2, #12510
http://hg.python.org/cpython/rev/03b5f75ddac7

--

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



[issue12510] IDLE: calltips mishandle raw strings and other examples

2012-06-07 Thread Terry J. Reedy

Terry J. Reedy tjre...@udel.edu added the comment:

I decided to commit the current patch (i12510c.test.diff + NEWS changes) as is. 
Another change is needed to correctly delete the first arg of all methods, not 
just instance methods with the first arg named 'self'. (In the current new 
classmethod test, I just allowed non-removal of 'cls'. There should also be a 
test with a variant of 'self'.)

In _self_pat = re.compile('self\,?\s*'), 'self' in the pattern should be 
replaced by '(xxx', where 'xxx' is the pattern that matches an identifier. (And 
add '(' to the replacement pattern.) If anyone can quickly tell me what that 
is, that would be helpful.

--

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



[issue15030] PyPycLoader can't read cached .pyc files

2012-06-07 Thread Ronan Lamy

Ronan Lamy ronan.l...@gmail.com added the comment:

My preferred solution would be to use to use the functions I describe in issue 
15031.

--

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



[issue15034] tutorial should use best practices in user defined execeptions section

2012-06-07 Thread R. David Murray

New submission from R. David Murray rdmur...@bitdance.com:

And I wish I knew what those were.

--
assignee: docs@python
components: Documentation
messages: 162513
nosy: docs@python, r.david.murray
priority: normal
severity: normal
stage: needs patch
status: open
title: tutorial should use best practices in user defined execeptions section
type: behavior
versions: Python 2.7, Python 3.2, Python 3.3

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



[issue15031] Split .pyc parsing from module loading

2012-06-07 Thread Jesús Cea Avión

Changes by Jesús Cea Avión j...@jcea.es:


--
nosy: +jcea

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



[issue14626] os module: use keyword-only arguments for dir_fd and nofollow to reduce function count

2012-06-07 Thread Larry Hastings

Larry Hastings la...@hastings.org added the comment:

Here's a nice fresh minor update.

Notes on this third patch:

* The docstrings are now done.

* I discovered that fchmodat() doesn't actually support
  AT_SYMLINK_NOFOLLOW!  glibc documents using the flag, then
  comically notes that it doesn't actually work.  Specifying
  it results in ENOTSUP every time.  os.chmod() now accomodates
  this; it throws NotImplementedError if it detects this situation.
  However it should also Just Work once glibc supports it.

* While editing the docstrings, I noticed that several of them
  had old-style octal constants ;-)  I fixed 'em.

* I added support for the remove_dir argument to unlink/remove
  on Windows.  I also made it work on non-Windows even when
  unlinkat() is not available.

--
Added file: 
http://bugs.python.org/file25863/larry.os.keyword.arguments.collapse.3.diff

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



[issue15030] PyPycLoader can't read cached .pyc files

2012-06-07 Thread Jesús Cea Avión

Changes by Jesús Cea Avión j...@jcea.es:


--
dependencies: +Split .pyc parsing from module loading

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



[issue8652] Minor improvements to the Handling Exceptions part of the tutorial

2012-06-07 Thread Roundup Robot

Roundup Robot devn...@psf.upfronthosting.co.za added the comment:

New changeset b873afe640e2 by R David Murray in branch '2.7':
#8652: update errors tutorial.
http://hg.python.org/cpython/rev/b873afe640e2

--
nosy: +python-dev

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



[issue8652] Minor improvements to the Handling Exceptions part of the tutorial

2012-06-07 Thread R. David Murray

R. David Murray rdmur...@bitdance.com added the comment:

The Python3 tutorial was already fixed, and the explanation of the parens is 
not needed there since the old syntax is not supported.

I did not do any reordering since the use of 'as' immediately follows in the 
text and seems to make fine sense as is.  Actually, it now makes more sense 
than the equivalent exposition in the Python3 docs, where the paragraph is 
absent.

Thanks for the patch, Marien.

--
nosy: +r.david.murray
resolution:  - fixed
stage: patch review - committed/rejected
status: open - closed
type:  - behavior
versions:  -Python 3.1, Python 3.2, Python 3.3

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



[issue15031] Split .pyc parsing from module loading

2012-06-07 Thread Brett Cannon

Brett Cannon br...@python.org added the comment:

So the problem with the function is that had this been implemented in Python 
3.2 it already would be outdated thanks to the 3.3 change of storing the file 
size in the .pyc file, and simply changing the length of the sequence returned 
would probably break code.

I have thought about exposing something like this over the years, and I always 
come back to the conclusion that it is really touchy and the best you could do 
is pass in the data and info you have from the source and either raise the 
proper exception or return the code object/bytes.

--

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



[issue15030] PyPycLoader can't read cached .pyc files

2012-06-07 Thread Brett Cannon

Brett Cannon br...@python.org added the comment:

The format did change and importlib.abc.PyPycLoader was not subsequently 
updated. Problem is that the ABC has been deprecated and given 
backwards-compatibility instructions for Python 3.1, so I don't know if it 
should be considered a priority to fix this to read .pyc files created by other 
loaders instead of just the .pyc files it creates on its own when it implements 
write_bytecode().

--
nosy: +pitrou

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



[issue15009] urlsplit can't round-trip relative-host urls.

2012-06-07 Thread Senthil Kumaran

Changes by Senthil Kumaran sent...@uthcode.com:


--
assignee:  - orsenthil
nosy: +orsenthil

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



[issue14998] pprint._safe_key is not always safe enough

2012-06-07 Thread Shawn Brown

Shawn Brown 03sjbr...@gmail.com added the comment:

Here's a patch for 3.3 -- as well as two new assertions in test_pprint.py

The added try/catch also fixes the issues mentioned in issue 10017 so I added a 
test for that case as well.

--
keywords: +patch
Added file: http://bugs.python.org/file25864/pprint_safe_key.patch

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