[issue15358] Test pkgutil.walk_packages in test_pkgutil instead of test_runpy

2012-07-17 Thread Chris Jerdonek

Chris Jerdonek chris.jerdo...@gmail.com added the comment:

I'd like to work on this if that's okay.  I've already written test cases for 
issue 7559 and issue 15299 that required creating temporary packages, so I 
understand the need.  And I'd also like to create test cases for issue 14787, 
which should really be done after this.

I think this should be split into two parts though: (1) refactor the 
create-package code in test_runpy into a separate helper module, and (2) move 
the refactored walk_package tests from test_runpy into test_pkgutil (so it's 
easier to see what has changed).

I can create a new issue for (1).

--

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



[issue15376] Refactor the create-package code in test_runpy into a helper module

2012-07-17 Thread Chris Jerdonek

New submission from Chris Jerdonek chris.jerdo...@gmail.com:

This issue is to refactor the create-package code in test_runpy into a helper 
module, as suggested in issue 15358.

This is a prerequisite to moving the pkgutil.walk_package() tests from 
test_runpy into test_pkgutil.

--
components: Tests
keywords: easy
messages: 165683
nosy: cjerdonek, ncoghlan
priority: normal
severity: normal
status: open
title: Refactor the create-package code in test_runpy into a helper module
versions: Python 3.3

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



[issue15358] Test pkgutil.walk_packages in test_pkgutil instead of test_runpy

2012-07-17 Thread Chris Jerdonek

Changes by Chris Jerdonek chris.jerdo...@gmail.com:


--
dependencies: +Refactor the create-package code in test_runpy into a helper 
module

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



[issue15374] venv environment variable should follow the conventions

2012-07-17 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

 Yes, there are a number of third-party utility packages (and many,
 many e.g. personal custom bash prompts) that check the value of the
 $VIRTUAL_ENV variable to detect whether one is currently active, and
 display its name. Unless there's an overriding reason, it would be
 nice to not require changing all of this code.

Ok, it sounds reasonable enough.

--

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



[issue15358] Test pkgutil.walk_packages in test_pkgutil instead of test_runpy

2012-07-17 Thread Nick Coghlan

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

That sounds good, and thanks for working on this - if we can get the tests 
cleaned up for the 3.3 release, that will make ongoing maintenance a lot easier.

--

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



[issue15377] os.path.join() error misleading with path1=None

2012-07-17 Thread Chris Jerdonek

New submission from Chris Jerdonek chris.jerdo...@gmail.com:

The error message for os.path.join() is misleading when the first argument is 
None.  The message should probably say something about mixing None and 
strings.

Python 3.3.0b1 (default:f954ee489896, Jul 16 2012, 22:42:29) 
[GCC 4.2.1 Compatible Apple Clang 3.1 (tags/Apple/clang-318.0.58)] on darwin
 import os
 os.path.join(None, 'a')
Traceback (most recent call last):
  File stdin, line 1, in module
  File .../cpython/Lib/posixpath.py, line 89, in join
components.) from None
TypeError: Can't mix strings and bytes in path components.

--
components: Library (Lib)
messages: 165685
nosy: cjerdonek
priority: normal
severity: normal
status: open
title: os.path.join() error misleading with path1=None
versions: Python 3.3

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



[issue15378] Underported Tools/unicode/comparecodecs.py

2012-07-17 Thread Serhiy Storchaka

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

Tools/unicode/gencodec.py was not properly ported from Python 2 to Python 3. 
The suggested patch fixes this porting issue.

--
components: Demos and Tools
files: decode_charmap_maxchar.patch
keywords: patch
messages: 165687
nosy: storchaka
priority: normal
severity: normal
status: open
title: Underported Tools/unicode/comparecodecs.py
type: behavior
versions: Python 3.2, Python 3.3
Added file: http://bugs.python.org/file26411/decode_charmap_maxchar.patch

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



[issue15377] os.path.join() error misleading with path1=None

2012-07-17 Thread Hynek Schlawack

Changes by Hynek Schlawack h...@ox.cx:


--
nosy: +hynek

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



[issue15379] Charmap decoding of no-BMP characters

2012-07-17 Thread Serhiy Storchaka

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

Yet one inconsistency in charmap codec.

 import codecs
 codecs.charmap_decode(b'\x00', 'strict', '\U0002000B')
('', 1)
 codecs.charmap_decode(b'\x00', 'strict', {0: '\U0002000B'})
('', 1)
 codecs.charmap_decode(b'\x00', 'strict', {0: 0x2000B})
Traceback (most recent call last):
  File stdin, line 1, in module
TypeError: character mapping must be in range(65536)

The suggested patch removes this unnecessary limitation in charmap decoder.

--
components: Interpreter Core
files: decode_charmap_maxchar.patch
keywords: patch
messages: 165688
nosy: storchaka
priority: normal
severity: normal
status: open
title: Charmap decoding of no-BMP characters
type: behavior
versions: Python 3.3
Added file: http://bugs.python.org/file26412/decode_charmap_maxchar.patch

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



[issue15378] Underported Tools/unicode/comparecodecs.py

2012-07-17 Thread Serhiy Storchaka

Serhiy Storchaka storch...@gmail.com added the comment:

Oops, wrong message, wrong patch.

Tools/unicode/comparecodecs.py was not properly ported from Python 2 to Python 
3. The suggested patch fixes this porting issue.

--
Added file: http://bugs.python.org/file26413/comparecodecs.patch

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



[issue15378] Underported Tools/unicode/comparecodecs.py

2012-07-17 Thread Serhiy Storchaka

Changes by Serhiy Storchaka storch...@gmail.com:


Removed file: http://bugs.python.org/file26411/decode_charmap_maxchar.patch

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



[issue15379] Charmap decoding of no-BMP characters

2012-07-17 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

Could you add a test to your patch?
Is the issue 3.3-specific?

--
nosy: +benjamin.peterson, ezio.melotti, haypo, lemburg, pitrou
stage:  - patch review

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



[issue15378] Underported Tools/unicode/comparecodecs.py

2012-07-17 Thread Antoine Pitrou

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


--
nosy: +ezio.melotti, georg.brandl

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



[issue15373] copy.copy() does not properly copy os.environment

2012-07-17 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

I agree with David that copy(os.environ) is rather ambiguous. I think the 
preferred idiom should be to call dict(os.environ).
As for __copy__, I don't know what it should do: perhaps simply raise an error 
when copying is attempted?

--
nosy: +pitrou

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



[issue15374] venv environment variable should follow the conventions

2012-07-17 Thread Antoine Pitrou

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


--
resolution:  - wont fix
status: open - closed

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



[issue15365] Traceback reporting can fail if IO cannot be imported

2012-07-17 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

The patch looks simple enough, but you should use spaces, not tabs.

--
nosy: +amaury.forgeotdarc, pitrou
stage:  - patch review

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



[issue15380] bytes/str mismatch in distribute

2012-07-17 Thread Mark Summerfield

New submission from Mark Summerfield m...@qtrac.eu:

I tried installing CherryPy into my local Python 3.2 build. I don't know if 
this is a problem with CherryPy's setup.py or with distribute but suspect the 
latter since I've had similar problems before.

$ /home/mark/opt/python32/bin/python3 setup.py install
running install
running bdist_egg
running egg_info
writing CherryPy.egg-info/PKG-INFO
writing top-level names to CherryPy.egg-info/top_level.txt
writing dependency_links to CherryPy.egg-info/dependency_links.txt
reading manifest file 'CherryPy.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'CherryPy.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_py
creating build
creating build/lib
creating build/lib/cherrypy
copying cherrypy/_cperror.py - build/lib/cherrypy
...
byte-compiling build/bdist.linux-x86_64/egg/cherrypy/_cperror.py to _cperror.pyc
...
installing package data to build/bdist.linux-x86_64/egg
running install_data
copying cherrypy/cherryd - build/bdist.linux-x86_64/egg/cherrypy
...
creating build/bdist.linux-x86_64/egg/EGG-INFO
installing scripts to build/bdist.linux-x86_64/egg/EGG-INFO/scripts
running install_scripts
running build_scripts
creating build/scripts-3.2
copying and adjusting cherrypy/cherryd - build/scripts-3.2
changing mode of build/scripts-3.2/cherryd from 644 to 755
creating build/bdist.linux-x86_64/egg/EGG-INFO/scripts
copying build/scripts-3.2/cherryd - 
build/bdist.linux-x86_64/egg/EGG-INFO/scripts
changing mode of build/bdist.linux-x86_64/egg/EGG-INFO/scripts/cherryd to 755
copying CherryPy.egg-info/PKG-INFO - build/bdist.linux-x86_64/egg/EGG-INFO
copying CherryPy.egg-info/SOURCES.txt - build/bdist.linux-x86_64/egg/EGG-INFO
copying CherryPy.egg-info/dependency_links.txt - 
build/bdist.linux-x86_64/egg/EGG-INFO
copying CherryPy.egg-info/top_level.txt - build/bdist.linux-x86_64/egg/EGG-INFO
zip_safe flag not set; analyzing archive contents...
cherrypy._cpmodpy: module references __file__
...
creating dist
creating 'dist/CherryPy-3.2.2-py3.2.egg' and adding 
'build/bdist.linux-x86_64/egg' to it
removing 'build/bdist.linux-x86_64/egg' (and everything under it)
Processing CherryPy-3.2.2-py3.2.egg
creating 
/home/mark/opt/python32/lib/python3.2/site-packages/CherryPy-3.2.2-py3.2.egg
Extracting CherryPy-3.2.2-py3.2.egg to 
/home/mark/opt/python32/lib/python3.2/site-packages
Adding CherryPy 3.2.2 to easy-install.pth file
Traceback (most recent call last):
  File setup.py, line 144, in module
main()
  File setup.py, line 139, in main
cmdclass=cmd_class,
  File /home/mark/opt/python32/lib/python3.2/distutils/core.py, line 148, in 
setup
dist.run_commands()
  File /home/mark/opt/python32/lib/python3.2/distutils/dist.py, line 917, in 
run_commands
self.run_command(cmd)
  File /home/mark/opt/python32/lib/python3.2/distutils/dist.py, line 936, in 
run_command
cmd_obj.run()
  File 
/home/mark/opt/python32/lib/python3.2/site-packages/distribute-0.6.10-py3.2.egg/setuptools/command/install.py,
 line 73, in run
self.do_egg_install()
  File 
/home/mark/opt/python32/lib/python3.2/site-packages/distribute-0.6.10-py3.2.egg/setuptools/command/install.py,
 line 101, in do_egg_install
cmd.run()
  File 
/home/mark/opt/python32/lib/python3.2/site-packages/distribute-0.6.10-py3.2.egg/setuptools/command/easy_install.py,
 line 236, in run
self.easy_install(spec, not self.no_deps)
  File 
/home/mark/opt/python32/lib/python3.2/site-packages/distribute-0.6.10-py3.2.egg/setuptools/command/easy_install.py,
 line 452, in easy_install
return self.install_item(None, spec, tmpdir, deps, True)
  File 
/home/mark/opt/python32/lib/python3.2/site-packages/distribute-0.6.10-py3.2.egg/setuptools/command/easy_install.py,
 line 503, in install_item
self.process_distribution(spec, dist, deps)
  File 
/home/mark/opt/python32/lib/python3.2/site-packages/distribute-0.6.10-py3.2.egg/setuptools/command/easy_install.py,
 line 522, in process_distribution
self.install_egg_scripts(dist)
  File 
/home/mark/opt/python32/lib/python3.2/site-packages/distribute-0.6.10-py3.2.egg/setuptools/command/easy_install.py,
 line 401, in install_egg_scripts
dist.get_metadata('scripts/'+script_name)
  File 
/home/mark/opt/python32/lib/python3.2/site-packages/distribute-0.6.10-py3.2.egg/setuptools/command/easy_install.py,
 line 615, in install_script
script_text = get_script_header(script_text) + (
  File 
/home/mark/opt/python32/lib/python3.2/site-packages/distribute-0.6.10-py3.2.egg/setuptools/command/easy_install.py,
 line 1449, in get_script_header
match = first_line_re.match(first)
TypeError: can't use a bytes pattern on a string-like object

--
assignee: eric.araujo
components: Distutils
messages: 165693
nosy: eric.araujo, mark, tarek
priority: normal
severity: normal
status: open
title: bytes/str mismatch in distribute
type: behavior
versions: Python 3.2


[issue15377] os.path.join() error misleading with path1=None

2012-07-17 Thread Hynek Schlawack

Hynek Schlawack h...@ox.cx added the comment:

I propose the following patch (against 3.2) that does the right thing.

--
keywords: +patch
nosy: +ncoghlan, pitrou
stage:  - patch review
Added file: http://bugs.python.org/file26414/nicer-error-for-none.diff

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



[issue15377] os.path.join() error misleading with path1=None

2012-07-17 Thread Hynek Schlawack

Changes by Hynek Schlawack h...@ox.cx:


--
assignee:  - hynek
versions: +Python 3.2

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



[issue9591] kqueue not reporting EOF under certain circumstances

2012-07-17 Thread Volodymyr Kostyrko

Volodymyr Kostyrko c.kw...@gmail.com added the comment:

I was wrong. The current behavior is correct. The difference between execution 
is a difference between pipe file object and vnode file object. vnode backed 
file objects doesn't send any signals and care should be taken to detect file 
position.

--
resolution:  - invalid
status: open - closed

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



[issue15377] os.path.join() error misleading with path1=None

2012-07-17 Thread Nick Coghlan

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

I'd be more inclined to tighten up the check for the can't mix message to 
something like:

 valid_types = all(isinstance(s, (str, bytes, bytearray)) for s in (a, ) + p)
 if valid_types:
# Must have a mixture of text and binary data
raise TypeError(Can't mix strings and bytes in path components.)
 raise

If people pass in something that isn't a valid argument *at all*, then I'm fine 
with just letting the underlying exception pass through.

The str/bytes case is just worth special-casing because either on their own 
*are* valid arguments.

--

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



[issue15230] runpy.run_path doesn't set __package__ correctly

2012-07-17 Thread Nick Coghlan

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

*grumble*grumble*os-x-and-its-crazy-symlink-as-tmp-dir*grumble*grumble*

I'm fairly sure I've tripped over this kind of thing before, so I believe I 
know how to fix it (add a realpath() call when figuring out the expected path 
value).

The buildbots will let me know if I'm right, of course :)

--

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



[issue15365] Traceback reporting can fail if IO cannot be imported

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

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

Certainly.  But the submission filter would have caught that.
The question is:  Is it acceptible to simply ignore errors from this api when 
printing tracebacks?  There are other errors that can be returned as well.
The trouble is, any errors in the traceback reporting will be ignored anyway, 
since there is no way to report them :)

--

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



[issue15365] Traceback reporting can fail if IO cannot be imported

2012-07-17 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

 The trouble is, any errors in the traceback reporting will be ignored
 anyway, since there is no way to report them :)

Which is a good reason to ignore them, isn't it? ;)

--

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



[issue15380] bytes/str mismatch in distribute

2012-07-17 Thread Ned Deily

Ned Deily n...@acm.org added the comment:

Distribute is not part of Distutils. According to its PyPI page 
(http://pypi.python.org/pypi/distribute#feedback-and-getting-involved), the 
project has its own issue tracker at 
https://bitbucket.org/tarek/distribute/issues/

--
nosy: +ned.deily
resolution:  - invalid
status: open - closed

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



[issue15380] bytes/str mismatch in distribute

2012-07-17 Thread Ned Deily

Changes by Ned Deily n...@acm.org:


--
stage:  - committed/rejected

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



[issue15230] runpy.run_path doesn't set __package__ correctly

2012-07-17 Thread Roundup Robot

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

New changeset 07ed744a47f6 by Nick Coghlan in branch '3.2':
Issue #15230: Attempt to make the OS X buildbots happy by resolving the tmp dir 
symlink in the test suite
http://hg.python.org/cpython/rev/07ed744a47f6

New changeset cb7e8ee489a1 by Nick Coghlan in branch 'default':
Merge Issue #15230 OS X buildbot fix from 3.2
http://hg.python.org/cpython/rev/cb7e8ee489a1

--

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



[issue15376] Refactor the create-package code in test_runpy into a helper module

2012-07-17 Thread Nick Coghlan

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

One trap to watch out for: it's best to call os.path.realpath() on any 
temporary directories created, since the interpreter tends to do that 
internally.

I'd previously dealt with this in script_helper.temp_dir, but it came up again 
when I tightened up the runpy.run_module tests to actually check that __file__ 
ended up with the expected value.

--

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



[issue15377] os.path.join() error misleading with path1=None

2012-07-17 Thread Hynek Schlawack

Hynek Schlawack h...@ox.cx added the comment:

Yeah, we talked about that exact think with Antoine on IRC. New proposal.

--
Added file: http://bugs.python.org/file26415/nicer-error-for-none-v2.diff

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



[issue15377] os.path.join() error misleading with path1=None

2012-07-17 Thread Nick Coghlan

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

Looks good to me

--

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



[issue15230] runpy.run_path doesn't set __package__ correctly

2012-07-17 Thread Nick Coghlan

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

Closing again, since the OS X buildbot was happy with the change on 3.2. If 
trunk fails (which it shouldn't), that should be filed as a new issue (as it 
would almost certainly relate to the move from the pkgutil emulation to 
importlib).

--
status: open - closed

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



[issue15377] os.path.join() error misleading with path1=None

2012-07-17 Thread Roundup Robot

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

New changeset 5553a53a230a by Hynek Schlawack in branch '3.2':
#15377: Make posixpath.join() more strict when checking for str/bytes mix
http://hg.python.org/cpython/rev/5553a53a230a

New changeset d087ef80372d by Hynek Schlawack in branch 'default':
#15377: Make posixpath.join() more strict when checking for str/bytes mix
http://hg.python.org/cpython/rev/d087ef80372d

--
nosy: +python-dev

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



[issue15377] os.path.join() error misleading with path1=None

2012-07-17 Thread Hynek Schlawack

Hynek Schlawack h...@ox.cx added the comment:

Fine! :)

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

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



[issue14988] _elementtree: Raise ImportError when importing of pyexpat fails

2012-07-17 Thread Roundup Robot

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

New changeset d896fd0a8ba7 by Eli Bendersky in branch '3.2':
ISsue #14988: restore Python 2's behavior of raising ImportError when unable to 
load pyexpat, instead of a SystemError/RuntimeError
http://hg.python.org/cpython/rev/d896fd0a8ba7

New changeset c8774ff45733 by Eli Bendersky in branch 'default':
Merge for #14988
http://hg.python.org/cpython/rev/c8774ff45733

--
nosy: +python-dev

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



[issue14988] _elementtree: Raise ImportError when importing of pyexpat fails

2012-07-17 Thread Eli Bendersky

Eli Bendersky eli...@gmail.com added the comment:

Committed fixes to raise ImportError in both Python 3.2 and 3.3

At the moment no test added because I'm having trouble using 
import_fresh_module to avoid re-importing of pyexpat in the etree tests (it 
gets imported anyway).

--

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



[issue15379] Charmap decoding of no-BMP characters

2012-07-17 Thread Serhiy Storchaka

Serhiy Storchaka storch...@gmail.com added the comment:

Fixing for 3.2 and lesser is possible, but expensive, because of narrow build 
limitation. If necessary, I will give the patch, but it is easier to mark it as 
wont fix for pre-3.3 versions.

Here is a tests for charmap decoding. Tests added not only for this issue, but 
for all non-covered cases with int2str and int2str mappings.

--
Added file: http://bugs.python.org/file26416/decode_charmap_tests.patch

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



[issue15314] Use importlib instead of pkgutil in runpy

2012-07-17 Thread Roundup Robot

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

New changeset 16e50e85d684 by Nick Coghlan in branch 'default':
Issue #15314: Tweak a pkgutil test to hopefully be more Windows friendly
http://hg.python.org/cpython/rev/16e50e85d684

--

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



[issue15373] copy.copy() does not properly copy os.environment

2012-07-17 Thread R. David Murray

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

Well, I think the fact that os.environ.copy is explicitly supported (and does 
indeed do dict(os.environ)) is an argument in favor of giving that same meaning 
to copy(os.environ).  I think that follows the principle of least surprise.

--

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



[issue15314] Use importlib instead of pkgutil in runpy

2012-07-17 Thread Nick Coghlan

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

OK, I just pushed a tweak to the test that will hopefully resolve the problem. 
If the tweak works, though, it does suggest we have a bit of weirdness in 
importlib: it means pkgutil.get_importer() is returning an importer on POSIX 
systems, but None on Windows.

The test tweak to get OS X passing for #15230 on 3.2 (where it was already 
passing on trunk) suggests we may also have a case where 3.2 called 
os.path.realpath() before setting __file__, while 3.3 does not.

--

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



[issue1767933] Badly formed XML using etree and utf-16

2012-07-17 Thread Roundup Robot

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

New changeset 51978f89e5ed by Eli Bendersky in branch 'default':
Optimize tostringlist by taking the stream class outside the function. It's now 
2x faster on short calls. Related to #1767933
http://hg.python.org/cpython/rev/51978f89e5ed

--

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



[issue15381] Optimize BytesIO to so less reallocations when written, similarly to StringIO

2012-07-17 Thread Eli Bendersky

New submission from Eli Bendersky eli...@gmail.com:

From this pydev thread: 
http://mail.python.org/pipermail/python-dev/2012-July/120981.html

BytesIO is actually missing an optimisation that is already used in
StringIO: the StringIO C implementation uses a fragment accumulator
internally, and collapses that into a single string object when
getvalue() is called. BytesIO is still using the old
resize-the-buffer-as-you-go strategy, and thus ends up repeatedly
reallocating the buffer as the data sequence grows incrementally.

It should be optimised to work the same way StringIO does (which is
effectively the same way that the monkeypatched version works)

--
components: Library (Lib)
messages: 165715
nosy: eli.bendersky, ncoghlan, pitrou
priority: normal
severity: normal
stage: needs patch
status: open
title: Optimize BytesIO to so less reallocations when written, similarly to 
StringIO
type: performance
versions: Python 3.4

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



[issue15381] Optimize BytesIO to so less reallocations when written, similarly to StringIO

2012-07-17 Thread Tshepang Lekhonkhobe

Changes by Tshepang Lekhonkhobe tshep...@gmail.com:


--
nosy: +tshepang

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



[issue15381] Optimize BytesIO to so less reallocations when written, similarly to StringIO

2012-07-17 Thread Eli Bendersky

Eli Bendersky eli...@gmail.com added the comment:

This optimization for StringIO was done in issue #13149

--

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



[issue15369] pybench and test.pystone poorly documented

2012-07-17 Thread Brett Cannon

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

I disagree. They are outdated benchmarks and probably should either be removed 
or left undocumented. Proper testing of performance is with the Unladen Swallow 
benchmarks.

--
nosy: +brett.cannon

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



[issue15381] Optimize BytesIO to so less reallocations when written, similarly to StringIO

2012-07-17 Thread Serhiy Storchaka

Serhiy Storchaka storch...@gmail.com added the comment:

I am not see that BytesIO is slower than StringIO (both are about 30% slower 
than append/join).

$ ./python -m timeit -s import io; d=[b'a'*10,b'bb'*5,b'ccc'*5]*1000  b=[]; 
w=b.append  for x in d: w(x)  b''.join(b)
1000 loops, best of 3: 966 usec per loop

$ ./python -m timeit -s import io; d=['a'*10,'bb'*5,'ccc'*5]*1000  b=[]; 
w=b.append  for x in d: w(x)  ''.join(b)
1000 loops, best of 3: 918 usec per loop

$ ./python -m timeit -s import io; d=[b'a'*10,b'bb'*5,b'ccc'*5]*1000  
b=io.BytesIO(); w=b.write  for x in d: w(x)  b.getvalue()
1000 loops, best of 3: 1.22 msec per loop

$ ./python -m timeit -s import io; d=['a'*10,'bb'*5,'ccc'*5]*1000  
b=io.StringIO(); w=b.write  for x in d: w(x)  b.getvalue()
1000 loops, best of 3: 1.24 msec per loop

--
nosy: +storchaka

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



[issue15369] pybench and test.pystone poorly documented

2012-07-17 Thread Marc-Andre Lemburg

Marc-Andre Lemburg m...@egenix.com added the comment:

Brett Cannon wrote:
 
 Brett Cannon br...@python.org added the comment:
 
 I disagree. They are outdated benchmarks and probably should either be 
 removed or left undocumented. Proper testing of performance is with the 
 Unladen Swallow benchmarks.

I disagree with your statement. Just like every benchmark, they serve
their purpose in their particular field of use, e.g. pybench may not
be useful for the JIT approach originally taken by the Unladden Swallow
project, but it's still useful to test/check changes in the non-JIT
CPython interpreter and it's extensible to take new developments
into account. pystone is useful to get a quick feel the performance
of Python on a machine.

--
nosy: +lemburg

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



[issue15364] sysconfig confused by relative paths

2012-07-17 Thread Richard Oudkerk

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

Updated patch which clarifies that for an installed python on a posix system, 
get_config_var('srcdir') == get_path('stdlib').

Eg, if sys.executable == '/usr/local/bin/python3.3' then 
get_config_var('srcdir') == '/usr/local/lib/python3.3'.

This is a little arbitrary, but seems as sensible a value as any other.  (Or 
maybe it would be better to have get_config_var('srcdir') == None instead.)

--
stage: needs patch - patch review
Added file: http://bugs.python.org/file26417/sysconf.patch

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



[issue15381] Optimize BytesIO to so less reallocations when written, similarly to StringIO

2012-07-17 Thread John O'Connor

Changes by John O'Connor tehj...@gmail.com:


--
nosy: +jcon

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



[issue15369] pybench and test.pystone poorly documented

2012-07-17 Thread Florent Xicluna

Florent Xicluna florent.xicl...@gmail.com added the comment:

Actually, I discovered python -m test.pystone during the talk of Mike Müller 
at EuroPython. http://is.gd/fasterpy

Even if they are suboptimal for true benchmarks, they should probably be 
mentioned somewhere.
In the same paragraph, there should be a link to the Grand Unified Python 
Benchmark Suite as best practice:

http://hg.python.org/benchmarks
http://hg.python.org/benchmarks/file/tip
http://hg.python.org/benchmarks/file/tip/README.txt

The last paragraph of this wiki page might be reworded and included in the 
Python documentation:
http://code.google.com/p/unladen-swallow/wiki/Benchmarks
http://code.google.com/p/unladen-swallow/wiki/Benchmarks#Benchmarks_we_don't_use



BTW, there's also this website which seems not updated anymore…
http://speed.python.org/

--
nosy: +jnoller

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



[issue15368] bytecode generation is not deterministic

2012-07-17 Thread Meador Inge

Meador Inge mead...@gmail.com added the comment:

New patch that addresses feedback from Brett's code review (thanks!).

--
Added file: http://bugs.python.org/file26418/issue15368-v1.patch

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



[issue1767933] Badly formed XML using etree and utf-16

2012-07-17 Thread Serhiy Storchaka

Serhiy Storchaka storch...@gmail.com added the comment:

How about porting this to 3.2? The main difficulty I see with the tests, which 
significantly differ in 3.2 and 3.3.

--

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



[issue15369] pybench and test.pystone poorly documented

2012-07-17 Thread Brett Cannon

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

The Unladen Swallow benchmarks are in no way specific to JITs; it is a set of 
thorough benchmarks for measuring the overall performance of a Python VM.

As for speed.python.org, we know that it is currently not being updated as we 
are waiting for people to have the time to move it forward and replace 
speed.pypy.org for all Python VMs.

--
nosy:  -jnoller

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



[issue15151] Documentation for Signature, Parameter and signature in inspect module

2012-07-17 Thread Yury Selivanov

Changes by Yury Selivanov yselivanov...@gmail.com:


--
nosy:  -Yury.Selivanov

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



[issue15307] Patch for --symlink support in pyvenv with framework python

2012-07-17 Thread Roundup Robot

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

New changeset b79d276041a8 by Vinay Sajip in branch 'default':
Closes #15307: symlinks now work on  OS X with framework Python builds. Patch 
by Ronald Oussoren.
http://hg.python.org/cpython/rev/b79d276041a8

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

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



[issue15343] pydoc -w package writes out page with empty Package Contents section

2012-07-17 Thread Christopher the Magnificent

Christopher the Magnificent ultimate.mac.fana...@gmail.com added the comment:

ISSUE CONFIRMED FIXED ON MY END, AND MANY THANKS

I downloaded, compiled, and installed the latest Python 3.3 beta on my machine 
with Mercurial, and can confirm that the problem is no longer presenting itself.

Thank you and great job to you smart people that know the guts of Python and 
its libraries, who coordinated and coded to get this fixed, especially Mr. Nick 
Coghlan, who it appears took on the responsibility for resolving this.  My hat 
is off to you all!

--Christopher

P. S.  I'm fairly new to the bug forums.  If anyone is bothered that I wrote 
this after the issue closed, just let me know what the policy is so I can learn 
to adapt to it.  If no one complains, I will assume it was okay in this 
instance.  :-)

--

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



[issue15151] Documentation for Signature, Parameter and signature in inspect module

2012-07-17 Thread Yury Selivanov

Yury Selivanov yselivanov...@gmail.com added the comment:

The new patch version (inspect.pep362.2.patch) includes more examples and 
includes recommendations to use the Signature Object instead of 
'inspect.getfullargsspec'.  Please review.

--
Added file: http://bugs.python.org/file26419/inspect.pep362.2.patch

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



[issue15109] sqlite3.Connection.iterdump() dies with encoding exception

2012-07-17 Thread Ilpo Nyyssönen

Changes by Ilpo Nyyssönen i...@iki.fi:


--
nosy: +biny

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



[issue15151] Documentation for Signature, Parameter and signature in inspect module

2012-07-17 Thread Yury Selivanov

Yury Selivanov yselivanov...@gmail.com added the comment:

New patch version - inspect.pep362.3.patch

I decided to put the new doc section above the Classes and functions. The new 
section is now called Introspecting callables with Signature Object.  Aside 
from that everything is the same as in the 2nd patch.

--
Added file: http://bugs.python.org/file26420/inspect.pep362.3.patch

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



[issue15364] sysconfig confused by relative paths

2012-07-17 Thread Ned Deily

Ned Deily n...@acm.org added the comment:

 This is a little arbitrary, but seems as sensible a value as any other.
 (Or maybe it would be better to have get_config_var('srcdir') == None
 instead.)

'srcdir' is problematic for any installed build.  Once make install has been 
performed, there is no obligation to keep the original source and build dirs 
around anymore.  For Pythons installed on other machines via a binary 
installer, like the python.org OS X ones, some of the paths returned by 
sysconfig are not meaningful on the installed machine.  For an OS X framework 
build, the Makefile and friends are copied into a 'config' directory that is 
created within the installed framework. So, with the patch, the contents of 
that directory (returned by the patched 'srcdir' value) is:
['Makefile',
 'Setup',
 'Setup.config',
 'Setup.local',
 'config.c',
 'config.c.in',
 'install-sh',
 'libpython3.3.a',
 'libpython3.3.dylib',
 'makesetup',
 'python.o']

Is that a meaningful surrogate for the build 'srcdir'?

Beyond that, I don't understand why the patch behavior depends on whether the 
srcdir is an absolute path or not.  I often use absolute paths to configure a 
build.  If not in a build directory, 'srcdir' should always return either the 
proposed value based on what get_makefile_filename() returns or it should 
return None.  I don't have a strong opinion at the moment about which.  One 
factor should be an inspection and running of all of the tests.  A quick grep 
of Lib/ didn't find many references to 'srcdir'.

One other point: distutils still has its own copy of sysconfig.  Strong 
consideration should be given to making a similar change there.

--
nosy: +ned.deily

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15364
___
___
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-07-17 Thread Mikhail Korobov

Changes by Mikhail Korobov kmik...@gmail.com:


--
nosy: +kmike

___
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



[issue15382] os.utime() mishandles some arguments

2012-07-17 Thread Arfrever Frehtes Taifersar Arahesis

New submission from Arfrever Frehtes Taifersar Arahesis 
arfrever@gmail.com:

Contrarily to documentation:

1. os.utime() accepts a tuple with floats passed by ns argument:
 os.utime(file, ns=(0.5, 0.5))


2. os.utime() does not accept explicit ns=None:
 os.utime(file, times=None)
 os.utime(file, ns=None)
Traceback (most recent call last):
  File stdin, line 1, in module
TypeError: utime: 'ns' must be a tuple of two ints


3. os.utime() does not accept both times and ns when only times is a tuple:
 os.utime(file, times=None, ns=(0, 0))
 os.utime(file, times=(0, 0), ns=None)
Traceback (most recent call last):
  File stdin, line 1, in module
ValueError: utime: you may specify either 'times' or 'ns' but not both


--
messages: 165730
nosy: Arfrever, haypo, larry
priority: normal
severity: normal
status: open
title: os.utime() mishandles some arguments
versions: Python 3.3

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



[issue15381] Optimize BytesIO to so less reallocations when written, similarly to StringIO

2012-07-17 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com:


--
nosy: +Arfrever

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



[issue11176] give more meaningful argument names in argparse documentation

2012-07-17 Thread David Lam

David Lam d...@dlam.me added the comment:

yup yup, go for it

--

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



[issue15382] os.utime() mishandles some arguments

2012-07-17 Thread Roger Serwy

Roger Serwy roger.se...@gmail.com added the comment:

Attached is a preliminary patch to check ns != Py_None.

--
components: +Library (Lib)
keywords: +patch
nosy: +serwy
type:  - behavior
Added file: http://bugs.python.org/file26421/issue15382.patch

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



[issue15382] os.utime() mishandles some arguments

2012-07-17 Thread STINNER Victor

STINNER Victor victor.stin...@gmail.com added the comment:

@serwy: can you please write a test for your patch?

--

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



[issue15364] sysconfig confused by relative paths

2012-07-17 Thread Richard Oudkerk

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

 Beyond that, I don't understand why the patch behavior depends on 
 whether the srcdir is an absolute path or not.

The os.path.isabs() test is actually redundant since os.path.join(base, srcdir) 
== srcdir if srcdir is an absolute path.  I only added that test to be explicit 
about what happens if the original value is an absolute path. 

 I often use absolute paths to configure a build.  If not in a build 
 directory, 'srcdir' should always return either the proposed value 
 based on what get_makefile_filename() returns or it should return 
 None.

Removing the isabs() test would not change the calculated value as I indicated 
above.

Using None would be the sanest option, but I don't know if any current code 
depends on the value being a string.

 One other point: distutils still has its own copy of sysconfig.  
 Strong consideration should be given to making a similar change there.

For a source build, distutils.sysconfig.get_config_var('srcdir') gives the 
right answer as an absolute path, *except* when the current working directory 
contains sys.executable.  I think it should always return an absolute path.  
The fact that currently it does not probably explains the mysteriously 
comment below from distutils/test/support.py:

def _get_xxmodule_path():
srcdir = sysconfig.get_config_var('srcdir')
candidates = [
# use installed copy if available
os.path.join(os.path.dirname(__file__), 'xxmodule.c'),
# otherwise try using copy from build directory
os.path.join(srcdir, 'Modules', 'xxmodule.c'),
# srcdir mysteriously can be $srcdir/Lib/distutils/tests when
# this file is run from its parent directory, so walk up the
# tree to find the real srcdir
os.path.join(srcdir, '..', '..', '..', 'Modules', 'xxmodule.c'),
]
for path in candidates:
if os.path.exists(path):
return path

BTW, I was wrong in my earlier message when I claimed that srcdir == 
get_path('stdlib') for an installed python.  That is only true if the relative 
srcdir is '..'.  The attached patch removes that check from the unit tests.

--
Added file: http://bugs.python.org/file26422/sysconf.patch

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



[issue15382] os.utime() mishandles some arguments

2012-07-17 Thread Roger Serwy

Roger Serwy roger.se...@gmail.com added the comment:

_rev1 has a basic test. Is it sufficient?

--
Added file: http://bugs.python.org/file26423/issue15382_rev1.patch

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



[issue15364] sysconfig confused by relative paths

2012-07-17 Thread Ned Deily

Ned Deily n...@acm.org added the comment:

Upon further consideration, while it sounds appealing, perhaps returning None 
is not the better choice. As far as I know, up until now all config vars are 
either of type str or type int.  Adding None to the mix might be asking for 
trouble.

With no patch, running from an installed framework build:
 sys.executable
'/py/dev/default/b10.7_t10.7_x4.3_cclang_d/fw/root/bin/python3.3'
 import sysconfig as sc, distutils.sysconfig as dsc
 sc.is_python_build()
False
 sc.get_config_var('srcdir')
'/py/dev/default/b10.7_t10.7_x4.3_cclang_d'
 dsc.get_config_var('srcdir')
'.'

With the latest patch, as above:
 sys.executable
'/py/dev/default/b10.7_t10.7_x4.3_cclang_d/fw/root/bin/python3.3'
 import sysconfig as sc, distutils.sysconfig as dsc
 sc.is_python_build()
False
 sc.get_config_var('srcdir')
'/py/dev/default/b10.7_t10.7_x4.3_cclang_d/fw/root/Library/Frameworks/pytest_10_7.framework/Versions/3.3/lib/python3.3/config-3.3dm'
 dsc.get_config_var('srcdir')
'.'

The patched results looks OK except, of course, for the discrepancy with 
distutils.sysconfig.  I think we should fix that and get this all into 3.3.0.  
Otherwise we'll be stuck with the current broken behavior until 3.4 at the 
earliest.

One nit comment on the currrent patch: s/will not effect it/will not affect 
it (one of those gotchas in English).

--

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



[issue15364] sysconfig confused by relative paths

2012-07-17 Thread Ned Deily

Ned Deily n...@acm.org added the comment:

I should have noted that, in the above tests, 
distutils.sysconfig.get_makefile_filename() is already doing the right thing:

 dsc.get_makefile_filename()
'/py/dev/default/b10.7_t10.7_x4.3_cclang_d/fw/root/Library/Frameworks/pytest_10_7.framework/Versions/3.3/lib/python3.3/config-3.3dm/Makefile'
[70312 refs]
 sc.get_makefile_filename() == dsc.get_makefile_filename()
True

--

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



[issue15364] sysconfig confused by relative paths

2012-07-17 Thread Éric Araujo

Éric Araujo mer...@netwok.org added the comment:

Agree on fixing this for 3.3, if it’s not possible to backport to all stable 
branches.  Will review.

--
versions: +Python 3.3

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



[issue14513] IDLE icon switched and switches on Windows taskbar

2012-07-17 Thread Roger Serwy

Changes by Roger Serwy roger.se...@gmail.com:


--
components: +IDLE -Installation, Windows

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



[issue14513] IDLE icon switched and switches on Windows taskbar

2012-07-17 Thread Roger Serwy

Changes by Roger Serwy roger.se...@gmail.com:


--
components: +Windows

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



[issue1767933] Badly formed XML using etree and utf-16

2012-07-17 Thread Eli Bendersky

Eli Bendersky eli...@gmail.com added the comment:

Frankly, I don't think the problem is serious enough to warrant a backport to 
3.2, given that 3.3 gonna be out in a few weeks. The issue was open for 5 years 
without anyone seriously complaining :)

--

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



[issue15383] Autocompletion crashes Python if the __builtins__ module cannot be found.

2012-07-17 Thread Tyler Crompton

New submission from Tyler Crompton gtr...@gmail.com:

Doing one of the following crashes Python.

del __builtins__
a{Tab}

or

builtins = __builtins__
del __builtins__
a{Tab}

If you do a print screen, immediately, you will see the following error:

*** Internal Error: rpc.py:SocketIO.localcall()

 Object: exec
 Method: bound method Executive.get_the_completion_list of 
idlelib.run.Executive object at 0x02DC2710
 Args: ('', 1)

Traceback (most recent call last):
  File C:\Python32\lib\idlelib\rpc.py, line 188, in localcall
ret = method(*args, **kwargs)
  File C:\Python32\lib\idlelib\run.py, line 327, in 
get_the_completion_list
return self.autocomplete.fetch_completions(what, mode)
  File C:\Python32\lib\idlelib\AutoComplete.py, line 189, in 
fetch_completions
namespace.update(__main__.__builtins__.__dict__)
AttributeError: 'module' object has no attribute '__builtins__'

Additionally, when __builtins__ is deleted (in IDLE), __builtins__ becomes a 
dictionary. If one were to then do __builtins__.clear(), the interpreter stops 
all interpreting. IDLE moreorless becomes a text editor with syntax 
highlighting. If you try to use autocomplete, Python hangs before crashing.

I realize that doing such is pointless, but it behaves differently than 
interactive console interpreters. Interactive console interpreters don't 
convert __builtins__ to a dictionary upon its deletion. I feel that this error 
can be handled to prevent crashing.

--
components: IDLE
messages: 165741
nosy: Tyler.Crompton
priority: normal
severity: normal
status: open
title: Autocompletion crashes Python if the __builtins__ module cannot be found.
type: crash
versions: Python 3.2

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



[issue14513] IDLE icon switched and switches on Windows taskbar

2012-07-17 Thread Roger Serwy

Roger Serwy roger.se...@gmail.com added the comment:

With 3.3.0b1 amd64, I can pin IDLE to the taskbar with the appropriate icon 
(white page with Python logo). When I unpin IDLE with an editor window focused, 
the icon becomes the Tk logo. However, re-pinning the app brings back the other 
icon.

Terry, can you verify that the latest builds work?

--
nosy: +serwy

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



[issue14579] CVE-2012-2135: Vulnerability in the utf-16 decoder after error handling

2012-07-17 Thread Serhiy Storchaka

Serhiy Storchaka storch...@gmail.com added the comment:

Please, can anyone do a final review and commit?

Here are three patches for three Python versions:

2.7: utf16_error_handling-2.7.patch. Fix for one minor bug (overreading) and 
tests.

3.2: utf16_error_handling-3.2_4.patch. Fix for one critical security bug 
(CVE-2012-2135) and several minor bugs, tests.

3.3: utf16_error_handling-3.3.patch. Only tests.

--
Added file: 
http://bugs.python.org/file26424/utf16_error_handling_tests-3.3.patch

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



[issue14579] CVE-2012-2135: Vulnerability in the utf-16 decoder after error handling

2012-07-17 Thread Serhiy Storchaka

Changes by Serhiy Storchaka storch...@gmail.com:


--
components: +Interpreter Core, Unicode
versions: +Python 2.7 -Python 3.1

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