[issue19525] Strict indentation in Python3

2013-11-08 Thread Sworddragon

Sworddragon added the comment:

Thanks for the example, this is what I had in mind. Python 3 does also still 
provide the -t option (I'm assuming for compatibility reasons) but python3 -h 
and the manpage aren't saying about this.

--

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



[issue19518] Add new PyRun_xxx() functions to not encode the filename

2013-11-08 Thread Nick Coghlan

Nick Coghlan added the comment:

PEP 432 doesn't really touch the PyRun_* APIs - it's all about refactoring
Py_Initialize so you can use most of the C API during the latter parts of
the configuration process (e.g. setting up the path for the import system).

pythonrun.c is just a monstrous beast that covers the entire interpreter
lifecycle from initialisation through script execution through to
termination.

--

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



[issue19526] Review additions to the stable ABI of Python 3.4

2013-11-08 Thread STINNER Victor

New submission from STINNER Victor:

Example:

http://hg.python.org/cpython/rev/69071054b42f
PyAPI_FUNC(int) _PyDict_DelItemId(PyObject *mp, struct _Py_Identifier *key);

New functions added in this issue should also be reviewed (should them be part 
of the stable ABI?):

http://bugs.python.org/issue11619
http://hg.python.org/cpython/rev/df2fdd42b375

--
messages: 202412
nosy: haypo, loewis, ncoghlan
priority: normal
severity: normal
status: open
title: Review additions to the stable ABI of Python 3.4
versions: Python 3.4

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



[issue19526] Review additions to the stable ABI of Python 3.4

2013-11-08 Thread STINNER Victor

STINNER Victor added the comment:

Priority: release blocker means that it should be done at least before Python 
3.4 final. It may be delayed after the beta1.

--
nosy: +larry
priority: normal - release blocker

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



[issue19527] Test failures with COUNT_ALLOCS

2013-11-08 Thread Bohuslav Slavek Kabrda

New submission from Bohuslav Slavek Kabrda:

When Python is compiled with COUNT_ALLOCS, some tests in test_gc and 
test_module fail. I'm attaching the patch that skips 3 of them and modifies 
assertions in one of them, so that the tests pass.

I'm however still unsure about one of the skipped tests, since I'm unsure 
whether I totally understand what's wrong there - 
test_gc_ordinary_module_at_shutdown.

My guess is that due to COUNT_ALLOCS causing immortal types, the final_a and 
final_b types don't get destroyed on line [1] as they do in builds without 
COUNT_ALLOCS. AFAICS they are only un-immortalized on this line and destroyed 
during the following loop [2]. The problem here is that the order of destroyed 
modules is not deterministic, so sometimes the builtins module gets destroyed 
before the final_X and there is no print function, which makes the __del__ 
functions from final_X fail. IMO the best thing to do is to just skip this 
test with COUNT_ALLOCS. But I may be wrong, I don't have a great insight into 
Python's GC and module unloading.


[1] http://hg.python.org/cpython/annotate/0f48843652b1/Python/import.c#l383
[2] http://hg.python.org/cpython/annotate/0f48843652b1/Python/import.c#l394

--
messages: 202414
nosy: bkabrda
priority: normal
severity: normal
status: open
title: Test failures with COUNT_ALLOCS
versions: Python 3.4

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



[issue19527] Test failures with COUNT_ALLOCS

2013-11-08 Thread Bohuslav Slavek Kabrda

Bohuslav Slavek Kabrda added the comment:

And the patch...

--
keywords: +patch
Added file: 
http://bugs.python.org/file32540/00141-fix-tests_with_COUNT_ALLOCS.patch

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



[issue19527] Test failures with COUNT_ALLOCS

2013-11-08 Thread STINNER Victor

Changes by STINNER Victor victor.stin...@gmail.com:


--
nosy: +haypo

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



[issue19524] ResourceWarning when urlopen() forgets the HTTPConnection object

2013-11-08 Thread Barry A. Warsaw

Changes by Barry A. Warsaw ba...@python.org:


--
nosy: +barry

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



[issue19526] Review additions to the stable ABI of Python 3.4

2013-11-08 Thread Roundup Robot

Roundup Robot added the comment:

New changeset bf9c77bac36d by Victor Stinner in branch 'default':
Issue #19512, #19526: Exclude the new _PyDict_DelItemId() function from the
http://hg.python.org/cpython/rev/bf9c77bac36d

--
nosy: +python-dev

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



[issue19512] Avoid temporary Unicode strings, use identifiers to only create the string once

2013-11-08 Thread Roundup Robot

Roundup Robot added the comment:

New changeset bf9c77bac36d by Victor Stinner in branch 'default':
Issue #19512, #19526: Exclude the new _PyDict_DelItemId() function from the
http://hg.python.org/cpython/rev/bf9c77bac36d

--

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



[issue19515] Share duplicated _Py_IDENTIFIER identifiers in C code

2013-11-08 Thread Martin v . Löwis

Martin v. Löwis added the comment:

I'd be +0 on extracting common identifiers. I see a slight increase of 
readability, and expect a slight reduction of memory usage, and a tiny 
reduction in runtime. It's not really worth the effort, but I fail to see that 
it causes harm.

I see no point in reverting cases where this approach is already taken. I don't 
quite understand Victor's interest in this, either, as there are hundreds of 
open real bugs that could use his attention.

--

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



[issue8799] Hang in lib/test/test_threading.py

2013-11-08 Thread Kristján Valur Jónsson

Kristján Valur Jónsson added the comment:

Here is an updated patch that only adds the necessary safety delay to the main 
thread.  It also explains these in the comments.

--
Added file: http://bugs.python.org/file32541/lock_tests.patch

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



[issue19515] Share duplicated _Py_IDENTIFIER identifiers in C code

2013-11-08 Thread STINNER Victor

STINNER Victor added the comment:

2013/11/8 Martin v. Löwis rep...@bugs.python.org:
 I'd be +0 on extracting common identifiers. I (...) expect a slight reduction 
 of memory usage, and a tiny reduction in runtime.

Only duplicated Py_IDENTIFIER structures would be removed in memory,
but these structures are very small (3 pointers or something like
that). The identifier strings are already interned, so not duplicated
in memory.

 It's not really worth the effort, but I fail to see that it causes harm.

Initializing an identifier has to decode the literal byte string from
UTF-8, but Python UTF-8 decoder is really fast. I'm not sure that it's
possible to see a difference on the startup time.

 I see no point in reverting cases where this approach is already taken.

I only reverted shared identifiers added a few days ago in issue
#19512. I agree to leave the old code unchanged.

 I don't quite understand Victor's interest in this, either, as there are 
 hundreds of open real bugs that could use his attention.

I tried to explain my motivation on using more identifiers in the issue #19512.

--

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



[issue18861] Problems with recursive automatic exception chaining

2013-11-08 Thread Nick Coghlan

Nick Coghlan added the comment:

I actually think Nikratio is right about the way this *should* work 
(intuitively).

I'm just not sure it's feasible to *implement* those semantics in CPython 
without significant changes to the way exception handling works - I don't 
believe the exception chaining code can currently tell the difference between 
the cases:

  # No context on Exception3 is exactly what we want
  try:
  try:
  raise Exception1
  except Exception1:
  raise Exception2
  except Exception2 as exc
  raise Exception3 from Exception2

  # Not seeing Exception1 as the context for Exception3 is surprising!
  try:
  raise Exception1
  except Exception1:
  try:
  raise Exception2
  except Exception2 as exc
  raise Exception3 from Exception2

In a certain sense, exceptions need to be able to have *multiple* contexts to 
handle this case properly without losing data. Frames would need to tag 
exceptions appropriately with the context details as an unhandled exception 
passed through a frame that was currently running an exception handler.

So even though it doesn't require new syntax, I think it *does* require a PEP 
if we're going to change this (and we still haven't fully dealt with the 
consequence of the last one - the display options for tracebacks are still a 
bit limited)

--

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



[issue19528] logger.config.fileConfig cant cope with files starting with an 'r' on windows

2013-11-08 Thread Eric V. Smith

Eric V. Smith added the comment:

It looks like you need to use double-backslashes everywhere in your path, or 
use single backslashes and raw strings (r).

--
nosy: +eric.smith
resolution:  - invalid
status: open - closed

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



[issue19528] logger.config.fileConfig cant cope with files starting with an 'r' on windows

2013-11-08 Thread Simon Naish

Simon Naish added the comment:

I am using double backslashes in my path.

But logger\config.py is losing them, please re-read the issue description, 
logger\config.py is part of the python libraries!

--

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



[issue19528] logger.config.fileConfig cant cope with files starting with an 'r' on windows

2013-11-08 Thread Eric V. Smith

Eric V. Smith added the comment:

Apologies for reading too quickly. I've reopened this.

--
resolution: invalid - 
status: closed - open

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



[issue19528] logger.config.fileConfig cant cope with files starting with an 'r' on windows

2013-11-08 Thread Simon Naish

New submission from Simon Naish:

When attempting to use a config file with logging to set up a series of loggers 
in a script, when running on windows, if the config file name starts with an 
'r' then the script fails with the following error:-

 File C:\Users\simon\Documents\python dev\RepositoryChainPkg\FileLogger.py, 
line 45, in fileConfig
logging.config.fileConfig(FileLogger.CONF_FILENAME)
  File C:\Python27\lib\logging\config.py, line 78, in fileConfig
handlers = _install_handlers(cp, formatters)
  File C:\Python27\lib\logging\config.py, line 156, in _install_handlers
h = klass(*args)
  File C:\Python27\lib\logging\handlers.py, line 117, in __init__
BaseRotatingHandler.__init__(self, filename, mode, encoding, delay)
  File C:\Python27\lib\logging\handlers.py, line 64, in __init__
logging.FileHandler.__init__(self, filename, mode, encoding, delay)
  File C:\Python27\lib\logging\__init__.py, line 902, in __init__
StreamHandler.__init__(self, self._open())
  File C:\Python27\lib\logging\__init__.py, line 925, in _open
stream = open(self.baseFilename, self.mode)
IOError: [Errno 22] invalid mode ('a') or filename: 
'C:\\Users\\simon\repositoryChainLogging\repo_log.log'

The same script works perfectly on linux and solaris.

Points to note, the config filename (and path) is listed in the error as:-

'C:\\Users\\simon\repositoryChainLogging\repo_log.log'

Yet when it is passed to logging\config.py as parameter fname in function 
fileConfig it is:-
b'C:\\Users\\simon\\repositoryChainLogging\\repo_log.conf'

In other words the path passed in by the script is correctly seperated and 
escaped by os.path functions.

However in _install_handlers (line 133 of logging\config.py) the args = 
eval(args, vars(logging))line (154) gets the path back in this tuple:-

(b'C:\\Users\\snaish.BRIGHTON\repositoryChainLogging\repo_log.log', b'a', 
131072,
 10)

Where it has clearly lost some of the escaping, rendering the path useless, 
since \r is a control character, and therefore invalidates the path.

Therefore at the moment it is impossible to use logging config fiels beginning 
with r onw windows at the moment.

--
components: Library (Lib)
messages: 202422
nosy: 51m0n
priority: normal
severity: normal
status: open
title: logger.config.fileConfig cant cope with files starting with an 'r' on 
windows
versions: Python 2.7

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



[issue18235] _sysconfigdata.py wrong on AIX installations

2013-11-08 Thread Michael Haubenwallner

Michael Haubenwallner added the comment:

Actually, ld_so_aix is autogenerated from ld_so_aix.in into builddir, while 
makexp_aix is not.

Attached patch eventually might fix the test too?

--
nosy: +haubi
Added file: http://bugs.python.org/file32542/python-tip-aix-absbuilddir.patch

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



[issue19528] logger.config.fileConfig cant cope with files starting with an 'r' on windows

2013-11-08 Thread Eric V. Smith

Eric V. Smith added the comment:

Can you provide a small, stand-alone program that demonstrates the problem? In 
particular, I want to see how this filename is provided to logging.

--

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



[issue19528] logger.config.fileConfig cant cope with files starting with an 'r' on windows

2013-11-08 Thread Simon Naish

Simon Naish added the comment:

Example proggie.

It writes its own config file (really_cool_logging.conf), then attempts to read 
it, all to ~/testlog

If you inherit from the class FileLogger with any other class you get instant 
access to self.log.any logger command which will write debug and above to 
~/testlog/really_cool_logging.log, and info and above to the console. 

Which is really handy when you have a lot of command scripts that you want to 
log to one place.

--
resolution:  - invalid
status: open - closed
Added file: http://bugs.python.org/file32543/TestFileLogger.py

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



[issue19529] Fix unicode_aswidechar() with 4byte unicode and 2byte wchar_t, for AIX

2013-11-08 Thread Michael Haubenwallner

New submission from Michael Haubenwallner:

The problem raises during build already when trying to run setup.py, where 
./python is unavailable to locate the 'encodings' module and aborts.

It turns out that (some of) the filenames searched for are broken due to wrong 
conversion from unicode (across wchar_t) to char.

Attached patch is for 3.2 only, should be obvious enough.

Thanks!

--
components: Interpreter Core
files: python-3.2-aix-unicode_aswidechar.patch
keywords: patch
messages: 202429
nosy: haubi
priority: normal
severity: normal
status: open
title: Fix unicode_aswidechar() with 4byte unicode and 2byte wchar_t, for AIX
type: crash
versions: Python 3.2
Added file: 
http://bugs.python.org/file32544/python-3.2-aix-unicode_aswidechar.patch

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



[issue19528] logger.config.fileConfig cant cope with files starting with an 'r' on windows

2013-11-08 Thread Simon Naish

Simon Naish added the comment:

Updated TestFileLogger, missed a line out in my rush to get you something, 
sorry!

--
Added file: http://bugs.python.org/file32545/TestFileLogger.py

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



[issue19528] logger.config.fileConfig cant cope with files starting with an 'r' on windows

2013-11-08 Thread Simon Naish

Simon Naish added the comment:

And again. Damn!

--
Added file: http://bugs.python.org/file32546/TestFileLogger.py

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



[issue19528] logger.config.fileConfig cant cope with files starting with an 'r' on windows

2013-11-08 Thread Eric V. Smith

Changes by Eric V. Smith e...@trueblade.com:


--
resolution: invalid - 
status: closed - open

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



[issue16803] Make test_import test_importlib run tests under both _frozen_importlib and importlib._bootstrap

2013-11-08 Thread Roundup Robot

Roundup Robot added the comment:

New changeset b26e6e3e8037 by Brett Cannon in branch 'default':
Issue #16803: test.test_importlib.frozen now runs both frozen and source code
http://hg.python.org/cpython/rev/b26e6e3e8037

--

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



[issue19528] logger.config.fileConfig cant cope with files starting with an 'r' on windows

2013-11-08 Thread Peter Otten

Peter Otten added the comment:

Simon, in your code you build the config file with 

'''...
args=('{0}', 'a', 131072, 10)
...
'''.format(filename)

The logging module uses eval() to process the args tuple, and a filename 
containing a bashlash will not roundtrip that way. Have a look at the .conf 
file, it contains something like

args=('whatever\testlog\really_cool_logging.log', 'a', 131072, 10)

when it should be

args=('whatever\\testlog\\really_cool_logging.log', 'a', 131072, 10)

To fix this you should drop the quote chars and use the string representation 
of the filename:

'''...
args=({0!r}, 'a', 131072, 10)
...
'''.format(filename)

In short: I think Eric was right with initial assumption.

--
nosy: +peter.otten

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



[issue18235] _sysconfigdata.py wrong on AIX installations

2013-11-08 Thread David Edelsohn

David Edelsohn added the comment:

+1

--

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



[issue19529] Fix unicode_aswidechar() with 4byte unicode and 2byte wchar_t, for AIX

2013-11-08 Thread David Edelsohn

David Edelsohn added the comment:

LGTM

--
nosy: +David.Edelsohn

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



[issue19521] parallel build race condition on AIX since python-3.2

2013-11-08 Thread David Edelsohn

David Edelsohn added the comment:

+1

--
nosy: +David.Edelsohn

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



[issue19528] logger.config.fileConfig cant cope with files starting with an 'r' on windows

2013-11-08 Thread Simon Naish

Simon Naish added the comment:

Hi Peter,

Oh well spotted!

Fair enough, but that is seriously not obvious, thanks.

Si

--

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



[issue18874] Add a new tracemalloc module to trace memory allocations

2013-11-08 Thread STINNER Victor

Changes by STINNER Victor victor.stin...@gmail.com:


Removed file: http://bugs.python.org/file32494/022955935ba3.patch

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



[issue18874] Add a new tracemalloc module to trace memory allocations

2013-11-08 Thread STINNER Victor

STINNER Victor added the comment:

Patch updated to the latest version of the PEP 454.

--
Added file: http://bugs.python.org/file32547/69fd2d766005.patch

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



[issue19528] logger.config.fileConfig cant cope with files starting with an 'r' on windows

2013-11-08 Thread Eric V. Smith

Eric V. Smith added the comment:

Thanks, Peter.

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

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



[issue16803] Make test_import test_importlib run tests under both _frozen_importlib and importlib._bootstrap

2013-11-08 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 6c998d72553a by Brett Cannon in branch 'default':
Issue #16803: test.test_importlib.import_ now tests frozen and source code
http://hg.python.org/cpython/rev/6c998d72553a

--

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



[issue18923] Use the new selectors module in the subprocess module

2013-11-08 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 71b618f0c8e9 by Charles-François Natali in branch 'default':
Issue #18923: Update subprocess to use the new selectors module.
http://hg.python.org/cpython/rev/71b618f0c8e9

--
nosy: +python-dev

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



[issue16803] Make test_import test_importlib run tests under both _frozen_importlib and importlib._bootstrap

2013-11-08 Thread Roundup Robot

Roundup Robot added the comment:

New changeset b0f570aef6fd by Brett Cannon in branch 'default':
Issue #16803: test.test_importlib.source now tests frozen and source code
http://hg.python.org/cpython/rev/b0f570aef6fd

--

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



[issue16261] Fix bare excepts in various places in std lib

2013-11-08 Thread Ezio Melotti

Changes by Ezio Melotti ezio.melo...@gmail.com:


--
nosy: +ezio.melotti

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



[issue16803] Make test_importlib run tests under both _frozen_importlib and importlib._bootstrap

2013-11-08 Thread Brett Cannon

Brett Cannon added the comment:

test_importlib now runs both frozen and source code for all relevant tests. 
Should allow for making changes in the source w/o recompiling and making sure 
any source tests pass. Also makes sure the pure Python implementation of import 
that mirrors what import.c does stays compatible.

--
resolution:  - fixed
stage: needs patch - committed/rejected
status: open - closed
title: Make test_import  test_importlib run tests under both _frozen_importlib 
and importlib._bootstrap - Make test_importlib run tests under both 
_frozen_importlib and importlib._bootstrap

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



[issue19437] More failures found by pyfailmalloc

2013-11-08 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 08c81db35959 by Victor Stinner in branch '3.3':
Issue #19437: Fix convert_op_cmp() of decimal.Decimal rich comparator, handle
http://hg.python.org/cpython/rev/08c81db35959

New changeset 3ff670a83c73 by Victor Stinner in branch '3.3':
Issue #19437: Fix dec_format() of the _decimal module, handle dec_strdup()
http://hg.python.org/cpython/rev/3ff670a83c73

--

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



[issue17621] Create a lazy import loader mixin

2013-11-08 Thread Brett Cannon

Brett Cannon added the comment:

Shifting this to Python 3.5 to rework using the forthcoming PEP 451 APIs which 
have been designed to explicitly allow for a lazy loader.

--
versions: +Python 3.5 -Python 3.4

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



[issue17630] Create a pure Python zipfile importer

2013-11-08 Thread Brett Cannon

Brett Cannon added the comment:

This is going to need a touch-up for PEP 451 to make the whole thing work more 
smoothly, so repositioning for Python 3.5. When that happens I can look into 
the 2 second issue that Amaury pointed out and Paul's review.

Although I do wonder about the utility of this work. Zipimport still gets 
around the bootstrapping problem that any pure Python zip implementation never 
will. Probably the only hope of being useful is to make this abstract enough to 
include a pluggable (de)compression setup so that lzma or bz2 can be used on 
top of a single file storage back-end like tar or zip.

--
versions: +Python 3.5 -Python 3.4

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



[issue19523] logging.FileHandler - using of delay argument case handle leaks

2013-11-08 Thread Vinay Sajip

Changes by Vinay Sajip vinay_sa...@yahoo.co.uk:


--
nosy: +vinay.sajip

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



[issue16803] Make test_importlib run tests under both _frozen_importlib and importlib._bootstrap

2013-11-08 Thread Eric Snow

Eric Snow added the comment:

Hurray!

--

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



[issue16261] Fix bare excepts in various places in std lib

2013-11-08 Thread Terry J. Reedy

Terry J. Reedy added the comment:

The earlier #15313 is about removing bare excepts in Idle code. These should be 
handled separately for two reasons.
1. Changes can and in most cases should be backported.
2. As with any other Python-coded application, uncaught exceptions cause Idle 
to quit. Currently, if Idle is started directly, rather than from a console, 
such an exit looks like a silent crash. So either the added tuple of exceptions 
to be caught must be complete, or the calling code must be adjusted.

I copied the one idlelib fix (to PyShell.py) to that issue for separate 
examination. It should be removed from any patch applied here.

--
nosy: +terry.reedy

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



[issue15313] IDLE - remove all bare excepts

2013-11-08 Thread Terry J. Reedy

Terry J. Reedy added the comment:

RA's patch for #16261 suggests

diff -r b76d2d8db81f Lib/idlelib/PyShell.py
--- a/Lib/idlelib/PyShell.pyMon Dec 17 13:43:14 2012 +0530
+++ b/Lib/idlelib/PyShell.pyWed Jan 09 19:10:26 2013 +0530
@@ -152,7 +152,7 @@
 lineno = int(float(text.index(insert)))
 try:
 self.breakpoints.remove(lineno)
-except:
+except ValueError:
 pass
 text.tag_remove(BREAK, insert linestart,\
 insert lineend +1char)

--

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



[issue10197] subprocess.getoutput fails on win32

2013-11-08 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Is this ready to be reclosed?

--
nosy: +terry.reedy

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



[issue19479] textwrap.dedent doesn't work properly with strings containing CRLF

2013-11-08 Thread Terry J. Reedy

Changes by Terry J. Reedy tjre...@udel.edu:


--
nosy: +georg.brandl, terry.reedy

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



[issue19486] Bump up version of Tcl/Tk in building Python in Windows platform

2013-11-08 Thread Terry J. Reedy

Changes by Terry J. Reedy tjre...@udel.edu:


--
nosy: +loewis

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



[issue19491] Python Crashing When Saving Documents

2013-11-08 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Exactly what are people doing in the save dialog when they have problems? If 
they are saving to a standard path under Computer (on the left side bar), there 
should be no problem. If they are saving to some place listed under Libraries, 
such as Documents, then this is a known problem in 3.2 that was fixed in 3.3 by 
using a later version of Tk. See #12988 (and #14996). If this is the case, this 
issue is a duplicate and should be closed. Your description of Idle 'freezing', 
rather than closing, sounds like this is the same issue.

Ask the Pygame people to prepare a 3.3 binary and one for 3.4 as soon as it is 
released (or even now, for the upcoming beta).

---
When Idle closes, rather than freezing, you should be able to get error 
messages, without access to Command Prompt, by running the standard 
white-on-black, text-mode python.exe interpreter in interactive mode.

In the interpreter window, start Idle in a new window like so:
 import idlelib.idle

While using Idle, nothing should appear in in the original window, though there 
may be some TclError messages that can be ignored. When Idle stops, a prompt 
will appear in the original window. If Idle stops abnormally, a trackback and 
error message should appear before the prompt.

Note that the above only works on the first import. If you repeat
 import idlelib.idle
the code in idlelib.idle does not get rerun and Idle will not start. You have 
to exit and restart python.exe.

In order for Idle to run, python.exe has to be present somewhere. But if it has 
been hidden or somehow blocked, you can try the same thing  as above but from 
an Idle Shell window. In other words, start a second Idle Shell from the first. 
I just cannot guarantee that this will work as well. If it does, the import 
will work again after Cntl-F6, Shell/Restart Shell.

--
nosy: +terry.reedy

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



[issue19491] Python Crashing When Saving Documents

2013-11-08 Thread STINNER Victor

STINNER Victor added the comment:

 There doesn't seem to be a Pygame version for 3.3 on the pygame webpage?

Can't you try just to reproduce the crash in IDLE without installing pygame? (I 
don't know if pygame is available for Python 3.3.)

--

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



[issue19499] import this is cached in sys.modules

2013-11-08 Thread Terry J. Reedy

Terry J. Reedy added the comment:

The current ugly, implicit, complex ROT13? + custom decoder version of this.py 
violates the initial tenets that it prints. I suppose that is an intentional 
joke. If it were explicit and simple:

text = '''title
text lines
...'''
print(text)

then people could follow up
  import this
with
  this.text
and learn something about accessing module attributes.

--
nosy: +terry.reedy

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



[issue19529] Fix unicode_aswidechar() with 4byte unicode and 2byte wchar_t, for AIX

2013-11-08 Thread Terry J. Reedy

Terry J. Reedy added the comment:

By 'crash' ('abort'), do you mean segfault (or Windows equivalent) or an exit 
with traceback? 3.2 only gets security patches. Do you think this is a security 
issue? Does the problem exist with the latest 3.3 or 3.4?

--
nosy: +georg.brandl, terry.reedy

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



[issue19529] Fix unicode_aswidechar() with 4byte unicode and 2byte wchar_t, for AIX

2013-11-08 Thread STINNER Victor

STINNER Victor added the comment:

The bug is obvious and patch looks good to me. The problem is that Python 3.2 
doesn't accept bugfixes anymore, any security fixes.

http://www.python.org/dev/peps/pep-0392/

3.2.5 schedule (regression fix release)

3.2.5 final: May 13, 2013

-- Only security releases after 3.2.5 --

Georg Brandl, the release manager, may reconfirm that.

How is Python packaged on AIX? Can you integrate your fix in your package for 
Python 3.2?

The unicode type has been completly rewritten in Python 3.3, the bug was 
indirectly fixed during the rewrite. @Michael: can you confirm? You have to 
compile Python = 3.3 in debug mode and run the test suite (./python -m test 
-j0 -r).

--
nosy: +haypo

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



[issue18864] Implementation for PEP 451 (importlib.machinery.ModuleSpec)

2013-11-08 Thread Eric Snow

Eric Snow added the comment:

I've created a server-side clone for the implementation:

http://hg.python.org/features/pep-451/

--

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



[issue19530] cross thread shutdown of UDP socket exhibits unexpected behavior

2013-11-08 Thread mpb

New submission from mpb:

I have a multi-threaded application.
A background thread is blocked, having called recvfrom on a UDP socket.
The main thread wants to cause the background thread to unblock.
With TCP sockets, I can achieve this by calling:
sock.shutdown (socket.SHUT_RD)

When I try this with a UDP socket, the thread calling shutdown raises an OS 
Error (transport end point not connected).

The blocked thread does unblock (which is helpful), but recvform appears to 
return successfully, returning a zero length byte string, and a bogus address!

(This is the opposite of the TCP case, where the blocked thread raises the 
exception, and the call to shutdown succeeds.)

In contrast, sock.close does not cause the blocked thread to unblock.  (This is 
the same for both TCP and UDP sockets.)

I suspect Python is just exposing the underlying C behavior of shutdown and 
recvfrom.  I'd test it in C, but I'm not fluent in writing multi-threaded code 
in C.

It would be nice if the recvfrom thread could raise some kind of exception, 
rather than appearing to return successfully.  It might also be worth reporting 
this bug upstream (where ever upstream is for recvfrom).  I'm running Python 
3.3.1 on Linux.

See also this similar bug.
http://bugs.python.org/issue8831

The Python socket docs could mention that to unblock a reading thread, sockets 
should be shutdown, not closed.  This might be implied in the current docs, but 
it could be made explicit.  See:

http://docs.python.org/3/library/socket.html#socket.socket.close

For example, the following sentence could be appended to the Note at the above 
link.  Note: (...)  Specifically, in multi-threaded programming, if a thread 
is blocked performing a read or write on a socket, calling shutdown from 
another thread will unblock the blocked thread.  Unblocking via shutdown seems 
to work with TCP sockets, but may result in strange behavior with UDP sockets.

Here is sample Python code that demonstrates the behavior.

import socket, threading, time

sock = socket.socket (socket.AF_INET, socket.SOCK_DGRAM)
sock.bind (('localhost', 8000))

def recvfrom ():
  for i in range (2) :
print ('recvfrom  blocking ...')
recv, remote_addr = sock.recvfrom (1024)
print ('recvfrom  %s  %s' % (recv, remote_addr))

thread = threading.Thread ( target = recvfrom )
thread.start ()
time.sleep (0.5)

sock2 = socket.socket (socket.AF_INET, socket.SOCK_DGRAM)
sock2.sendto (b'test', ('localhost', 8000))

time.sleep (0.5)

try:  sock.shutdown (socket.SHUT_RD)
except OSError as exc :  print ('shutdown  os error  %s' % str (exc))

sock.close ()

thread.join ()
print ('exiting')




And here is the output of the above code:

recvfrom  blocking ...
recvfrom  b'test'  ('127.0.0.1', 48671)
recvfrom  blocking ...
shutdown  os error  [Errno 107] Transport endpoint is not connected
recvfrom  b''  (59308, b'\xaa\xe5\xec\xde3\xe6\x82\x02\x00\x00\xa8\xe7\xaa\xe5')
exiting

--
components: IO
messages: 202457
nosy: mpb
priority: normal
severity: normal
status: open
title: cross thread shutdown of UDP socket exhibits unexpected behavior
type: behavior
versions: Python 3.3

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



[issue11849] glibc allocator doesn't release all free()ed memory

2013-11-08 Thread STINNER Victor

STINNER Victor added the comment:

I just found this issue from this article:
http://python.dzone.com/articles/diagnosing-memory-leaks-python

Great job! Using mmap() for arenas is the best solution for this issue. I did 
something similar on a completly different project (also using its own 
dedicated memory allocator) for workaround the fragmentation of the heap memory.

--
nosy: +haypo

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



[issue11849] glibc allocator doesn't release all free()ed memory

2013-11-08 Thread Tim Peters

Tim Peters added the comment:

[@haypo]
 http://python.dzone.com/articles/diagnosing-memory-leaks-python
 Great job! Using mmap() for arenas is the best solution for this issue.

?  I read the article, and they stopped when they found there seemed to be a 
ton of tiny little objects around, like integers..  Ints aren't allocated from 
arenas to begin wtih - they have their own (immortal  unbounded) free list in 
Python2.  No change to pymalloc could make any difference to that.

--
nosy: +tim.peters

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



[issue19249] Enumeration.__eq__

2013-11-08 Thread Ethan Furman

Ethan Furman added the comment:

Given that __eq__ isn't adding anything, I think removing it is a fine option.

--
keywords: +patch
Added file: http://bugs.python.org/file32548/issue19249.stoneleaf.01.patch

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



[issue18864] Implementation for PEP 451 (importlib.machinery.ModuleSpec)

2013-11-08 Thread Eric Snow

Eric Snow added the comment:

Okay, I've updated the pep451 branch in the clone to include as much of the 
implementation as I've completed, which is the bulk of the functional changes.  
It's enough to pass the test suite.

Here's what I'd like to get done before the feature freeze (in this priority 
order):

1. wrap up the current functional changes in the clone;
2. change module.__initializing__ to module.__spec__._initializing;
3. refactor importlib loaders to use the new Finder/Loader APIs;
4. refactor pythonrun.c to make use of __spec__;
5. implement the deprecations and removals;
6. adjust other APIs to use __spec__ (pickle, etc.);
7. add rudimentary doc additions for the new APIs.

Other things that can (but don't have to) wait until after the beta release:

* finish doc changes;
* fill in gaps in test coverage (there shouldn't be much due to Brett's mother 
of all test suites for importlib)

I haven't had a chance yet to make any changes to Doc/reference/import.rst in 
response to Brett's review, but I did make the Doc/library/importlib.rst 
changes he recommended.

--
nosy: +larry
priority: normal - release blocker

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



[issue19531] Loading -OO bytecode files if -O was requested can lead to problems

2013-11-08 Thread Sworddragon

New submission from Sworddragon:

The documentation says that -OO does remove docstrings so applications should 
be aware of it. But there is also a case where a valid declared docstring isn't 
accessible anymore if -O is given. First the testcase:

test1.py:

import test2
def test1():
test1
print(test1.__doc__)
print(test2.test2.__doc__)


test2.py:

def test2():
test2


A simple check will show the current result:

sworddragon@ubuntu:~/tmp$ python3 -BO test1.py
test1
test2


If -OO is given the docstrings will be removed as expected:

sworddragon@ubuntu:~/tmp$ python3 -OO test1.py
None
None


Now we have also bytecode files saved on the disk without any docstrings. But 
if we try to use only -O the problem appears:

sworddragon@ubuntu:~/tmp$ python3 -O test1.py
test1
None


Even with only -O given we doesn't get the docstring for the imported module. 
The problem is that Python allows to load -OO bytecode files if -O bytecode was 
requested. I think the simplest solution would be to name -OO bytecode-files as 
.pyoo.

--
components: Interpreter Core
messages: 202462
nosy: Sworddragon
priority: normal
severity: normal
status: open
title: Loading -OO bytecode files if -O was requested can lead to problems
type: enhancement
versions: Python 3.3

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



[issue19532] compileall -f doesn't force to write bytecode files

2013-11-08 Thread Sworddragon

New submission from Sworddragon:

The force-option from compileall seems not to rebuild the bytecode files if 
they already exist. Here is an example of 2 calls:

root@ubuntu:~# python3 -m compileall -f
Skipping current directory
Listing '/usr/lib/python3.3'...
Compiling '/usr/lib/python3.3/__phello__.foo.py'...
Compiling '/usr/lib/python3.3/_compat_pickle.py'...
Compiling '/usr/lib/python3.3/_dummy_thread.py'...
...
Compiling '/usr/lib/python3.3/webbrowser.py'...
Compiling '/usr/lib/python3.3/xdrlib.py'...
Compiling '/usr/lib/python3.3/zipfile.py'...
Listing '/usr/lib/python3.3/plat-x86_64-linux-gnu'...
Listing '/usr/lib/python3.3/lib-dynload'...
Listing '/usr/local/lib/python3.3/dist-packages'...
Listing '/usr/lib/python3/dist-packages'...
root@ubuntu:~# python3 -m compileall -f
Skipping current directory
Listing '/usr/lib/python3.3'...
Listing '/usr/lib/python3.3/plat-x86_64-linux-gnu'...
Listing '/usr/lib/python3.3/lib-dynload'...
Listing '/usr/local/lib/python3.3/dist-packages'...
Listing '/usr/lib/python3/dist-packages'...

--
components: Library (Lib)
messages: 202463
nosy: Sworddragon
priority: normal
severity: normal
status: open
title: compileall -f doesn't force to write bytecode files
type: behavior
versions: Python 3.3

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



[issue18923] Use the new selectors module in the subprocess module

2013-11-08 Thread Charles-François Natali

Changes by Charles-François Natali cf.nat...@gmail.com:


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

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



[issue19530] cross thread shutdown of UDP socket exhibits unexpected behavior

2013-11-08 Thread Charles-François Natali

Charles-François Natali added the comment:

 When I try this with a UDP socket, the thread calling shutdown
 raises an OS Error (transport end point not connected).

Which is normal, since UDP sockets aren't connected.

 In contrast, sock.close does not cause the blocked thread to unblock.
  (This is the same for both TCP and UDP sockets.)

Which is normal, since you're not supposed to do this.

 I suspect Python is just exposing the underlying C behavior of
 shutdown and recvfrom.  I'd test it in C, but I'm not fluent in
 writing multi-threaded code in C.

You'd get exactly the same behavior.

 It would be nice if the recvfrom thread could raise some kind of
 exception, rather than appearing to return successfully.  It might
 also be worth reporting this bug upstream (where ever upstream is for
 recvfrom).  I'm running Python 3.3.1 on Linux.

This isn't a bug: you're not using using the BSD socket API correctly. You can 
try reporting this bug upstream (i.e. to the kernel mailing list): it'll be 
an interesting experience :-)

 The Python socket docs could mention that to unblock a reading thread, 
 sockets should be shutdown, not closed.  This might be implied in the
 current docs, but it could be made explicit.  See:

If we start documenting any possible misuse of our exposed API, the 
documentation will get *really* large :-)

Really, the problem is simply that you're not using the socket API as you 
should.

Iy you want do unblock your thread doing a recvfrom(), you have several options:
- send a datagram to the socket address from another thread
- use a timeout on the socket, and periodically check a termination flag
- use select()/poll() to multiplex between this socket and the read-end of a 
pipe: when you want to shutdown, simply write some data to the pipe: this will 
wake up select()/poll(), and you'll know your thread can exit

Closing as invalid.

--
nosy: +neologix
resolution:  - invalid
stage:  - committed/rejected
status: open - closed

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



[issue18874] Add a new tracemalloc module to trace memory allocations

2013-11-08 Thread Charles-François Natali

Changes by Charles-François Natali cf.nat...@gmail.com:


Added file: http://bugs.python.org/file32549/3bf73dcd0b42.diff

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



[issue19533] Unloading docstrings from memory if -OO is given

2013-11-08 Thread Sworddragon

New submission from Sworddragon:

Using -OO on a script will remove the __doc__ attributes but the docstrings 
will still be in the process memory. In the attachments is an example script 
which demonstrates this with a docstring of ~10 MiB (opening the file in an 
editor can need some time). Calling python3 -OO test.py will result in a 
memory usage of ~16 MiB on my system (Linux 64 Bit) while test.__doc__ is None.

--
components: Interpreter Core
files: test.py
messages: 202465
nosy: Sworddragon
priority: normal
severity: normal
status: open
title: Unloading docstrings from memory if -OO is given
type: enhancement
versions: Python 3.3
Added file: http://bugs.python.org/file32550/test.py

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