[issue19734] venv and ensurepip are affected by pip environment variable settings

2013-12-23 Thread Nick Coghlan

Nick Coghlan added the comment:

Buildbot is happy with that version:
http://buildbot.python.org/all/builders/AMD64%20Ubuntu%20LTS%203.x/builds/3496/steps/test/logs/stdio

--
resolution:  - fixed
stage: needs patch - committed/rejected
status: open - closed
type:  - behavior

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



[issue19728] PEP 453: enable pip by default in the Windows binary installers

2013-12-23 Thread Roundup Robot

Roundup Robot added the comment:

New changeset cd62fc2488cf by Nick Coghlan in branch 'default':
Issue #19728: fix ensurepip name clash with submodule
http://hg.python.org/cpython/rev/cd62fc2488cf

--

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



[issue19728] PEP 453: enable pip by default in the Windows binary installers

2013-12-23 Thread Nick Coghlan

Nick Coghlan added the comment:

I noticed that actually importing ensurepip._uninstall would clobber the helper 
function, so I renamed it and added some new tests to check the basics of the 
command line functionality from the main ensurepip tests.

--

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



[issue19861] Update What's New for Python 3.4

2013-12-23 Thread yegle

yegle added the comment:

Hi all,

It's my first time commenting on this issue tracker so bear with me if this 
looks naive.

For the `plistlib` package, from Apple's own manual[1], there's actually a 
third JSON format.

It'll be good to indicate that `plistlib` doesn't support JSON format in the 
what's new page and corresponding document page.

It takes me sometime before I realize `plistlib` in Python 3.3 doesn't support 
the so called binary property list format. So if the JSON format won't be 
supported in this Python version, it'll save someone's time by just reading the 
manual.

[1]: 
https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man1/plutil.1.html

--
nosy: +yegle

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



[issue4709] Mingw-w64 and python on windows x64

2013-12-23 Thread Ralf Gommers

Changes by Ralf Gommers ralf.gomm...@gmail.com:


--
nosy: +ralf.gommers

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



[issue16136] Removal of VMS support

2013-12-23 Thread Marc-Andre Lemburg

Marc-Andre Lemburg added the comment:

On 21.12.2013 16:31, Christian Heimes wrote:
 
 All VMS code has been removed except for some code in Lib/platform.py.
 
 MAL:
 Do you want to keep the code in the platform module?

The platform.py module is intended to be usable by several Python versions,
so I think it's better to keep the code around for a little longer.

--

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



[issue16136] Removal of VMS support

2013-12-23 Thread Marc-Andre Lemburg

Changes by Marc-Andre Lemburg m...@egenix.com:


--
assignee: lemburg - christian.heimes

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



[issue19861] Update What's New for Python 3.4

2013-12-23 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

 For the `plistlib` package, from Apple's own 
manual[1], there's actually a
 third JSON format.

See *issue14455.*

--

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



[issue19744] test_venv fails if SSL/TLS is not available

2013-12-23 Thread Roundup Robot

Roundup Robot added the comment:

New changeset f670d8db8ef3 by Nick Coghlan in branch 'default':
Issue #19744: improve ensurepip error when ssl is missing
http://hg.python.org/cpython/rev/f670d8db8ef3

--

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



[issue19744] test_venv fails if SSL/TLS is not available

2013-12-23 Thread Nick Coghlan

Nick Coghlan added the comment:

I ended up not implementing step 3 - if you don't have SSL/TLS built, and you 
pass with_pip to the venv module API, or use the default settings for pyvenv, 
you *will* get an error from ensurepip.

Instead, I just kept the test skip in test_venv. ensurepip and test_ensurepip 
have been updated to provide a better traceback when SSL/TLS support is 
missing, though.

Tim, could you poke around at the latest version in your local build and see if 
the new checks are triggering? (I've assumed the ssl module can't be imported 
if the necessary underlying bits aren't built)

--
assignee: ncoghlan - tim.peters
resolution:  - fixed
stage:  - committed/rejected
status: open - pending
type:  - behavior

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



[issue19995] hex() and %x, oct() and %o do not behave the same

2013-12-23 Thread Ethan Furman

Ethan Furman added the comment:

Thank you everyone for increasing my understanding.  :)

Terry J Reedy wrote:

 [snip everything I now agree with, which is most of Terry's comment]

 3. Every core usage of __int__ looks for __index__ also. Int() does not
 do this now, but '%d' does [...]
 
 The exact details would depend on whether we want to allow (or at least
 bless) classes with __int__ and __index__ returning different ints.

I think we should state that __int__ and __index__ are expected to return the 
same value (if both are defined) otherwise one is on one's own (otherwise known 
as: if it breaks, you own all the pieces ;) .

 Given things as they are, I would simply expand the domain of %x, etc,
 to that of %d without bothering to go through a deprecation process.

This is not correct.  `hex(3.14)` raises a TypeError, and so should `'%x' % 
3.14`

While Terry's option 2 would have to wait for 3.5, is there any reason why 
fixing the %-formating characters to use __index__ instead of __int__ can't go 
into 3.4?  That portion seems to be clearly a bug and not an enhancement (the 
enhancement portions of this ticket can be separated out into another issue).

--
nosy: +larry

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



[issue20054] IDLE won't work (Mac)

2013-12-23 Thread Sophie Chancheong

New submission from Sophie Chancheong:

I'm having trouble with running Idle on my macbook pro os x 10.9.1 . two days 
ago it was running with absolutely no problem and now it won't start up. I've 
tried uninstalling and reinstalling, and I have updated the Tkinter and Tcl/Tk 
etc. It appears in the dock for a second then disappears. Any help would be 
appreciated.

Thanks,
Sophie

--
components: IDLE
messages: 206859
nosy: Sophie.Chancheong
priority: normal
severity: normal
status: open
title: IDLE won't work (Mac)
type: behavior
versions: Python 3.3

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



[issue20055] On Windows NT 6 with administrator account, there are two failing tests on test_shutil.py

2013-12-23 Thread Vajrasky Kok

New submission from Vajrasky Kok:

Use administrator account and run Lib\test\test_shutil.py! You will get two 
failing tests.

==
FAIL: test_move_dangling_symlink (__main__.TestMove)
--
Traceback (most recent call last):
  File Lib\test\test_shutil.py, line 60, in wrap
return func(*args, **kwargs)
  File Lib\test\test_shutil.py, line 1557, in test_move_dangling_symlink
self.assertEqual(os.path.realpath(src), os.path.realpath(dst_link))
AssertionError: 'C:\\Users\\compaq\\AppData\\Local\\Temp\\tmp9kkaex06\\baz' != '
C:\\Users\\compaq\\AppData\\Local\\Temp\\tmpuuretujv\\quux'
- C:\Users\compaq\AppData\Local\Temp\tmp9kkaex06\baz
?     --
+ C:\Users\compaq\AppData\Local\Temp\tmpuuretujv\quux
?   ^^^ 


==
FAIL: test_copymode_follow_symlinks (__main__.TestShutil)
--
Traceback (most recent call last):
  File Lib\test\test_shutil.py, line 298, in test_copymode_follow_symlinks
self.assertEqual(os.stat(src).st_mode, os.stat(dst).st_mode)
AssertionError: 33206 != 33060

--
Ran 85 tests in 0.872s

FAILED (failures=2, skipped=12)

Attached the patch which contains the explanation as well to fix the tests.

--
components: Library (Lib)
files: fix_test_shutil_with_admin_on_windows.patch
keywords: patch
messages: 206860
nosy: pitrou, vajrasky
priority: normal
severity: normal
status: open
title: On Windows NT 6 with administrator account, there are two failing tests 
on test_shutil.py
type: behavior
versions: Python 3.3, Python 3.4
Added file: 
http://bugs.python.org/file33257/fix_test_shutil_with_admin_on_windows.patch

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



[issue20056] Got deprecation warning when running test_shutil.py on Windows NT 6

2013-12-23 Thread Vajrasky Kok

New submission from Vajrasky Kok:

You don't have to be an administrator get this deprecation warning. I am not 
sure whether showing the deprecation warning is intended behaviour or not.

C:\Users\vajrasky\Code\cpythonPCbuild\python.exe Lib\test\test_shutil.py
..s..s..sss...s..ss.ss..s.ss.ss..ss.C:\Users\vaj
rasky\Code\cpython\lib\ntpath.py:309: DeprecationWarning: The Windows bytes API
has been deprecated, use Unicode filenames instead
  st = os.lstat(path)
C:\Users\vajrasky\Code\cpython\lib\shutil.py:357: DeprecationWarning: The Window
s bytes API has been deprecated, use Unicode filenames instead
  names = os.listdir(path)
C:\Users\vajrasky\Code\cpython\lib\shutil.py:363: DeprecationWarning: The Window
s bytes API has been deprecated, use Unicode filenames instead
  mode = os.lstat(fullname).st_mode
C:\Users\vajrasky\Code\cpython\lib\shutil.py:370: DeprecationWarning: The Window
s bytes API has been deprecated, use Unicode filenames instead
  os.unlink(fullname)
C:\Users\vajrasky\Code\cpython\lib\shutil.py:374: DeprecationWarning: The Window
s bytes API has been deprecated, use Unicode filenames instead
  os.rmdir(path)
.sss.
--
Ran 85 tests in 0.741s

OK (skipped=28)

--
components: Tests
messages: 206861
nosy: vajrasky
priority: normal
severity: normal
status: open
title: Got deprecation warning when running test_shutil.py on Windows NT 6
type: behavior
versions: Python 3.3, Python 3.4

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



[issue19861] Update What's New for Python 3.4

2013-12-23 Thread R. David Murray

R. David Murray added the comment:

Unless I missed something, the changes to plistlib didn't make the Beta cutoff 
for 3.4, so there's nothing to be done for whatsnew with regard to it.  If the 
current documentation needs clarification, please open a new issue for that 
topic.

--

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



[issue20055] On Windows NT 6 with administrator account, there are two failing tests on test_shutil.py

2013-12-23 Thread Antoine Pitrou

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


--
nosy: +hynek, tarek
stage:  - patch review

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



[issue19861] Update What's New for Python 3.4

2013-12-23 Thread R. David Murray

R. David Murray added the comment:

Ah, looks like I did miss something.  I'll have to sort out what actually 
changed, since issue 14455 is still open.  I'll have to think about whether or 
not it is appropriate to discuss something that *hasn't* been added yet in 
whatsnew...

--

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



[issue20053] venv and ensurepip are affected by default pip config file

2013-12-23 Thread R. David Murray

R. David Murray added the comment:

I don't know anything about pip configuration or the tests, but perhaps you 
want to use something like: 

'PIP_CONFIG_FILE={}'.format(os.devnull)

--
nosy: +r.david.murray

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



[issue19999] test_monotonic fails on x86 OpenIndiana

2013-12-23 Thread Zachary Ware

Zachary Ware added the comment:

That's weird.  I ran the same test on the same computer with an installed 
64-bit 3.3.2, and got the same results (70+% failure).  I just ran the same 
test on a different computer (32-bit Windows 7), and also got the same results 
with both 3.4.0b1+ and 3.3.2 (installed).

FTR:
 time.get_clock_info('monotonic')
namespace(adjustable=False, implementation='GetTickCount64()', monotonic=True, 
resolution=0.0156000999)

I believe it's the same for all four Pythons tested.

Shall I open a new issue for this, or is it related enough to stay here? :)

--

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



[issue20055] On Windows NT 6 with administrator account, there are two failing tests on test_shutil.py

2013-12-23 Thread Zachary Ware

Zachary Ware added the comment:

See also issues #9949 and #15411.

--
nosy: +zach.ware

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



[issue20053] venv and ensurepip are affected by default pip config file

2013-12-23 Thread Nick Coghlan

Nick Coghlan added the comment:

Oh, I forgot about os.devnull.

ensurepip.bootstrap mutates the environment of the current process (hence the 
recommendation to use the CLI instead), so yes, doing 
os.environ['PIP_CONFIG_FILE'] = os.devnull before importing pip should do the 
trick.

And then generate a no-install=true config with HOME in test_venv to make 
sure it is properly ignored.

--

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



[issue20033] Fix makelocalealias.py for Python 3

2013-12-23 Thread Serhiy Storchaka

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


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

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



[issue19020] Regression: Windows-tkinter-idle, unicode, and 0xxx filename

2013-12-23 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

If there are no objections I'll commit these patches tomorrow.

--

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



[issue18983] Specify time unit for timeit CLI

2013-12-23 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

LGTM.

--

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



[issue19999] test_monotonic fails on x86 OpenIndiana

2013-12-23 Thread Tim Peters

Tim Peters added the comment:

Hmm.  One obvious difference on my box:

Python 3.3.2 (v3.3.2:d047928ae3f6, May 16 2013, 00:03:43) [MSC v.1600 32 bit 
(Intel)] on win32
 time.get_clock_info('monotonic')
namespace(adjustable=False, implementation='GetTickCount64()', monotonic=True, 
resolution=0.015625)

So the resolution here is exactly 1/64.  If that's truly the resolution, then 
all the results I'll see are exactly representable as Python floats.

The resolution you see (0.0156000999) looks bizarre.  Not because of 
the trailing nines, but because 0.0156001 doesn't appear to have any natural 
hardware or software meaning in decimal or binary.

That said, I see we get the resolution from GetSystemTimeAdjustment.  I don't 
understand the Windows time functions, but also don't see anything in the MSDN 
docs to suggest that the results from GetSystemTimeAdjustment should have 
anything to do with the resolution of GetTickCount64.  But maybe they do - LOL 
;-)

One other point:  we have lots of code of the form:

info-resolution = timeIncrement * 1e-7;

That is, we multiply some integer type by a double _negative_ power of 10.  All 
such code is needlessly inaccurate:  no negative power of 10 is exactly 
representable as a double, so we suffer a rounding error in representing 1e-7, 
and then another rounding error from the multiplication.  It's trivial to 
reduce the grand total to one rounding error instead, by rewriting as:

info-resolution = timeIncrement / 1e7;

But these rounding errors are too tiny to account for the difference between, 
e.g., 0.499000107102 and 0.5.

I don't conclude that we don't know what we're doing, but I bet we don't really 
understand what Windows is doing ;-)

--

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



[issue20057] wrong behavior with fork and mmap

2013-12-23 Thread Brett Tiplitz

New submission from Brett Tiplitz:

When running the example mmap library (with a slight modification, plus I did 
not handle all the changes for the 3.3 string handling as the example posted 
does not work with 3.x) 

When looking at the subprocess, the spawned process will have all the mmap'd 
file descriptors open.  The spawned process has the responsibility of closing 
any FD's that are in use.  However, since the shared memory segment get's 
closed and the program has no knowledge of private FD's, the mmap's private FD 
becomes a leak in the FD table.  It seems python should set the close-on-exec 
attribute on the dup'd FD that it maintains.  Examples of fixing this issue are 
found on 
http://stackoverflow.com/questions/1643304/how-to-set-close-on-exec-by-default
import mmap,os

# write a simple example file
with open(hello.txt, wb) as f:
f.write(bytes(Hello Python!\n, 'UTF-8'))

with open(hello.txt, r+b) as f:
# memory-map the file, size 0 means whole file
os.system(/bin/ls -l /proc/+str(os.getpid())+/fd)

mm = mmap.mmap(f.fileno(), 0)
os.system(/bin/ls -l /proc/+str(os.getpid())+/fd)
os.system(/bin/ls -l /proc/self/fd)

# read content via standard file methods
t1 = mm.readline() # used to print out
  # prints Hello Python!
# read content via slice notation
t2=mm[:5]
#print mm[:5]  # prints Hello
# update content using slice notation;
# note that new content must have same size
mm[6:] = bytes( world!\n, 'UTF-8')
# ... and read again using standard file methods
mm.seek(0)
t3=mm.readline()
 #   print mm.readline()  # prints Hello  world!
# close the map
mm.close()
~

--
components: Library (Lib)
messages: 206871
nosy: btiplitz
priority: normal
severity: normal
status: open
title: wrong behavior with fork and mmap
type: behavior
versions: Python 2.7

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



[issue20057] wrong behavior with fork and mmap

2013-12-23 Thread R. David Murray

R. David Murray added the comment:

It seems very likely that this is addressed by PEP 446.  Since that is not a 
behavior change that can be backported, I think this issue should probably be 
closed as out of date.

--
nosy: +haypo, r.david.murray

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



[issue19683] test_minidom has many empty tests

2013-12-23 Thread Julian Gindi

Julian Gindi added the comment:

So, it seems that there are many seemingly redundant tests and many tests whose 
intentions are unclear. I think this might be better suited for someone who has 
more experience with the xml minidom module. I have uploaded the work I have 
done but it is not complete.

--
Added file: http://bugs.python.org/file33258/issue19683.patch

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



[issue19999] test_monotonic fails on x86 OpenIndiana

2013-12-23 Thread STINNER Victor

STINNER Victor added the comment:

For more info on time, you can refer to the PEP 418.

I may be interesting to add sleep to time.get_clock_info(). time.sleep()
uses WaitForSingleObject() on windows. It may use internally a different
clock with a different resolution than time.monoyonic (GetTickCount). The
PEP says WaitForSingleObject(): use the same timer than GetTickCount()
with the same precision.

I don't think that it's very useful to investigate the rounding issue on
Windows. The resolution of Windows clocks is very coarse (15 ms, 10^-2)
compared to Unix clocks (usually a few nanoseconds, 10^-9)... I changed
recently the unit test to check if a sleep of 0.5 seconds gives a time
delta of at least 0.5 seconds. The minimum delta can be set to 0.45 sec
with a comment refering to this issue.

--

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



[issue19979] Missing nested scope vars in class scope (bis)

2013-12-23 Thread Terry J. Reedy

Terry J. Reedy added the comment:

As near as I can tell, class A: n = n currently works the same at module and 
nested scope, the latter with or without nonlocal n.

 class A: n=n
[...]
NameError: name 'n' is not defined

 def f():
class A: n=n

 f()
[...]
NameError: name 'n' is not defined

 def f(n):
class A: n=n

 f(2)
[...]
NameError: name 'n' is not defined

Repeat after 'n=1' at module scope and the NameErrors disappear. It appears 
that you are asking that the class statement be made to act differently when 
nested instead of the same. This would break code that depends on the current 
behavior. This would need discussion on python-ideas and pydev lists.

--
nosy: +terry.reedy
stage:  - test needed
type:  - enhancement
versions: +Python 3.5

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



[issue20057] wrong behavior with fork and mmap

2013-12-23 Thread Brett Tiplitz

Brett Tiplitz added the comment:

Changing the code to 
subprocess.call([/bin/ls, -l, /proc/self/fd])
and running this on Python 3.3 does show this as being resolved by the broader 
fix implemented in PEP 446.  It does seem bad that the os.system call remains 
in place with bad behavior as I know it's widely used.

--

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



[issue20057] wrong behavior with fork and mmap

2013-12-23 Thread STINNER Victor

STINNER Victor added the comment:

This issue is not specific to mmap. Many other functions and libraries may
use private inheritable file descriptors. Python 3.4 does not fix the issue
for third party libraries.

os.system() must be avoided, use subprocess.call() instead. It avoids an
useless shell process and closes all fds by default.

Is it a documentation issue?

--

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



[issue20057] wrong behavior with fork and mmap

2013-12-23 Thread Brett Tiplitz

Brett Tiplitz added the comment:

Man page currently says as follows: (this does not says it's deprecated or that 
files have to be closed on exec)...  So I'd think some more comments would 
help. And as mentioned, which a user can close his own fd's, the mmap call 
creates a special problem since the user can't work around the issue cleanly 
though fixed in the subprocess calls.


s.system(command)

Execute the command (a string) in a subshell. This is implemented by 
calling the Standard C function system(), and has the same limitations. Changes 
to sys.stdin, etc. are not reflected in the environment of the executed command.

On Unix, the return value is the exit status of the process encoded in the 
format specified for wait(). Note that POSIX does not specify the meaning of 
the return value of the C system() function, so the return value of the Python 
function is system-dependent.

On Windows, the return value is that returned by the system shell after 
running command, given by the Windows environment variable COMSPEC: on 
command.com systems (Windows 95, 98 and ME) this is always 0; on cmd.exe 
systems (Windows NT, 2000 and XP) this is the exit status of the command run; 
on systems using a non-native shell, consult your shell documentation.

The subprocess module provides more powerful facilities for spawning new 
processes and retrieving their results; using that module is preferable to 
using this function. See the Replacing Older Functions with the subprocess 
Module section in the subprocess documentation for some helpful recipes.

Availability: Unix, Windows.

--

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



[issue20058] IDLE's shell returns a multiple-line string to input() or readline() when multiple lines of text are pasted by the user

2013-12-23 Thread Steven Barker

New submission from Steven Barker:

Pasting multiple lines of input and then pressing Enter when IDLE is waiting to 
read a single line (such as when input() or sys.stdin.readline() have been 
called) will result is a multi-line string being given as the input, rather 
than a single line.

This may be most easily understood by looking at an example. Run this code in 
IDLE (either by typing it in the shell, or from a file with F5):

s = X
while s:
s = input()
print(repr(s))

First, try typing in several lines. Each will be printed separately, with no 
newlines inside the strings (since input() strips a trailing newline).

foo
'foo'
bar
'bar'
baz
'baz'

Next, copy several lines of text from somewhere. It doesn't matter what the 
lines' contents are. Here I grabbed a list of Python version numbers, as I was 
on the download page after grabbing 3.4.0b1 for testing this bug:

3.1.5
3.0.1
2.7.6
2.6.9
2.5.6
2.4.6
2.3.7
2.2.3 all the preceding lines were pasted in one go, followed by enter 
pressed here
'3.1.5\n3.0.1\n2.7.6\n2.6.9\n2.5.6\n2.4.6\n2.3.7\n2.2.3'

This behavior is different than what the Python interpreter does in a regular 
console shell. When running in cmd.exe on Windows, Python treats a multi-line 
paste just like typed input:

3.1.5
'3.1.5'
3.0.1
'3.0.1'
2.7.6
'2.7.6'
2.6.9
'2.6.9'
2.5.6
'2.5.6'
2.4.6
'2.4.6'
2.3.7
'2.3.7'
2.2.3 enter typed here
'2.2.3'

I expect the same behavior will be common in other kinds of terminals on other 
platforms.

This issue makes testing certain kinds of programs very frustrating. If your 
program needs to read certain text from STDIN, and you want to paste that text 
in quickly, you need to update your code with special logic just for use in 
IDLE's console. As an example of the kind of pain you may experience, try 
copying and pasting a block of text with a blank line into the input loop 
above. On a regular console session it will exit the loop after the blank line. 
In IDLE, it will keep running.

I've traced the source of this issue through IDLE's sys.stdin file object and 
an RPC call, and found it probably is located in the 
idlelib.PyShell.PyShell.readline method (or the surrounding code). This grabs a 
string from the Text object in the shell window and returns it to the Python 
code running in the subprocess.

Probably it should have some extra steps added to check if it got multiple 
lines. If so, it should split the string on newlines and return just one line 
of text for each readline call. I'm not sure exactly what should be done with 
the rest of the lines, but perhaps they could be queued up (or somehow put 
back by moving the markers in the Text object) so later lines would be grabbed 
by later input requests.

Or alternatively, maybe the event where the multi-line paste arrives should be 
handled differently, as several single-line input events, rather than a single 
multiple-line one.

--
components: IDLE
messages: 206879
nosy: Steven.Barker
priority: normal
severity: normal
status: open
title: IDLE's shell returns a multiple-line string to input() or readline() 
when multiple lines of text are pasted by the user
type: behavior
versions: Python 2.7, Python 3.3, Python 3.4

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



[issue20054] IDLE won't work (Mac)

2013-12-23 Thread Ned Deily

Ned Deily added the comment:

What happens if you try to start IDLE from a terminal session by typing:

/usr/local/bin/idle3.3

--
nosy: +ned.deily

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



[issue20059] Inconsistent urlparse/urllib.parse handling of invalid port values?

2013-12-23 Thread Chad Birch

New submission from Chad Birch:

I'm not sure if this is something that needs adjustment, but it seems somewhat 
inconsistent to me.

After using urlparse() on various urls with invalid port values, trying to 
access .port on the result will raise a ValueError. This case includes urls 
such as:

http://www.example.com:asdf;

http://www.example.com:1.5;

http://www.example.com:;

However, as of May 24 2012 
(http://hg.python.org/cpython/diff/d769e64aed79/Lib/urllib/parse.py), if the 
invalid port value is an integer, accessing .port will result in None. So this 
includes urls such as:

http://www.example.com:66000;

http://www.example.com:-1;

Should these two cases be made consistent, so that either .port is always None 
or always results in a ValueError if the port section of the url is invalid? 
I'd be happy to write a patch for it if it's wanted, but I thought I'd check 
first (and see which of the two options would be correct, if so).

--
components: Library (Lib)
messages: 206881
nosy: chad.birch
priority: normal
severity: normal
status: open
title: Inconsistent urlparse/urllib.parse handling of invalid port values?
type: behavior

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



[issue20054] IDLE won't work (Mac)

2013-12-23 Thread Sophie Chancheong

Sophie Chancheong added the comment:

when i try to start it from terminal i get:

sophiesmac:~ Sophie$ /usr/local/bin/idle3.3
Traceback (most recent call last):
  File /usr/local/bin/idle3.3, line 5, in module
main()
  File 
/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/idlelib/PyShell.py,
 line 1572, in main
shell.interp.runcommand(''.join((print(', tkversionwarning, '
AttributeError: 'NoneType' object has no attribute 'interp'

--

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



[issue19927] Path-based loaders lack a meaningful __eq__() implementation.

2013-12-23 Thread Eric Snow

Eric Snow added the comment:

I'm fine with this.  Thanks, Larry, for your attentiveness and diligence.

--

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



[issue11797] 2to3 does not correct reload

2013-12-23 Thread R. David Murray

R. David Murray added the comment:

Since this patch was applied, imp.reload has been deprecated in favor of 
importlib.reload.  I don't know how we handle differences between python3 
versions...is there anything that should be done here, or do we just use 
imp.reload even though it is deprecated in 3.4?

--
nosy: +r.david.murray

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



[issue19999] test_monotonic fails on x86 OpenIndiana

2013-12-23 Thread Tim Peters

Tim Peters added the comment:

@haypo, I've read the PEP and it has great ideas.  What I'm wondering is 
whether they've been implemented correctly in the relevant cases on Windows 
here.  That Zach see a resolution of 0.0156001 on Windows isn't plausibly a 
question of rounding errors:  that value appears to be insane.  Yes, it's 
vaguely close to the 0.015625 I see, but the value I see _is_ sane (being 
exactly 1/64) - but 0.0156001 isn't close enough to 0.015625 for rounding 
errors to be at all a plausible explanation for why it's so strange.

--

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



[issue19999] test_monotonic fails on x86 OpenIndiana

2013-12-23 Thread Tim Peters

Tim Peters added the comment:

FYI, this person seems to have made a career ;-) of making sense of the Windows 
time functions:

http://stackoverflow.com/questions/7685762/windows-7-timing-functions-how-to-use-getsystemtimeadjustment-correctly

and their site:

http://www.windowstimestamp.com/description

Bottom line is that it's messy as everything else on Windows :-(  They claim, 
among other things:

- GetSystemTimeAdjustment is not the function to look at.

- The undocumented NtQueryTimerResolution() is the function to look at.

- Time Adjustment: 0.0156001 clearly identifies windows VISTA or higher with 
HPET and/or constant/invariant TSC on your system.

Screw it - I'm gonna go shovel more snow ;-)

--

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



[issue20054] IDLE won't work (Mac)

2013-12-23 Thread Ned Deily

Ned Deily added the comment:

This problem was reported and fixed in Issue18270 which will be in the next set 
of Python maintenance releases.  As explained there, what is causing this is 
that the Python 3.3 tkinter you are using is trying to use the known buggy 
system Tk 8.5 shipped with OS X.  If you are using a python.org 3.3, you can 
avoid the problem by installing a more up-to-date version of Tcl/Tk 8.5, such 
as the current ActiveTcl 8.5.15.0.  See 
http://www.python.org/download/mac/tcltk/

--
resolution:  - duplicate
stage:  - committed/rejected
status: open - closed
superseder:  - IDLE on OS X fails with Attribute Error if no initial shell and 
Tk out-of-date

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



[issue20033] Fix makelocalealias.py for Python 3

2013-12-23 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 22c59ddba494 by Serhiy Storchaka in branch '3.3':
Issue #20033: makelocalealias.py now works with non-ASCII locales and produces
http://hg.python.org/cpython/rev/22c59ddba494

New changeset 1287c570176b by Serhiy Storchaka in branch 'default':
Issue #20033: makelocalealias.py now works with non-ASCII locales and produces
http://hg.python.org/cpython/rev/1287c570176b

--
nosy: +python-dev

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



[issue20058] IDLE's shell returns a multiple-line string to input() or readline() when multiple lines of text are pasted by the user

2013-12-23 Thread Serhiy Storchaka

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


--
nosy: +kbk, roger.serwy, serhiy.storchaka, terry.reedy

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



[issue20058] IDLE's shell returns a multiple-line string to input() or readline() when multiple lines of text are pasted by the user

2013-12-23 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Here is simple patch.

--
keywords: +patch
stage:  - patch review
Added file: http://bugs.python.org/file33259/idle_readline.patch

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