[issue15340] OSError with import random when /dev/urandom doesn't exist (regression from 2.6)

2012-09-04 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/issue15340
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14774] _sysconfigdata.py doesn't support multiple build configurations

2012-09-04 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/issue14774
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15298] _sysconfigdata is generated in srcdir, not builddir

2012-09-04 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/issue15298
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15819] Unable to build Python out-of-tree when source tree is readonly.

2012-09-04 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/issue15819
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15833] most failures to write byte-compiled file no longer suppressed

2012-09-04 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/issue15833
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15838] make install tries to create lib2to3 grammar pickles in source directory

2012-09-04 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/issue15838
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15857] memoryview: complete support for struct packing/unpacking

2012-09-04 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/issue15857
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15645] 2to3 Grammar pickles not created when upgrading to 3.3.0b2

2012-09-04 Thread Ronald Oussoren

Ronald Oussoren added the comment:

Is it really possible that the pickle is created after calculation of the 
wildcard expansion? The GNU make manual says that make will run multiple 
recipes in parallel when the -j option is used (that is, multiple targets are 
build at the same time), not that the commands in a recipe are run at the same 
time. That latter would break a lot of assumptions.

--

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



[issue15838] make install tries to create lib2to3 grammar pickles in source directory

2012-09-04 Thread Ronald Oussoren

Ronald Oussoren added the comment:

FWIW the patch is issue15645 was a patch that fixed the issue with minimal 
changes, as it was created close to the first 3.3 release candidate I didn't 
want to change code when that could be avoided.

A fix that writes the generated file into the build tree instead of the source 
tree requires changes to lib2to3.pgen.driver:load_grammar: it assumes it can 
derive the path of the pickle file from the path of the grammar file, which 
wouldn't be true when storing the pickle file in the build directory and the 
build directory is not the same as the source directory.

Now that I look at this code again: the patch is issue15645 was probably make 
necessary by the introduction of $(PYTHON_FOR_BUILD), that expands to 
'./$(BUILD_PYTHON) -E' on my machine, and that means the PYTHONPATH setting is 
ignored which is why the file is created in the source directory instead of the 
installation directory.

This means it could be fairly easy to properly fix this issue:

- Move the line back to the end of the libinstall recipe
- Add import sys, os; sys.path.insert(0, os.environ['PYTHONPATH']
  to the start of the python scriptlet (before import lib2to3)

I haven't tested yet if that actually works though.

--

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



[issue2771] Test issue

2012-09-04 Thread Ezio Melotti

Ezio Melotti added the comment:

test issue linking: issue1528167 issue 1528167 #1528167

--

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



[issue15533] subprocess.Popen(cwd) documentation

2012-09-04 Thread Andrew Svetlov

Andrew Svetlov added the comment:

I believe it's trick for Tru64 platform.
I've asked to support of this in python-dev.

--

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



[issue15533] subprocess.Popen(cwd) documentation

2012-09-04 Thread Chris Jerdonek

Chris Jerdonek added the comment:

For future reference, here is the beginning of the e-mail thread on python-dev:

http://mail.python.org/pipermail/python-dev/2012-September/121584.html

We also need to know whether the Tru64 trick needs to be used in 2.7, since 
this documentation issue also affects 2.7.

--

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



[issue15858] tarfile missing entries due to omitted uid/gid fields

2012-09-04 Thread Tom Lynn

Tom Lynn added the comment:

I think the default has to be 0 for consistency with how other empty numeric 
fields are handled.

In theory spaces and NULs are supposed to be equivalent terminators in numeric 
fields, but I've just noticed that plexus-archiver is also using leading spaces 
rather than leading zeros (against the spec), e.g. ' 10422\x00 '.  tarfile 
currently supports this, which I think is good, so I think the right approach 
is to lstrip(' ') fields and then treat space as a terminator.

--

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



[issue15859] PyUnicode_EncodeFSDefault win32 inconsistancy.

2012-09-04 Thread Ezio Melotti

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


--
nosy: +haypo
type:  - behavior

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



[issue15836] unittest assertRaises should verify excClass is actually a BaseException class

2012-09-04 Thread Ezio Melotti

Ezio Melotti added the comment:

Would using assertRaises to test assertRaises in the tests be to meta?

--
assignee:  - michael.foord

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



[issue15533] subprocess.Popen(cwd) documentation

2012-09-04 Thread Chris Jerdonek

Chris Jerdonek added the comment:

Andrew, I seem to be getting a test failure for test_executable_with_cwd() with 
your updated patch (the child process is outputting an absolute path rather 
than '').

I will update the patch to fix.  There are also some stylistic changes I would 
like to make to the helper method (updated code comment, etc).

--

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



[issue11664] Add patch method to unittest.TestCase

2012-09-04 Thread Julian Berman

Changes by Julian Berman julian+python@grayvines.com:


--
nosy: +Julian

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



[issue15533] subprocess.Popen(cwd) documentation

2012-09-04 Thread Chris Jerdonek

Chris Jerdonek added the comment:

Here is an updated patch.  The changes I made are:

(1) Update code comments in _call_popen_and_assert().
(2) Fix test failure.
(3) Rename _call_popen_and_assert() to _assert_cwd() since it is a simpler
name and the old name did not reflect that the method is specific to
the test_cwd_* methods.
(4) Add _split_python_path() helper method so that we do not need to call
os.path.realpath(sys.executable) in every method.

Andrew, you can make changes re: Tru64 (removing old code, etc).  Thanks.

--
Added file: http://bugs.python.org/file27115/issue-15533-5-default.patch

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



[issue15836] unittest assertRaises should verify excClass is actually a BaseException class

2012-09-04 Thread R. David Murray

R. David Murray added the comment:

Ezio: I don't really care whether or not it would be too meta, if you look at 
the two versions, it is a *lot* clearer what is being tested in the try/except 
version than it is in the assertRaises version.

--

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



[issue15831] comma after leading optional argument is after bracket in docs

2012-09-04 Thread Ezio Melotti

Ezio Melotti added the comment:

 Do we like how these look?  Is the bare star notation too obscure?

 inspect.Signature.replace(*[, parameters][, return_annotation])
 inspect.Parameter.replace(*[, name][, kind][, default][, annotation])

Note that if possible, it's better to avoid using the [] and put the default 
values.  However, in these cases the default value seems to be a _void 
placeholder.

The star notation is OK, since it's valid Python.


 I was curious what the preferred way to display the following is,
 since I don't think any comma/bracket placement will work:

 ArgumentParser([description][, epilog][, prog][, usage][, add_help][, 
 argument_default][, parents][, prefix_chars][, conflict_handler][, 
 formatter_class])

If the default values are known you could use them, otherwise this signature 
looks OK to me.

 (unless perhaps we use the construction ArgumentParser(*[, 
 description][, epilog])

This is OK too, as long as all the arguments (including 'description') are 
keyword-only.

 I'm not sure how we want to handle this one using multiple signatures:

 multiprocessing.Process([group[, target[, name[, args[, kwargs], *, 
 daemon=None)

This is OK too.

 I also noticed these more unusual signatures:

 urllib.request.urlopen(url, data=None[, timeout], *, cafile=None, 
 capath=None, cadefault=True)
 http.client.HTTPSConnection(host, port=None, key_file=None, cert_file=None[, 
 strict[, timeout[, source_address]]], *, context=None, check_hostname=None)

Here the args between [] probably have a placeholder default, or are obtained 
from somewhere else (e.g. from socket.getdefaulttimeout()).  These signature, 
albeit a bit weird, are understandable IMHO, so, unless you find a better way 
to write them, I would leave them as they are.

 By the way, is the * really necessary in these examples?

If the args on the right of the * are keyword-only and the one on the left 
aren't, then yes.

--

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



[issue15836] unittest assertRaises should verify excClass is actually a BaseException class

2012-09-04 Thread Ezio Melotti

Ezio Melotti added the comment:

I missed the initial patch.  What I was thinking about was to use simply

with self.assertRaises(TypeError):
self.assertRaises(1)

instead of:
 
+ctx = self.assertRaises(TypeError)
+with ctx:
+self.assertRaises(1)
+self.assertIsInstance(ctx.exception, TypeError)

or

+try:
+self.assertRaises(1)
+self.fail(Expected TypeError)
+except TypeError:
+pass

Unless I'm missing something, all these should be equivalent.
You could even use assertRaisesRegex to check the error message if you think 
that's appropriate.

--

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



[issue15533] subprocess.Popen(cwd) documentation

2012-09-04 Thread Chris Jerdonek

Chris Jerdonek added the comment:

Updating the patch again to tweak the original documentation change.

I was concerned that the previous language could be construed to mean that 
Popen will look in *two* places for the executable (both relative to the 
current directory and relative to the cwd argument).  The change I'm uploading 
makes this a little more clear.

--
Added file: http://bugs.python.org/file27116/issue-15533-6-default.patch

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



[issue15860] Use TestCase assertion methods in unittest.mock.assert* to make them easier to read

2012-09-04 Thread Ezio Melotti

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


--
nosy: +ezio.melotti

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



[issue13241] llvm-gcc-4.2 miscompiles Python (XCode 4.1 on Mac OS 10.7)

2012-09-04 Thread Ronald Oussoren

Ronald Oussoren added the comment:

The configure script for python 3.3 detects llvm-gcc and automatically selects 
clang when it is found. 

That seems to be the best feasible solution for this issue. I therefore propose 
to close this issue.

--

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



[issue15831] comma after leading optional argument is after bracket in docs

2012-09-04 Thread Chris Jerdonek

Chris Jerdonek added the comment:

Thanks for responding to all of those questions, Ezio.  I will update the patch 
based on your responses.  (Likely most of it will remain the same.)

 Note that if possible, it's better to avoid using the [] and put the default
 values.  However, in these cases the default value seems to be a _void
 placeholder.

Yes, the defaults are private in those cases (and in I think pretty much all 
cases in the patch in which []'s rather than a default value are used to 
display keyword arguments).

  I was curious what the preferred way to display the following is,
  since I don't think any comma/bracket placement will work:
 
  ArgumentParser([description][, epilog][, prog][, usage][, add_help][, 
  argument_default][, parents][, prefix_chars][, conflict_handler][, 
  formatter_class])

 If the default values are known you could use them, otherwise this signature 
 looks OK to me.

The comma not being inside the first bracket is what I was concerned about here 
(which was the issue raised in the original comment).  Using an initial * which 
you are okay with will address this.  (And yes, they are all keyword arguments. 
 In fact, the order of the arguments in the docs does not even match the order 
in the code.)

  By the way, is the * really necessary in these examples?

 If the args on the right of the * are keyword-only and the one on the left 
 aren't, then yes.

Okay.  I think what threw me is that I don't think we're consistently using the 
* throughout our docs to denote the beginning of keyword-only arguments.  The 
ArgumentParser constructor above is just one example.  So I wasn't sure if this 
notation was preferred or discouraged.

--

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



[issue13241] llvm-gcc-4.2 miscompiles Python (XCode 4.1 on Mac OS 10.7)

2012-09-04 Thread Lucas Sinclair

Lucas Sinclair added the comment:

I agree to close the issue. I tried following the steps proposed here:

http://docs.python.org/devguide/

And typed these two commands on a OS X 10.8.1 with XCode and command line tools 
installed.

$ hg clone http://hg.python.org/cpython.
$ run ./configure --with-pydebug  make -j2

Python built perfectly.

--

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



[issue15859] PyUnicode_EncodeFSDefault win32 inconsistancy.

2012-09-04 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Sounds reasonable to me.

--
nosy: +pitrou
stage:  - patch review

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



[issue15831] comma after leading optional argument is after bracket in docs

2012-09-04 Thread Ezio Melotti

Ezio Melotti added the comment:

 So I wasn't sure if this notation was preferred or discouraged.

We are moving toward using the same signatures that we have in the Python code, 
but that doesn't always work (e.g. when the meaning of values changes depending 
on the number of args, when there's some trick with *args/**kwargs involved, 
when there are default placeholders, etc.).
The single * is not so common (yet), and it might be difficult to understand 
for new users, that's why I said it's OK to leave it out in cases where all the 
args are keyword args and the [] are used.

--

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



[issue15841] Some StringIO and BytesIO methods can succeed after close

2012-09-04 Thread Alessandro Moura

Alessandro Moura added the comment:

Thanks. Here is the amended patch with your suggestions implemented.

--
Added file: http://bugs.python.org/file27117/memoryio.patch

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



[issue15533] subprocess.Popen(cwd) documentation

2012-09-04 Thread Chris Jerdonek

Chris Jerdonek added the comment:

Updating the doc portion of the patch one more time.

--
Added file: http://bugs.python.org/file27118/issue-15533-7-default.patch

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



[issue15861] ttk.Treeview unmatched open brace in list

2012-09-04 Thread Bryan Oakley

New submission from Bryan Oakley:

If you try to insert an item into the treeview, give it a tuple of values for 
the values attribute, and one of those values has unbalanced braces, you'll 
get an error unmatched open brace in list

To reproduce:

import Tkinter as tk
import ttk

root = tk.Tk()
tree = ttk.Treeview(root)
tree.insert(,end,values=(one,two,bam! {))

root.mainloop()

--
components: Tkinter
messages: 169839
nosy: Bryan.Oakley
priority: normal
severity: normal
status: open
title: ttk.Treeview unmatched open brace in list
type: behavior
versions: Python 2.7

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



[issue15862] IDLE not working when due to wrong Hard Drive point of os.path.expanduser

2012-09-04 Thread Cemal Duman

New submission from Cemal Duman:

Hi 
Unfortunately i'm using Vista on my corparate laptop I can open my Python CLI 
without any problem but IDLE is not responding. When i started idle.py by 
issuing following command:

C:\Python27python.exe Lib\idlelib\idle.py

I see following output:

C:\Python27
 Warning: os.path.expanduser(~) points to
 H:\,
 but the path does not exist.

H:\ is my network drive. When i run the os.path.expanduser(~) at CLI i get 
following directory.

'C:\\Users\\edumcem\'

Thanks / Cemal

--
components: IDLE
messages: 169840
nosy: Cemal.Duman
priority: normal
severity: normal
status: open
title: IDLE not working when due to wrong Hard Drive point of os.path.expanduser
versions: Python 2.7

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



[issue15863] Fine-grained info about Python versions which support changes introduced in micro releases

2012-09-04 Thread Alexander Konovalenko

New submission from Alexander Konovalenko:

Some security fixes and bug fixes that are simultaneously issued for multiple 
Python versions require changes to the documentation. I'm now looking at the 
hash randomization vulnerability that was fixed in 2.6.8 and 2.7.3.

The docs always mention the release in which a new feature was added. That's 
great. But for a security fix such as the bug in question, the set of versions 
which support it doesn't look like 2.x.y or later. 

The documentation for the -R command-line option and the PYTHONHASHSEED 
environment variable says New in version 2.6.8. A reader who is not familiar 
with the context would infer that those feature are supported in Python 2.7 
through 2.7.2, which is not the case. The docs should say New in version 2.6.8 
and 2.7.3.
http://docs.python.org/using/cmdline.html#cmdoption-R
http://docs.python.org/using/cmdline.html#envvar-PYTHONHASHSEED

The documentation for the sys.flags.hash_randomization attribute says New in 
version 2.7.3. Again, that leaves out the version 2.6.8 and future versions in 
the 2.6.x branch, which presumably support the new attribute. The docs should 
say New in version 2.6.8 and 2.7.3.
http://docs.python.org/library/sys.html#sys.flags

Disclaimer: I did not test the relevant micro releases to see whether they 
actually support those features. Just checked the release dates and applied 
common sense.

If you know of any other micro release bugfixes that were mentioned in the 
docs, the same considerations apply to them. Please verify the docs are 
correct, fix them or file appropriate bugs.

--
assignee: docs@python
components: Documentation
messages: 169841
nosy: alexkon, docs@python
priority: normal
severity: normal
status: open
title: Fine-grained info about Python versions which support changes introduced 
in micro releases
versions: Python 2.6, Python 2.7

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



[issue15864] Package cache doesn't cache packages with overlapping sys.path entries

2012-09-04 Thread Daniel Wagner-Hall

New submission from Daniel Wagner-Hall:

Importing the same module twice should only execute its code once, and should 
only lead to one copy of the classes defined in the module's file.

If a subdirectory of $PWD is on $PYTHONPATH, and a package is imported both 
relative to $PWD and relative to that subdirectory, its code is loaded twice, 
and its classes are defined twice independently.

Downloading the attached file, and running:

mkdir folder
cd folder
tar xf file.tgz
PYTHONPATH=$(pwd)/package python main.py

should print import once, but does print import twice.

--
files: packageissue.tgz
messages: 169842
nosy: daniel.wagner-hall
priority: normal
severity: normal
status: open
title: Package cache doesn't cache packages with overlapping sys.path entries
type: behavior
versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3, Python 3.4
Added file: http://bugs.python.org/file27119/packageissue.tgz

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



[issue15862] IDLE not working when due to wrong Hard Drive point of os.path.expanduser

2012-09-04 Thread Roger Serwy

Roger Serwy added the comment:

IDLE not responding is likely due to Issue13582, since the warning message 
would cause IDLE to terminate abruptly when launched with pythonw.exe.

What does os.path.expanduser(~) evaluate to when executed from the IDLE shell?

--
nosy: +serwy

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



[issue15831] comma after leading optional argument is after bracket in docs

2012-09-04 Thread Chris Jerdonek

Chris Jerdonek added the comment:

Attaching an updated patch after doing another pass at the code and in light of 
Ezio's comments.

Let me know if and when you'd like me to prepare separate patches for 2.7 and 
3.2.

--
Added file: http://bugs.python.org/file27120/issue-15831-2.patch

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



[issue15841] Some StringIO and BytesIO methods can succeed after close

2012-09-04 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Alessandro, have you already signed a contributor agreement so that your patch 
can be integrated?
If not, you'll find the instructions at http://www.python.org/psf/contrib/
Thank you!

--

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



[issue15864] Package cache doesn't cache packages with overlapping sys.path entries

2012-09-04 Thread R. David Murray

R. David Murray added the comment:

Unless I misunderstand you, you are importing the module using two different 
names, so loading it twice would be the correct behavior.  That is, 
'foo.bar.baz' is a different thing from 'bar.baz' from Python's point of view.

--
nosy: +r.david.murray

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



[issue15864] Package cache doesn't cache packages with overlapping sys.path entries

2012-09-04 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Agreed, I don't think this is a bug.

--
nosy: +pitrou

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



[issue15864] Package cache doesn't cache packages with overlapping sys.path entries

2012-09-04 Thread Daniel Wagner-Hall

Daniel Wagner-Hall added the comment:

That is indeed the behaviour I'm talking about.

In particular I came across this where two libraries imported an exception type 
using different sys.path traversals, which both led to the same file, and a 
try-catch didn't catch the exception because it had a different type (even 
though it had been defined by the same file).  This was a pretty horrible bug 
to track down.

That said, messing with sys.path is pretty ugly, so I can see why this would be 
intentional, but it still feels like the the types of the same class, defined 
by the same file, should be equal.

--

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



[issue15864] Package cache doesn't cache packages with overlapping sys.path entries

2012-09-04 Thread R. David Murray

R. David Murray added the comment:

It isn't the file things are defined in that matters, it is how the module 
object is named.  As I said, foo.bar.baz and bar.baz are different objects from 
Python's point of view, as you found out.

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

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



[issue15865] reflect bare star * in function signature documentation

2012-09-04 Thread Chris Jerdonek

New submission from Chris Jerdonek:

This issue is to make sure that the bare * in the function signatures of pure 
Python functions is properly reflected in the documentation.

This will bring the signatures in the documentation closer to the signatures 
that we have in the Python code -- a goal articulated by Ezio in a comment to 
issue 15831.

For example, configparser.RawConfigParser() has this function signature:

def __init__(self, defaults=None, dict_type=_default_dict,
 allow_no_value=False, *, delimiters=('=', ':'),
 comment_prefixes=('#', ';'), inline_comment_prefixes=None,
 strict=True, empty_lines_in_values=True,
 default_section=DEFAULTSECT,
 interpolation=_UNSET):

But its documentation has no *:

class configparser.RawConfigParser(defaults=None, 
dict_type=collections.OrderedDict, allow_no_value=False, delimiters=('=', ':'), 
comment_prefixes=('#', ';'), inline_comment_prefixes=None, strict=True, 
empty_lines_in_values=True, default_section=configaparser.DEFAULTSECT, 
interpolation=None)

(from 
http://docs.python.org/dev/library/configparser.html#configparser.RawConfigParser
 )

From a search of the code, there are about 60 occurrences of a bare * in the 
signature of a pure Python function (not all of which will need to be updated).

--
assignee: docs@python
components: Documentation
keywords: easy
messages: 169850
nosy: cjerdonek, docs@python, ezio.melotti
priority: normal
severity: normal
status: open
title: reflect bare star * in function signature documentation
type: behavior
versions: Python 3.3

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



[issue15831] comma after leading optional argument is after bracket in docs

2012-09-04 Thread Chris Jerdonek

Chris Jerdonek added the comment:

 We are moving toward using the same signatures that we have in the Python 
 code  The single * is not so common (yet),

I created issue 15865 to add the single * to the documentation where 
appropriate.

--

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



[issue15853] IDLE crashes selecting Preferences menu with OS X ActiveState Tcl/Tk 8.5.12.1

2012-09-04 Thread Raymond Hettinger

Raymond Hettinger added the comment:

I'm observed this happening on a number of machines at my client's site.  It 
started about three weeks ago and has not stopped (even with fresh installs of 
Py2.7.3 and ActiveTCL).  

I've not been able to figure-out why it affects some machines and not others.  
It can happen on 10.6, 10.7, and 10.8.  I've hypothesized that some boxes have 
different XCode updates than others.

--
nosy: +rhettinger

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



[issue15626] unittest.main negates -bb option and programmatic warning configuration

2012-09-04 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/issue15626
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15510] textwrap.wrap('') returns empty list

2012-09-04 Thread Chris Jerdonek

Chris Jerdonek added the comment:

I responded to David's comments on the review tool.  Later today I will update 
the patch in response to his comments (accommodating all of his suggestions) 
along with a couple other changes.

--

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



[issue15837] Added test to test_random.py testing Random.shuffle

2012-09-04 Thread Raymond Hettinger

Changes by Raymond Hettinger raymond.hettin...@gmail.com:


--
assignee:  - rhettinger

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



[issue15837] Added test to test_random.py testing Random.shuffle

2012-09-04 Thread Raymond Hettinger

Raymond Hettinger added the comment:

The patch look fine as-is and it can be applied in 3.4.  (BTW, I miss having a 
Resolution status of Accepted, meaning that the patch passed review and is 
ready to apply).

FWIW, I'll remove the int=int optimization in Py3.4.  It doesn't provide much 
benefit anymore.

--
versions: +Python 3.4 -Python 3.3

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



[issue15510] textwrap.wrap('') returns empty list

2012-09-04 Thread Raymond Hettinger

Raymond Hettinger added the comment:

FWIW, I agree that the existing behavior should not be changed.  Most likely, a 
change would break some code that is currently working, and there would be 
little to no gain.

--
nosy: +rhettinger

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



[issue15510] textwrap.wrap('') returns empty list

2012-09-04 Thread Chris Jerdonek

Chris Jerdonek added the comment:

Attaching an updated patch as promised in my previous comment.

Note that I removed two edge test cases pertaining to leading whitespace.  I 
would rather discuss those cases as part of a different issue to avoid making 
this thread even longer (and it is off the topic of the original issue).

--
Added file: http://bugs.python.org/file27121/issue-15510-5.patch

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



[issue15457] consistent treatment of generator terminology

2012-09-04 Thread Chris Jerdonek

Chris Jerdonek added the comment:

This slipped under my radar.  After starting work on this again, I realize that 
it would make sense to complete issue 15476 first.  The reason is that it would 
improve the process of referencing code object in the generator docs (Terry's 
suggestion) once code object is itself properly documented.

--
dependencies: +Add code object to glossary

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



[issue15476] Add code object to glossary

2012-09-04 Thread Chris Jerdonek

Chris Jerdonek added the comment:

I am starting work on this in the next couple days.

--

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



[issue15476] Add code object to glossary

2012-09-04 Thread Raymond Hettinger

Raymond Hettinger added the comment:

I disagree that this should be added.  The glossary is not intended to be a 
dictionary of every possible concept.  Ideally, it should remain short enough 
so that it can be read in a single sitting.   Making the docs fatter doesn't 
make them better.

--
nosy: +rhettinger

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



[issue6074] .pyc files created readonly if .py file is readonly, python won't overwrite

2012-09-04 Thread Eric Snow

Eric Snow added the comment:

Well, the workflow on Windows is certainly different.  I've run out of time to 
get this sorted out in the short term.  However, the patch should be pretty 
close to what's needed.  Obviously the posix-only bit doesn't fit for a 
Windows-specific test.

--

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