[issue12237] how to open non defult browser?

2011-06-02 Thread de

New submission from de :

hi all,
I'm using win7, with Ff as default browser.
i wont to open url in other browser installed on my PC.
i tried:
url = 'http://www.google.com'
op = webbrowser.get('opera')
op.open(url)

and i get this error:
Traceback (most recent call last):
  File "", line 1, in 
op = webbrowser.get('opera')
  File "C:\Python27\lib\webbrowser.py", line 52, in get
raise Error("could not locate runnable browser")
Error: could not locate runnable browser

can anyone help?

--
messages: 137469
nosy: hirsh
priority: normal
severity: normal
status: open
title: how to open non defult browser?

___
Python tracker 

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



[issue1495802] cygwin: popen3 lock up

2011-06-02 Thread Charles-François Natali

Charles-François Natali  added the comment:

It's not a bug.
so.readlines reads the subprocess' stdout until EOF is encountered, but in the 
meantime, if it writes a lot to stderr, the corresponding pipe fills up, and 
the subprocess blocks on the write.
You should use Popen's communicate method.

Closing as invalid.

--
nosy: +charles-francois.natali
resolution:  -> invalid
stage: test needed -> committed/rejected
status: open -> closed

___
Python tracker 

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



[issue5384] mmap and exception type

2011-06-02 Thread Charles-François Natali

Charles-François Natali  added the comment:

Here's a patch.

--
keywords: +needs review, patch
nosy: +charles-francois.natali, haypo
stage:  -> patch review
versions: +Python 3.3 -Python 2.7, Python 3.1
Added file: http://bugs.python.org/file0/mmap_exceptions.diff

___
Python tracker 

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



[issue8050] smtplib SMTP.sendmail (TypeError: expected string or buffer)

2011-06-02 Thread Jan Papež

Jan Papež  added the comment:

Did you try to use this?
q = quotedata(msg.as_string())

--
nosy: +honyczek

___
Python tracker 

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



[issue12238] Readline module loading in interactive mode

2011-06-02 Thread Niels Heinen

New submission from Niels Heinen :

Running the python binary without a script or using the -i flag will
start the process in interactive mode. The interactive mode requires an
external module to be loaded: readline.

Per default behavior, Python also tries to load this module from the current 
working directory (see also trace below)

strcpy(0x7fff17609ed8, ".so")  = 0x7fff17609ed8
fopen64("readline.so", "rb" 
SYS_open("readline.so", 0, 0666)   = -2
<... fopen64 resumed> )= 0
strcpy(0x7fff17609ed8, "module.so")= 0x7fff17609ed8
fopen64("readlinemodule.so", "rb" 
SYS_open("readlinemodule.so", 0, 0666)

The module is imported in Modules/main.c line 663:

  if ((Py_InspectFlag || ..
isatty(fileno(stdin))) {
  PyObject *v;
  v = PyImport_ImportModule("readline");


Why consider this a security bug: basically because you don't expect a
program to import a shared library from your current directory _unless_
you explicitly tell it to (e.g. import blah).

On a multi user system, someone could plant a malicious shared libraries
named "readline.so" in an attempt to hack a user that runs python in
interactive mode.

The risk obviously _very_ low but nevertheless worth to consider improving by, 
for example, loading readline with a more strict path? (e.g.  python lib 
directories only?)

Niels



AN EXAMPLE:
---
The code below is compiled to readline.so and stored in /tmp:

  void __attribute__ ((constructor)) _load();
  void _load() {
  printf("DING DONG!\n");

  }

foo@foo:/tmp$ ls -l /tmp/readline.so 
-rwxr-x--- 1 n nnn 7952 Mar 29 16:24 /tmp/readline.so
foo@foo:/tmp$ python
Python 2.6.5 (r265:79063, Apr 16 2010, 13:57:41) 
[GCC 4.4.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
DING DONG!
>>>

--
messages: 137473
nosy: Niels.Heinen
priority: normal
severity: normal
status: open
title: Readline module loading in interactive mode
type: security
versions: Python 2.6

___
Python tracker 

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



[issue12238] Readline module loading in interactive mode

2011-06-02 Thread R. David Murray

R. David Murray  added the comment:

This is a general principle of how Python runs in interactive mode and is not 
confined to loading readline.  The same would be true for any module loaded 
during startup, and there are quite a few that are so loaded.  Since loading 
modules from the current working directory is an important feature of using 
python in interactive mode, this is not something that is likely to be changed.

--
nosy: +r.david.murray

___
Python tracker 

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



[issue12236] Tkinter __version__ uses subversion substitution

2011-06-02 Thread Julian Taylor

Julian Taylor  added the comment:

matplotlib fails to build due to this with 2.7.2rc1 in ubuntu oneiric (but its 
seems simple to fix):
https://launchpad.net/ubuntu/+source/matplotlib/1.0.1-2ubuntu1/+build/2535369

--

___
Python tracker 

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



[issue12236] Tkinter __version__ uses subversion substitution

2011-06-02 Thread Benjamin Peterson

Benjamin Peterson  added the comment:

2011/6/2 Ned Deily :
>
> Ned Deily  added the comment:
>
> Can we be sure it's harmless?  A quick Google search turned up at least one 
> package that depends on Tkinter.__version__ (granted, for Python 2).
>
> http://permalink.gmane.org/gmane.comp.python.matplotlib.general/24453

I suppose we replace it with some old Subversion number.

--

___
Python tracker 

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



[issue12239] msilib VT_EMPTY SummaryInformation properties raise an error (suggest returning None)

2011-06-02 Thread Mark Mc Mahon

New submission from Mark Mc Mahon :

Using "some.msi" where the first property is VT_EMPTY

Using COM:
>>> from win32com.client import gencache
>>> com_lib = gencache.EnsureModule('{000C1092---C000-0046}', 
>>> 409, 1, 0)
>>> com_msi = com_lib.Installer()
>>> db = com_msi.OpenDatabase('some.msi', 0)
>>> si = db.GetSummaryInformation(0)
>>> repr(si.Property(0))
'None'

Using msilib:
>>> import msilib
>>> db = msilib.OpenDatabase(r'some.msi', 0)
>>> si = db.GetSummaryInformation(0)
>>> si.GetProperty(0)
Traceback (most recent call last):
  File "", line 1, in 
NotImplementedError: result of type 0

I aim to submit a patch that so that SummaryInformation.GetProperty() with a 
type of VT_EMPTY will return None.

--
components: Windows
messages: 137478
nosy: markm
priority: normal
severity: normal
status: open
title: msilib VT_EMPTY SummaryInformation properties raise an error (suggest 
returning None)
versions: Python 3.2

___
Python tracker 

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



[issue12239] msilib VT_EMPTY SummaryInformation properties raise an error (suggest returning None)

2011-06-02 Thread Brian Curtin

Changes by Brian Curtin :


--
nosy: +brian.curtin

___
Python tracker 

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



[issue12239] msilib VT_EMPTY SummaryInformation properties raise an error (suggest returning None)

2011-06-02 Thread Brian Curtin

Changes by Brian Curtin :


--
stage:  -> needs patch
type:  -> behavior
versions: +Python 2.7, Python 3.1

___
Python tracker 

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



[issue12240] Allow multiple setup_hooks

2011-06-02 Thread Erik Bray

New submission from Erik Bray :

I have a use case where I have a small library of setup_hook functions for 
various purposes that are used by multiple projects.  Some projects may want to 
use more than one of these setup_hooks.

I can certainly create a wrapper hook for each function that calls all the 
necessary hooks.  But that gets a little tedious and seems unnecessary.  In 
this use case it would be fine if I could just list a set of setup_hooks to be 
executed in sequence.

It is, of course, up the developer to be sure that none of these setup_hooks 
have conflicting actions.

As a temporary workaround I wrote a setup_hook called chain_setup_hooks.  I 
then looks for an option called "setup_hooks" which behaves as I've described.  
This works fine, though I don't see why setup_hook shouldn't allow multiple 
values to begin with.

--
assignee: tarek
components: Distutils2
messages: 137479
nosy: alexis, eric.araujo, erik.bray, tarek
priority: normal
severity: normal
status: open
title: Allow multiple setup_hooks
type: feature request

___
Python tracker 

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



[issue12241] email.header.Header encoding fails on empty header

2011-06-02 Thread Tim Koopman

New submission from Tim Koopman :

Creating an empty header produces an exception when calling the encode function:

>>> from email.header import Header
>>> Header('', 'iso-8859-1').encode()
Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/lib/python3.2/email/header.py", line 317, in encode
formatter.feed(lines[0], charset)
IndexError: list index out of range

According to RFC822, empty headers are valid (and are found in the wild 
anyway), so this should just work.

I've attached a trivial fix that appears to work.

--
components: Library (Lib)
files: header.patch
keywords: patch
messages: 137480
nosy: ntkoopman
priority: normal
severity: normal
status: open
title: email.header.Header encoding fails on empty header
type: behavior
versions: Python 3.2
Added file: http://bugs.python.org/file1/header.patch

___
Python tracker 

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



[issue12242] distutils2 environment marker for current compiler

2011-06-02 Thread Eli Collins

New submission from Eli Collins :

It would be useful to have an environment marker which matched the compiler 
being used when compiling a C extension. 

Sometimes different compilers require different options (different lib names, 
different flags, etc); distutils1 setup.py files which have to deal with this 
currently go through some convolutions to determine the current compiler, and 
then dynamically modify extra_compile_args before handing them off to setup. 

Since packaging is moving to a setup.cfg file, it would be useful to be able to 
use an environment marker along the lines of  'extra_compile_args = 
-Dmingw_specific_flag ; packaging.c_compiler == "mingw"', allowing for special 
options for mingw vs msvc, etc. 

Since issue 11921 made it sound like environment markers had been expanded to 
the extensions sections, I'm hoping this isn't too complicated (but don't know 
the codebase well enough to write a patch myself).

--
assignee: tarek
components: Distutils2
messages: 137481
nosy: alexis, eli.collins, eric.araujo, tarek
priority: normal
severity: normal
status: open
title: distutils2 environment marker for current compiler
type: feature request

___
Python tracker 

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



[issue12238] Readline module loading in interactive mode

2011-06-02 Thread Jesús Cea Avión

Changes by Jesús Cea Avión :


--
nosy: +jcea

___
Python tracker 

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



[issue12241] email.header.Header encoding fails on empty header

2011-06-02 Thread R. David Murray

R. David Murray  added the comment:

I can't reproduce this.  What exact version of Python are you using?

--
assignee:  -> r.david.murray
nosy: +r.david.murray

___
Python tracker 

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



[issue12243] getpass.getuser works on OSX

2011-06-02 Thread Bryce Verdier

New submission from Bryce Verdier :

In the docs for getpass:
http://docs.python.org/release/2.6.6/library/getpass.html (as an example).

It hints that getuser() doesn't work on OSX. I tried this out and it works fine 
for python 2.6 on 10.6.

I have included a patch for this. I believe the cleanest way to handle this is 
to remove the "Availability" entry as it's no longer necessary.

--
assignee: docs@python
components: Documentation
files: getuser.patch
keywords: patch
messages: 137483
nosy: docs@python, louiscipher
priority: normal
severity: normal
status: open
title: getpass.getuser works on OSX
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/file2/getuser.patch

___
Python tracker 

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



[issue12241] email.header.Header encoding fails on empty header

2011-06-02 Thread Tim Koopman

Tim Koopman  added the comment:

The default Arch Linux version: 3.2.0

Python 3.2 (r32:88445, Apr 15 2011, 11:09:05)

--

___
Python tracker 

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



[issue12241] email.header.Header encoding fails on empty header

2011-06-02 Thread Tim Koopman

Tim Koopman  added the comment:

Looking at the source of 3.2.1, it appears this was already solved. Sorry.

--

___
Python tracker 

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



[issue12129] Document Object Model API - validation

2011-06-02 Thread Kyle Keating

Kyle Keating  added the comment:

This looks to break pretty good... I did confirm this on 3.0, I'm guessing 3.2 
is the same.

import sys
import xml.dom

doc = xml.dom.getDOMImplementation().createDocument(None, 'xml', None)
doc.firstChild.appendChild(doc.createElement('element00'))

element01 = doc.createElement('element01')
element01.setAttribute('attribute', 
"script>")
doc.firstChild.appendChild(element01)

element02 = doc.createElement("script>")
doc.firstChild.appendChild(element02)

element03 = doc.createElement("new line \n")

element03.setAttribute('attribute-name','new line \n')
doc.firstChild.appendChild(element03)

print doc.toprettyxml(indent="  ")

>>
output:



  
  
  />
  


--

___
Python tracker 

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



[issue12129] Document Object Model API - validation

2011-06-02 Thread Kyle Keating

Kyle Keating  added the comment:

oops, the first xml element in the output should read  "" not 
""

just a typo! don't get confused!

--

___
Python tracker 

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



[issue5384] mmap and exception type

2011-06-02 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

It is uncomfortable changing exception types have been a published API for over 
a decade, so I'll leave this one open for a bit so that others can comment.

Most of the changes in the patch are correct and match their counterparts for 
lists and strings.  The TypeError for slice deletion was correct as-is (it 
matches del 'abc'[1]).  The IndexError on slice assignment may be correct as-is 
(I'll do more research).  The from ValueError to SystemError is questionable.  
Otherwise, the patch looks to be mostly correct (I'll give it a more thorough 
review later).

--
assignee:  -> rhettinger
nosy: +rhettinger
priority: normal -> low

___
Python tracker 

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



[issue12244] cStringIO inconsistencies

2011-06-02 Thread Santoso Wijaya

New submission from Santoso Wijaya :

Observe:

Python 2.7.1 (r271:86832, Nov 27 2010, 17:19:03) [MSC v.1500 64 bit (AMD64)] on
win32
Type "help", "copyright", "credits" or "license" for more information.
>>> from cStringIO import StringIO
>>> result = StringIO('Hello, ')
>>> result.write('world')
Traceback (most recent call last):
  File "", line 1, in 
AttributeError: 'cStringIO.StringI' object has no attribute 'write'
>>>
>>> result = StringIO()
>>> result.write('Hello, world')
>>> print result.getvalue()
Hello, world
>>>
>>> from StringIO import StringIO
>>> result = StringIO('Hello, ')
>>> result.write('world')
>>> print result.getvalue()
world,
>>>


Few things:
1. The error message says, "StringI" instead of "StringIO".
2. Why does a cStringIO.StringIO object instantiated with a starter string not 
have the `write` attribute?
3. Using the pure-Python equivalent, (2) succeeds but it overwrites the starter 
string?
4. Regardless, (2) and (3) are not consistent with each other.

--
components: Library (Lib)
messages: 137490
nosy: santa4nt
priority: normal
severity: normal
status: open
title: cStringIO inconsistencies
type: behavior
versions: Python 2.7

___
Python tracker 

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



[issue12243] getpass.getuser works on OSX

2011-06-02 Thread R. David Murray

R. David Murray  added the comment:

I think you are correct that the Availability can be removed, since the actual 
limits of the support are exactly as complicated as the code that supports 
them, and should give *some* result on most (all?) platforms.  However, OS/X is 
certainly covered by the current one, since OS/X is a unix flavor.  At this 
point in time it might be worth doing a sweep through the docs to remove all 
occurrences of 'Macintosh', since we don't support OS/9 any more.  There look 
to be less than a dozen such references in the Python3 docs.

I'm adding Gregory to nosy to see if he thinks it is appropriate to remove the 
'availability' entirely, since he implemented the fallback.

--
nosy: +gregory.p.smith, r.david.murray
versions:  -Python 2.6, Python 3.1, Python 3.4

___
Python tracker 

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



[issue12241] email.header.Header encoding fails on empty header

2011-06-02 Thread R. David Murray

R. David Murray  added the comment:

No problem.  It's too bad that regression slipped in to 3.2.0.  I probably 
fixed it by accident, since I rewrote a bunch of that code in 3.2.1 while 
fixing a different bug.

--
resolution:  -> out of date
stage:  -> committed/rejected
status: open -> closed

___
Python tracker 

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



[issue12245] Document the meaning of FLT_ROUNDS constants for sys.float_info

2011-06-02 Thread Raymond Hettinger

New submission from Raymond Hettinger :

>>> sys.float_info.rounds
1

--
assignee: docs@python
components: Documentation
messages: 137493
nosy: docs@python, rhettinger
priority: normal
severity: normal
status: open
title: Document the meaning of FLT_ROUNDS constants for sys.float_info
versions: Python 2.7, Python 3.2, Python 3.3

___
Python tracker 

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



[issue12244] cStringIO inconsistencies

2011-06-02 Thread Georg Brandl

Georg Brandl  added the comment:

1. The class for read-only objects is called "StringI" (the one for read-write 
objects is "StringO").

2./3. This is documented: 
http://docs.python.org/library/stringio#cStringIO.StringIO

These differences between StringIO and cStringIO are unfortunate, but cannot be 
changed anymore in Python 2.  It's all different in Python 3 anyway, with 
io.StringIO being the successor to both.

--
nosy: +georg.brandl
resolution:  -> wont fix
status: open -> closed

___
Python tracker 

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



[issue12246] create installation path if it's non-existent

2011-06-02 Thread Tshepang Lekhonkhobe

New submission from Tshepang Lekhonkhobe :

If I happen to not have the directory, $PREFIX/python3.3/site-packages, I get 
an erroneous message telling me that I don't write permissions.

--
assignee: tarek
components: Distutils2
files: create-dir-if-nonexistent.diff
keywords: patch
messages: 137495
nosy: alexis, eric.araujo, tarek, tshepang
priority: normal
severity: normal
status: open
title: create installation path if it's non-existent
versions: Python 3.3
Added file: http://bugs.python.org/file3/create-dir-if-nonexistent.diff

___
Python tracker 

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



[issue12244] cStringIO inconsistencies

2011-06-02 Thread Santoso Wijaya

Santoso Wijaya  added the comment:

>_< Should've read the docs again more carefully before submitting.

--

___
Python tracker 

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



[issue12247] Finding subprocess.py depends on how IDLE is opened

2011-06-02 Thread George Patterson

New submission from George Patterson :

I'm uncertain this is a bug, but it seems persistent over several machines and 
I can't figure out where the issue lies.

Most of my troubleshooting has been on a MacBook Pro with Mac OS X version 
10.6.7. I have a simple python script 'test.py':

  import subprocess
  subprocess.Popen(['xterm'])

If I run this script by opening it in IDLE using the mouse, it crashes. If I 
run the same script in an IDLE that I launch by typing 'idle' in a terminal, it 
doesn't crash. What's going on?  Is this a bug? Or am I just doing something 
terribly wrong?
Obviously, my interest is not in running this simple script, but it contains 
the minimum part of the real script which reproduces the error.  

I've repeated this error on one machine(MacBook Pro with Mac OS X version 
10.6.7) using either of two versions of Python, 2.6.6 or 2.7.1.  On one 
machine(Mac Pro OS X version 10.6.7) using Python 2.6.6, on two other 
machines(IMacs with either OS X version 10.6.7 or 10.6.5) using Python 2.7.1.  
I include below only the info for the 2.7.1.

Python 2.7.1 was the 32-bit version Mac OS X 32-bit i386/PPC Installer (2.7.1) 
for Mac OS X 10.3 through 10.6 [2] (sig) from here 
(http://www.python.org/download/releases/2.7.1/).



Details: 


1.  Launch IDLE by right clicking test.py and "open with" IDLE (2.7.1).  I "run 
module".  Pasted below are the contents from the Python Shell.  Included at the 
bottom is the sys.path for IDLE opened in this manner.
I've also find this error if I open the IDLE located in Applications/Python 
2.7/ and then open "test.py" and run it.


Python 2.7.1 (r271:86882M, Nov 30 2010, 09:39:13) 
[GCC 4.0.1 (Apple Inc. build 5494)] on darwin
Type "copyright", "credits" or "license()" for more information.
>>>  RESTART 
>>> 

Traceback (most recent call last):
  File "/Users/georgepatterson/test.py", line 2, in 
subprocess.Popen(['xterm'])
  File 
"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py",
 line 672, in __init__
errread, errwrite)
  File 
"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py",
 line 1202, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory
>>> import sys
>>> for p in sys.path: print p

/Users/georgepatterson
/Users/georgepatterson/Documents
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg
/Library/Frameworks/Python.framework/Versions/2.7/lib/python27.zip
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-darwin
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac/lib-scriptpackages
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-old
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages
>>> 




2.  Type "idle" in a terminal window.  Open test.py and "run module".
When run in this manner, the terminal window is opened properly.  I've pasted 
the contents of the Python Shell below with the sys.path also. 
In case it matters, "which idle" at the terminal prompt points here
/Library/Frameworks/Python.framework/Versions/2.7/bin/idle



Python 2.7.1 (r271:86882M, Nov 30 2010, 09:39:13) 
[GCC 4.0.1 (Apple Inc. build 5494)] on darwin
Type "copyright", "credits" or "license()" for more information.
>>>  RESTART 
>>> 
>>> import sys
>>> for p in sys.path: print p

/Users/georgepatterson
/Library/Frameworks/Python.framework/Versions/2.7/bin
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg
/Library/Frameworks/Python.framework/Versions/2.7/lib/python27.zip
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-darwin
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac/lib-scriptpackages
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-old
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages
>>>

--
components: IDLE
messages: 137497
nosy: George.Patterson
priority: normal
severity: normal
status: open
title: Finding subprocess.py depends on how IDLE is opened
type: crash
versions: Python 2.6, Python 2.7

___
Python tracker 


[issue12247] Finding subprocess.py depends on how IDLE is opened

2011-06-02 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc  added the comment:

sys.path is probably not relevant here (it's used to import python modules). 
Can you print the value of os.environ['PATH'] instead?

--
nosy: +amaury.forgeotdarc

___
Python tracker 

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



[issue12084] os.stat() on windows doesn't consider relative symlink

2011-06-02 Thread Brian Curtin

Brian Curtin  added the comment:

Attached is a complete patch. All tests pass.

Lib/test/support.py
 * Handle AttributeError, which Hirokazu noticed on pre-XP machines

Lib/test/test_os.py
 * This sets up a three-deep directory tree and creates a symbolic link in the 
middle (second) directory.
 * os.stat calls are tested from below, equal to, and above the symbolic link 
to make sure they work. This is what was broken with the previous os.stat 
implementation on Windows, as it used a method which only provided correct 
information (the reparse tag) when the stat call was made from the directory 
where the link originates from.

Modules/posixmodule.c
 * win32_read_link, now called win32_get_reparse_tag, was changed to just get 
the reparse tag and that's it. The tag is now only used when setting the mode 
attribute based on if the tag shows that this is a symlink directory or file.

 * The GetFinalPathNameByHandle dynamic loading and preparing was moved up in 
the file since it is again used for stat calls.

 * I removed the major duplication of stat implementations for both narrow and 
wide paths. Now there is just one implementation, win32_xstat_impl, which 
accepts a wide path and does the same work.

 * win32_xstat_impl now takes an approach where if there's a symlink to be 
traversed, e.g., for an os.stat call, the path is then re-opened without the 
flag to open the reparse tag, effectively following the link path. Then we pass 
the newly opened file handle to GetFinalPathNameByHandle and we can get back 
the target path, which we then pass recursively. There's no more depth stuff - 
we either try to follow the link in the above fashion or not.

 * win32_lstat was never being called from anywhere so it was removed.

 * win32_stat, which takes a narrow path, is now converted early to a wide path 
and passed into the win32_xstat_impl rather than maintaining two of the same 
functions like before.

--
keywords: +needs review
Added file: http://bugs.python.org/file4/issue12084.diff

___
Python tracker 

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



[issue12248] __dir__ semantics changed in Python 2.7.2

2011-06-02 Thread Barry A. Warsaw

New submission from Barry A. Warsaw :

I'm making this a release blocker for 2.7.2 because I want to ensure that the 
change is deliberate and appropriate.  This is triggered by a bug report in 
Ubuntu where the change in behavior was noticed:

https://bugs.launchpad.net/nova/+bug/791221/+index

I have two problems with the change that I'd like to describe.  First is the 
NEWS file entry:

- Correct lookup of __dir__ on objects. Among other things, this causes errors
  besides AttributeError found on lookup to be propagated.

This isn't associated with a tracker issue, so it's hard to know why this 
change was made, or whether there was any discussion of its impact.

Second, is this change appropriate for a maintenance release?  What problem 
does it fix and is that worth breaking existing packages for it?

I'll attach a simple test program.  Run this under 2.7.1 and it works, run it 
under 2.7.2rc1 and you get a TypeError.

--
assignee: benjamin.peterson
components: Interpreter Core
files: foo.py
messages: 137500
nosy: barry, benjamin.peterson
priority: release blocker
severity: normal
status: open
title: __dir__ semantics changed in Python 2.7.2
type: behavior
versions: Python 2.7
Added file: http://bugs.python.org/file5/foo.py

___
Python tracker 

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



[issue12248] __dir__ semantics changed in Python 2.7.2

2011-06-02 Thread R. David Murray

R. David Murray  added the comment:

As I recall the issue that triggered the change was reported by Michael Foord, 
so I'm adding him as nosy too.

--
nosy: +michael.foord, r.david.murray

___
Python tracker 

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



[issue12249] add missing command

2011-06-02 Thread Tshepang Lekhonkhobe

New submission from Tshepang Lekhonkhobe :

It's not indicated where one should run the command 'make html' in the 
"Building the documentation" page, so when it failed for me when running it 
from the cpython distribution root, I was left a little puzzled, searching 
where the problem might lie (wasting time).

--
assignee: docs@python
components: Documentation
files: add-missing-command.diff
keywords: patch
messages: 137502
nosy: docs@python, tshepang
priority: normal
severity: normal
status: open
title: add missing command
versions: Python 3.3
Added file: http://bugs.python.org/file6/add-missing-command.diff

___
Python tracker 

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



[issue12248] __dir__ semantics changed in Python 2.7.2

2011-06-02 Thread Nick Coghlan

Nick Coghlan  added the comment:

Hmm, that behaviour looks unrelated to the specific problem Michael reported.

The initial problem in this space was that defining __dir__() completely 
determined the result of dir() calls, but object.__dir__() didn't actually 
work, so you couldn't easily get the standard list of attributes in order to 
supplement it.

I don't believe there is any reason to have tightened up the type constraints 
while fixing that - dir() should be returning sorted(obj.__dir__()) and not 
caring about the exact return type of the magic method.

--
nosy: +ncoghlan

___
Python tracker 

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



[issue12248] __dir__ semantics changed in Python 2.7.2

2011-06-02 Thread Andreas Stührk

Changes by Andreas Stührk :


--
nosy: +Trundle

___
Python tracker 

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



[issue12248] __dir__ semantics changed in Python 2.7.2

2011-06-02 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

> I don't believe there is any reason to have tightened up
> the type constraints while fixing that - dir() should be
> returning sorted(obj.__dir__()) and not caring about the 
> exact return type of the magic method.

+1

--
nosy: +rhettinger

___
Python tracker 

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



[issue12247] Finding subprocess.py depends on how IDLE is opened

2011-06-02 Thread Ned Deily

Ned Deily  added the comment:

The difference in behavior you are seeing does indeed have to do with the PATH 
environment variable.  When you start IDLE via a terminal shell, it inherits 
the PATH value from your shell environment.  path_helper(8) sets the default 
value for a login shell PATH by consulting the entries in /etc/paths.d/. On OS 
X 10.6, that includes /usr/X11/bin, which is where xterm is located.  However, 
when you launch IDLE from the Finder, either by double-clicking on the IDLE app 
icon or by opening a file using IDLE as the default app (as you are doing in 
test 1), a shell is not involved and the PATH inherited by the app environment 
is slightly different.  In paticular, /etc/paths.d is not consulted and so 
/usr/X11/bin is not on the path.  As Amaury suggested, you should be able to 
see that by looking at PATH in both cases.  For IDLE.app launched from the 
Finder, you'll probably see something like:

   >>> os.environ['PATH']
   '/usr/bin:/bin:/usr/sbin:/sbin'

While it is possible to change the default environment variables for processes 
launched (see http://developer.apple.com/library/mac/#qa/qa1067/_index.html), 
it is rarely necessary or desirable to do that.  For this case, the simplest 
solution is to supply the absolute path to 'xterm':

  import subprocess
  subprocess.Popen(['/usr/X11/bin/xterm'])

Or you could get fancier by modifying PATH yourself.

--
nosy: +ned.deily
resolution:  -> invalid
stage:  -> committed/rejected
status: open -> closed
type: crash -> 

___
Python tracker 

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



[issue12186] readline.replace_history_item still leaks memory

2011-06-02 Thread stefanholek

stefanholek  added the comment:

These undo lists come into existence when history entries are edited 
interactively (Arrow-Up, edit line, Arrow-Up, edit line, Enter -> undo list of 
first history entry leaks).

--
components: +Extension Modules
versions: +Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3, Python 
3.4

___
Python tracker 

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