[issue15330] allow deque to act as a thread-safe circular buffer

2012-07-12 Thread Chris Jerdonek

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

Thanks for the info.  A couple questions: what does won't break mean -- that 
it won't throw an exception of a type that it wouldn't normally throw in a 
single-threaded environment?  And does this mean that not even deque.pop() is 
atomic?

--

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



[issue15329] clarify which deque methods are thread-safe

2012-07-12 Thread Chris Jerdonek

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

I think some of the information in the issue 15330 comments would be very 
helpful to add as well (what thread-safe means in Python, distinction between 
thread-safe and atomic, and which deque methods are thread-safe and/or atomic).

If some of that information is too general for the collections library, perhaps 
some of it can go in a section of the Python documentation about multithreading 
(the glossary?), and then be linked to there.

--

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



[issue15188] test_ldshared_value failure on OS X using python.org Pythons

2012-07-12 Thread Ned Deily

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

The resolution of this test failure is dependent on the resolution of 
Issue15298, which will change the approach needed.  Since this is a relatively 
minor issue, I don't think there is a need for a interim fix.

--
components: +Tests
priority: high - normal
stage:  - needs patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15188
___
___
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-07-12 Thread Ned Deily

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

(Once this issue is resolved, a permanent fix for the minor OS X test case 
failure of Issue15188 can be developed and applied.)

--
nosy: +ned.deily

___
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



[issue15188] test_ldshared_value failure on OS X using python.org Pythons

2012-07-12 Thread Ned Deily

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


--
dependencies: +_sysconfigdata is generated in srcdir, not builddir

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



[issue15320] thread-safety issue in regrtest.main()

2012-07-12 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc amaur...@gmail.com added the comment:

 I wrote this patch with the assumption that it shouldn't hurt
 if multiple threads call deque.extend() at the same time.

By looking at the implementation, I found that if multiple threads call 
dequeue.extend() at the same time, all items will be added, but the order is 
not deterministic.
It probably does not matter for tests.

In any case, I think we should not rely on this specific implementation.  We 
should document which functions are safe to use in a multithreading environment.

--

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



[issue15302] Use argparse instead of getopt in test.regrtest

2012-07-12 Thread Georg Brandl

Georg Brandl ge...@python.org added the comment:

Please leave this for Python 3.4 -- it is not a bugfix.

--
nosy: +georg.brandl
versions: +Python 3.4 -Python 3.3

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



[issue15320] thread-safety issue in regrtest.main()

2012-07-12 Thread Chris Jerdonek

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

That sounds fine.  And thanks for investigating.

By the way, I created issue 15329 earlier today to clarify what guarantees 
deque provides with respect to multithreading.  For example, the distinction 
between thread-safe and atomic is not currently mentioned.  As you observed, 
deque.extend() is not atomic but I'm guessing is probably considered safe.

--

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



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

2012-07-12 Thread Ned Deily

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

I think you're right that the casts are incorrect.  I think the existing cast 
ia a day one bug in Python 3.  The question is why hasn't it been a problem?  
That area needs fixing up since NSModuleForSymbol, NSLookupAndBindSymbol, and 
NSLibraryNameForModule are now deprecated interfaces.  Also, in the patch, 
shouldn't the wcsncpy be followed by a wcscpy(tmpbuffer, argv0_path) as well?

--

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



[issue15189] tkinter.messagebox does not use the application's icon

2012-07-12 Thread Mark Summerfield

Mark Summerfield m...@qtrac.eu added the comment:

I think there is a solution to this that can be applied in one's own code:

app = tkinter.Tk()
icon = tkinter.PhotoImage(file=icon.gif)
app.tk.call(wm, iconphoto, app, -default, icon)

According to the docs (and it seems to be true), the icon thus set will be used 
for *all* the applications top-level windows.

--

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



[issue15318] IDLE - sys.stdin is writeable

2012-07-12 Thread Serhiy Storchaka

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

 sys.stdin.write returns the wrong error message when passed a non-string. 
 Presently it returns io.UnsupportedOperation instead of TypeError: must be 
 str, not ...

It's not a bug. sys.stdin.write raises io.UnsupportedOperation in
standard interpreter.

--

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



[issue15318] IDLE - sys.stdin is writeable

2012-07-12 Thread Serhiy Storchaka

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

 Ah. See blockfiles-3.diff then.

Well, I have no objections. Patch fixes this issue.

 Where do you see that? In my patch, _RPCInputFile inherits from
 _RPCFile, which is neither output nor input. Instead, _RPCOutputFile
 also inherits from _RPCFile.

I made a mistake. I mean PseudoInputFile, but it just monkey-patched.

  _RPCInputFile unnecessary, if redirect stdin not on PyShell self, but on
  PyShell.stdin.
 It is necessary, as rpc will not communicate the exceptions properly.

Yes, this is yet another issue. Rpc not communicates properly only
OSError. Remove except socket.error: raise in SocketIO.localcall in
Lib/idlelib/rpc.py and io.UnsupportedOperation will transparently
transfered.

--

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



[issue7163] IDLE suppresses sys.stdout.write() return value

2012-07-12 Thread Serhiy Storchaka

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

Reply to Roger's emailed answer to my Rietveld comment.

 On 07/11/2012 11:10 AM, storch...@gmail.com wrote:
  http://bugs.python.org/review/7163/diff/4367/Lib/idlelib/OutputWindow.py
  File Lib/idlelib/OutputWindow.py (right):
 
  http://bugs.python.org/review/7163/diff/4367/Lib/idlelib/OutputWindow.py#newcode43
  Lib/idlelib/OutputWindow.py:43: return len(s)
  write() should return count of bytes if argument is bytes.
 Only strings should be passed into the write method in 3.3. The  code 
 for decoding bytes is a historical artifact that should be removed. You 
 can witness this evolution by using hgtk datamine.

We can ask the author.

Martin, why OutputWindow.write accepts bytes in a724279fc931? Should it be 
deleted if it is deprecated artifact or should OutputWindow.write return bytes 
count for bytes if it will return character count for string?

 On 2.7, byte counts (AFAIK)  are not returned for sys.stdout.write.

On Python2 sys.stdout.write does not returns any count.

--
nosy: +loewis

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



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

2012-07-12 Thread Ronald Oussoren

Ronald Oussoren ronaldousso...@mac.com added the comment:

The current code works, and I don't understand why it does.

I'd love to get rid of the long deprecated APIs like NSModuleForSymbol as well, 
but we'll have to ask the RM if that is an acceptable change at this point in 
the 3.3 release process.

BTW. Is adding symlink support on OSX a bug fix or a new feature? I'd prefer to 
treat this a bug fix, framework builds currently don't support the --symlinks 
option while they easily could do it.

--

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



[issue15331] Missing codec aliases for bytes-bytes codecs

2012-07-12 Thread Nick Coghlan

New submission from Nick Coghlan ncogh...@gmail.com:

In writing a post looking at a potentially different way of handling codec 
pipelines that is source compatible across both Python 2 and 3, I noticed that 
the bytes-bytes codec aliases are all missing but are still listed in the 
documentation as being supported:

base64_codecbase64, base-64
bz2_codec   bz2
hex_codec   hex

quopri_codecquopri, quoted-printable, quotedprintable
uu_codecuu
zlib_codec  zip, zlib

The canonical names (i.e. *_codec) all work as expected, though.

--
messages: 165295
nosy: ncoghlan
priority: normal
severity: normal
stage: test needed
status: open
title: Missing codec aliases for bytes-bytes codecs
type: behavior
versions: Python 3.2, Python 3.3

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



[issue15238] shutil.copystat should copy Linux extended attributes

2012-07-12 Thread Hynek Schlawack

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

The patch looks good enough. Not sure if we should write Linux though. I 
sincerely hope we’ll support xattrs on other OSes soonish.

Did you catch Georg somewhere whether this can still go in? Would be nice as 
xattrs are new to 3.3. Changing this in 3.4 would be rather unfortunate.

--

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



[issue15180] Cryptic traceback from os.path.join when mixing str bytes

2012-07-12 Thread Hynek Schlawack

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

I didn’t, because I pulled an Antoine and enjoyed weather, people and Florence. 
:)

I understand it’s okay to apply this towards 3.2  3.3 (with the proposed 
fixes)?

2.7 is not necessary because this problem doesn’t exist there:

 os.path.join(b'foo', u'bar')
u'foo/bar'

Introducing explicit sanity checks there would cause people wanting to eat our 
hearts. :)

--

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



[issue15238] shutil.copystat should copy Linux extended attributes

2012-07-12 Thread Georg Brandl

Georg Brandl ge...@python.org added the comment:

Yeah, good to go.  But please re-insert a blank line in the test suite changes 
after the end of the method.

--

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



[issue7163] IDLE suppresses sys.stdout.write() return value

2012-07-12 Thread Martin v . Löwis

Martin v. Löwis mar...@v.loewis.de added the comment:

 We can ask the author.

 Martin, why OutputWindow.write accepts bytes in a724279fc931?

That change was to add support for str8, a type that no longer exists.

 Should it be deleted if it is deprecated artifact or should  
 OutputWindow.write return bytes count for bytes if it will return  
 character count for string?

The general design guideline apparently is that sys.stdout in IDLE
should work the same as the interactive shell.

Since the interactive shell doesn't support bytes (and gives a TypeError),
so should IDLE.

--

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



[issue7163] IDLE suppresses sys.stdout.write() return value

2012-07-12 Thread Serhiy Storchaka

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

 That change was to add support for str8, a type that no longer exists.

str8 was renamed to bytes in 0d462d789b18.

 The general design guideline apparently is that sys.stdout in IDLE
 should work the same as the interactive shell.
 
 Since the interactive shell doesn't support bytes (and gives a TypeError),
 so should IDLE.

Now OutputWindow is not sys.stdout and sys.stdout has own argument
check. If someone uses OutputWindow directly (not sys.stdout) as output
_binary_ file (because OutputWindow supports binary output), then he
would be expected that write will return the number of written bytes.
Can we break those expectations?

--

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



[issue15328] datetime.strptime slow

2012-07-12 Thread Brett Cannon

Changes by Brett Cannon br...@python.org:


--
status: open - pending

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



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

2012-07-12 Thread Ronald Oussoren

Ronald Oussoren ronaldousso...@mac.com added the comment:

I've attached a new version of the patch:

* copy to tmp buffer instead of argv0_buffer (see comment by Ned)

* add include in pythonw.c to avoid compiler warning

* use _Py_char2wchar instead of blindly casting a char* to a wchar_t*


The behavior is not perfect yet, sys.executable is set to the wrong value (both 
with and without --symlinks).  I haven't checked yet if the value is correct 
without my patch.

--
Added file: http://bugs.python.org/file26364/venv-symlinks-v2.txt

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



[issue15331] Missing codec aliases for bytes-bytes codecs

2012-07-12 Thread R. David Murray

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

Don't you have to resolve issue 7475 before you can add them, though?

--
nosy: +r.david.murray

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



[issue15332] 2to3 should fix bad indentation (or warn about it)

2012-07-12 Thread Jakub Wilk

New submission from Jakub Wilk jw...@jwilk.net:

Python 3 is more rigid about mixing tabs and spaces within a single file. 2to3 
should either fix indentation that would become a syntax error in Python 3.X, 
or maybe issue a warning about it (or both).

Example:

$ python badtabs.py  echo okay
okay

$ 2to3 badtabs.py 
RefactoringTool: Skipping implicit fixer: buffer
RefactoringTool: Skipping implicit fixer: idioms
RefactoringTool: Skipping implicit fixer: set_literal
RefactoringTool: Skipping implicit fixer: ws_comma
RefactoringTool: No files need to be modified.

$ python3 badtabs.py  echo okay
  File badtabs.py, line 3
'b'
  ^
TabError: inconsistent use of tabs and spaces in indentation

--
components: 2to3 (2.x to 3.x conversion tool)
files: badtabs.py
messages: 165303
nosy: jwilk
priority: normal
severity: normal
status: open
title: 2to3 should fix bad indentation (or warn about it)
Added file: http://bugs.python.org/file26365/badtabs.py

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



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

2012-07-12 Thread Ronald Oussoren

Ronald Oussoren ronaldousso...@mac.com added the comment:

based on code inspection I'd say that sys.executable was broken without my 
patch as well. The code that sets that value is unchanged from Python 3.2, and 
that points to the executable inside the Python.app application bundle.

I've attached v3 of my patch, that ensures that sys.executable is the path used 
to start the executable. This gives points to the right executable when using 
venv and is a nicer (and arguably better) result outside of vent's as well.

There should probably be new tests as well that test that sys.executable has 
the right value in a venv.

--
Added file: http://bugs.python.org/file26366/venv-symlinks-v3.txt

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



[issue15238] shutil.copystat should copy Linux extended attributes

2012-07-12 Thread Larry Hastings

Larry Hastings la...@hastings.org added the comment:

Georg: done.

Hynek: You must forgive me, I'm a recovering Windows programmer.  I thought 
extended attributes were a Linux-only thing.  Can you tell me what other 
platforms they are available on?  And/or suggest some alternate language?

--

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



[issue15320] thread-safety issue in regrtest.main()

2012-07-12 Thread Raymond Hettinger

Raymond Hettinger raymond.hettin...@gmail.com added the comment:

Why not use locks to guard critical sections rather than relying on 
implementation details regarding atomicity?

--
nosy: +rhettinger

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



[issue15318] IDLE - sys.stdin is writeable

2012-07-12 Thread Roger Serwy

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

On 07/12/2012 04:13 AM, Serhiy Storchaka wrote:
 Serhiy Storchakastorch...@gmail.com  added the comment:

 sys.stdin.write returns the wrong error message when passed a non-string. 
 Presently it returns io.UnsupportedOperation instead of TypeError: must be 
 str, not ...
 It's not a bug. sys.stdin.write raises io.UnsupportedOperation in
 standard interpreter.

Here's what I get from the standard interpreter:

 Python 3.3.0b1 (default:4752fafb579d, Jul 11 2012, 22:05:03)
 [GCC 4.5.2] on linux
 Type help, copyright, credits or license for more information.
  import sys
  sys.stdin.write(123)
 Traceback (most recent call last):
   File stdin, line 1, in module
 TypeError: must be str, not int
 

 --

 ___
 Python trackerrep...@bugs.python.org
 http://bugs.python.org/issue15318
 ___


--

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



[issue15320] thread-safety issue in regrtest.main()

2012-07-12 Thread Chris Jerdonek

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

Yes, that is what I took Amaury's comment to mean.  I started working on a 
patch that incorporates a lock.

--

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



[issue15333] import on Windows will recompile a pyc file created on Unix

2012-07-12 Thread Andrew MacKeith

New submission from Andrew MacKeith and...@mackeith.net:

In certain cases, a compiled Python file (.pyc) created on Unix will be 
recompiled when imported on Windows, despite the original code file (.py) being 
the same.
The cause is the use of the c fstat function in import.c.

This behavior is contrary to the stated Python behavior that a precompiled 
Python file is portable between platforms.

The fix to this bug would be to use the posixmodule stat implementation in 
place of fstat in import.c.

An example is the following, in Python 2.6.2:

This was tested on July 11th, 2012, USA EDT 
(i.e. DST is in effect, and local time is GMT - 6 hours). 
Lib/re.py has a mtime of 01/01/2009  11:46 AM according to Windows DIR.

Windows fstat st_mtime returns 1230828370 (0x495cf352) 16:46 GMT
Linux   fstat st_mtime returns 1230824770 (0x495ce542) 15:46 GMT

The effect of this is that when import opens the .pyc file and reads the mtime 
(the 2nd 4-byte field of the .pyc file) it sees it as bad and therefore 
recompiles the file.

The Python os.stat function works correctly on both Windows and Unix. There is 
a note in posixmodule.c that warns of a problem with Windows fstat:

#ifdef MS_WINDOWS
/* The CRT of Windows has a number of flaws wrt. its stat() implementation:
   - time stamps are restricted to second resolution
   - file modification times suffer from forth-and-back conversions between
 UTC and local time
   Therefore, we implement our own stat, based on the Win32 API directly.
*/


A Python file can also be precompiled using py_compile.compile; this uses 
os.stat to get the mtime of the .py file, and writes that to the .pyc file. 
This has the Unix behavior, and is correct.

Output from time functions on Linux:
(The results are the same on Windows)

 print time.gmtime(0x495ce542)
time.struct_time(tm_year=2009, tm_mon=1, tm_mday=1, tm_hour=15, tm_min=46, 
tm_sec=10, tm_wday=3, tm_yday=1, tm_isdst=0)

 print time.localtime(0x495ce542)
time.struct_time(tm_year=2009, tm_mon=1, tm_mday=1, tm_hour=10, tm_min=46, 
tm_sec=10, tm_wday=3, tm_yday=1, tm_isdst=0)

 print time.gmtime(0x495cf352)
time.struct_time(tm_year=2009, tm_mon=1, tm_mday=1, tm_hour=16, tm_min=46, 
tm_sec=10, tm_wday=3, tm_yday=1, tm_isdst=0)

 print time.localtime(0x495cf352)
time.struct_time(tm_year=2009, tm_mon=1, tm_mday=1, tm_hour=11, tm_min=46, 
tm_sec=10, tm_wday=3, tm_yday=1, tm_isdst=0)



There has been no change in the relevant import.c code between Python-2.6 and 
Python-3.3.

X:\work\testimportmtimec:\python26\python
Python 2.6.5 (r265:79096, Mar 19 2010, 18:02:59) [MSC v.1500 64 bit (AMD64)] on 
win32
Type help, copyright, credits or license for more information.
 import platform
 print platform.platform()
Windows-post2008Server-6.1.7601-SP1
 print platform.architecture()
('64bit', 'WindowsPE')
 print platform.python_compiler()
MSC v.1500 64 bit (AMD64)

--
components: Interpreter Core
files: testImportRe.py
messages: 165309
nosy: mackeith
priority: normal
severity: normal
status: open
title: import on Windows will recompile a pyc file created on Unix
type: behavior
versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3
Added file: http://bugs.python.org/file26367/testImportRe.py

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



[issue15333] import on Windows will recompile a pyc file created on Unix

2012-07-12 Thread Mark Dickinson

Mark Dickinson dicki...@gmail.com added the comment:

Is this the same issue as issue #13863?

--
nosy: +mark.dickinson

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



[issue15320] thread-safety issue in regrtest.main()

2012-07-12 Thread Antoine Pitrou

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

 Yes, that is what I took Amaury's comment to mean. I started working on a 
 patch that incorporates a lock.

For the sake of clarity, I think Raymond suggests using a lock in regrtest, not 
in deque.

--

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



[issue15333] import on Windows will recompile a pyc file created on Unix

2012-07-12 Thread Antoine Pitrou

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

 Is this the same issue as issue #13863?

Judging by Andrew's diagnosis, I think so.

--
nosy: +pitrou
resolution:  - duplicate
status: open - closed
superseder:  - import.c sometimes generates incorrect timestamps on Windows + 
NTFS

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



[issue13863] import.c sometimes generates incorrect timestamps on Windows + NTFS

2012-07-12 Thread Antoine Pitrou

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

It shouldn't affect 3.3 anymore (importlib using the os module rather than 
direct C calls to msvcrt). Could someone check?

--
nosy: +mackeith
versions:  -Python 3.3

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



[issue15329] clarify which deque methods are thread-safe

2012-07-12 Thread Raymond Hettinger

Raymond Hettinger raymond.hettin...@gmail.com added the comment:

I think you're over-reaching.   We make almost no guarantees about atomicity.  
Having multiple implementations of Python makes that an even harder task.  

In general, critical sections need to be guarded with locks.  If an object 
claims to be thread-safe, it means that it has used locks (perhaps relying on 
the GIL) to guard its own critical sections.  

Almost any pure Python class with complex state and without locks is not 
thread-safe (for example, an insertion into an OrderedDict needs to update the 
two dicts and a doubly-linked list).

Classes written in C are necessarily thread-safe (they rely on the GIL) or else 
they would risk segfaulting.  Other implementations are free to make different 
decisions about which classes are thread-safe. Pypy tends to make fewer 
guarantees because it implements more classes in pure python.  Jython tends to 
make strong guarantees because it uses Java's concurrent mappings and other 
such tools.

For the most part, the docs have done the right thing by not making any 
promises.  It might be helpful though to have a HOWTO guide explaining the 
facts-of-life when doing multi-threading (i.e. don't assume anything is atomic 
or thread-safe unless explicitly promised and don't expect many such promises).

--
priority: normal - low

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



[issue15330] allow deque to act as a thread-safe circular buffer

2012-07-12 Thread Raymond Hettinger

Raymond Hettinger raymond.hettin...@gmail.com added the comment:

 A couple questions: what does won't break mean 

That means that its internal invariants always survive in a multi-threaded 
environment.

 that it won't throw an exception of a type that it 
 wouldn't normally throw in a single-threaded environment? 

Unless that exception is being raised to indicate that a resource is in  use 
(much that same as a database notifying you that it can't make a change because 
the DB is currently locked).

--

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



[issue15318] IDLE - sys.stdin is writeable

2012-07-12 Thread Serhiy Storchaka

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

 sys.stdin.write('qwe')
Traceback (most recent call last):
  File stdin, line 1, in module
io.UnsupportedOperation: not writable

--

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



[issue15329] clarify which deque methods are thread-safe

2012-07-12 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc amaur...@gmail.com added the comment:

 Pypy tends to make fewer guarantees because it implements 
 more classes in pure python.

This is not exactly true; in PyPy the _collection module was rewritten in 
RPython (which is translated to C) for this very reason: to make dequeue.append 
atomic and thus thread-safe.

--
nosy: +amaury.forgeotdarc

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



[issue15329] clarify which deque methods are thread-safe

2012-07-12 Thread Antoine Pitrou

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

 Classes written in C are necessarily thread-safe (they rely on the GIL)

That's not really true. A single Py_DECREF() can release the GIL by way of 
executing a Python __del__ method (or a weakref callback, or even the 
tp_dealloc of a file object that happens to release the GIL when close()ing the 
underlying file descriptor) somewhere along the reference chain, as evidenced 
by Amaury in http://bugs.python.org/issue15320#msg165253

I think that if the deque documentation makes the claim that some methods are 
thread-safe, they should be *really* thread-safe (which doesn't necessarily 
imply a lock, but implies being extra careful). Otherwise it's better to remove 
the claim from the docs.

--
nosy: +pitrou

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



[issue15318] IDLE - sys.stdin is writeable

2012-07-12 Thread Roger Serwy

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

 sys.stdin.write('qwe')
 Traceback (most recent call last):
File stdin, line 1, inmodule
 io.UnsupportedOperation: not writable

 --

I'm passing a number, *not* a string.

--

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



[issue15334] access denied for HKEY_PERFORMANCE_DATA

2012-07-12 Thread Jeremy Kloth

New submission from Jeremy Kloth jeremy.kloth+python-trac...@gmail.com:

The registry key HKEY_PERFORMANCE_DATA is not accessible for non-interactive 
users (e.g., buildbot as a service).

The following patches skip the offending test when the tests unless the they 
are run from an interactive session.

--
components: Tests, Windows
files: winreg-2.x.diff
keywords: patch
messages: 165320
nosy: jkloth
priority: normal
severity: normal
status: open
title: access denied for HKEY_PERFORMANCE_DATA
type: behavior
versions: Python 2.7, Python 3.2, Python 3.3, Python 3.4
Added file: http://bugs.python.org/file26368/winreg-2.x.diff

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



[issue15334] access denied for HKEY_PERFORMANCE_DATA

2012-07-12 Thread Jeremy Kloth

Changes by Jeremy Kloth jeremy.kloth+python-trac...@gmail.com:


Added file: http://bugs.python.org/file26369/winreg-3.x.diff

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



[issue15334] access denied for HKEY_PERFORMANCE_DATA

2012-07-12 Thread Antoine Pitrou

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


--
nosy: +brian.curtin, stutzbach, tim.golden

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



[issue15335] IDLE - debugger steps through run.py internals

2012-07-12 Thread Roger Serwy

New submission from Roger Serwy roger.se...@gmail.com:

The IDLE debugger steps through the internals of _RPCFile.

To reproduce this bug, create a new .py file with a few print statements, 
enable the debugger, and then run the file. Stepping through the print 
statement enters into _RPCFile.

--
components: IDLE
messages: 165321
nosy: loewis, serwy, storchaka, terry.reedy
priority: normal
severity: normal
status: open
title: IDLE - debugger steps through run.py internals
type: behavior
versions: Python 3.3

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15335
___
___
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-07-12 Thread Matthias Klose

Matthias Klose d...@debian.org added the comment:

while I appreciate the fix for #13150, it's the patch for #13150 which 
introduces the ugliness to build the file in the srcdir in the first place.

re-setting the bug severity. the current behaviour can result in a bogus 
installation; please let the release manager decide on it.

--
priority: normal - release blocker

___
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



[issue13150] Most of Python's startup time is sysconfig

2012-07-12 Thread Matthias Klose

Matthias Klose d...@debian.org added the comment:

the current ability to cross-build python now relies on being able to run the 
build python with the host library, using the _sysconfigdata.py from the host.

if somebody decides to implement _sysconfigdata as a C extension, please ensure 
that this information still can be passed to the build python.

--
nosy: +doko

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



[issue15335] IDLE - debugger steps through run.py internals

2012-07-12 Thread Roger Serwy

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

Debugger.py has a method in_rpc_code which ultimately prevents stepping 
though code from rpc.py. (Presently an external file named rpc.py can not be 
debugged using IDLE.)

Adding run.py to the check would prevent run.py from being stepped, but it 
applies to *any* run.py in the filename string:

elif frame.f_code.co_filename.count('run.py'):
return True

Or, you could check the name:

elif frame.f_globals.get('__name__','') == 'idlelib.run':
return True

Any additional logic for in_rpc_code can slow down code performance when 
debugging.

Another possible approach is to move the _RPCFile into rpc.py add additional 
methods to RPCHandler, like get_remote_stdout_proxy.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15335
___
___
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-07-12 Thread Antoine Pitrou

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


--
nosy: +georg.brandl

___
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



[issue15335] IDLE - debugger steps through run.py internals

2012-07-12 Thread Martin v . Löwis

Martin v. Löwis mar...@v.loewis.de added the comment:

I suggest to add a decorator @Debugger.internal for all methods that the 
debugger should not step into. It should set a function attribute that the 
debugger then checks for.

OTOH, I fail to see the problem. Stepping through the standard library may be 
useful, and if you don't want to do that, you can choose to step over still.

--

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



[issue15332] 2to3 should fix bad indentation (or warn about it)

2012-07-12 Thread Benjamin Peterson

Benjamin Peterson benja...@python.org added the comment:

You can already find this using python -tt and fix it using reindent.py.

--
nosy: +benjamin.peterson
priority: normal - low

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



[issue15238] shutil.copystat should copy Linux extended attributes

2012-07-12 Thread Ned Deily

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

See open Issue12978.

--
nosy: +ned.deily

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



[issue6858] This is a python file, apply syntax highlighting

2012-07-12 Thread Roger Serwy

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

Attached is a patch to allow toggling of the ColorDelegator. It can be toggled 
using the existing, but undocumented, Control-/ binding. 

The patch modifies the toggle_colorize_event to fully remove coloring or 
fully recolorize the text rather than its existing behavior of 
disabling/enabling the coloring thread. It also ensures that a ColorDelegator 
instance exists in every editor window instead of only those where 
ispythonsource returns True.

Toggling also works in the shell, but turning highlighting off fails if you 
start typing again. This is due to issue13495.

The crashing of IDLE described by Tal is likely due to pythonw.exe and is 
addressed in issue13582.

--
keywords: +patch
nosy: +serwy
stage:  - patch review
versions: +Python 3.3
Added file: http://bugs.python.org/file26370/issue6858.patch

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



[issue7652] Merge C version of decimal into py3k.

2012-07-12 Thread Roundup Robot

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

New changeset afdb0e1a9dac by Stefan Krah in branch 'default':
Issue #7652: Clean up _mpd_qinvroot() and mark it LIBMPDEC_ONLY. Use the
http://hg.python.org/cpython/rev/afdb0e1a9dac

--

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



[issue7652] Merge C version of decimal into py3k.

2012-07-12 Thread Stefan Krah

Stefan Krah stefan-use...@bytereef.org added the comment:

I switched the algorithm in mpd_qsqrt() to the one from decimal.py.
Previously the square root was calculated in terms of 1/invsqrt(x).

Curiously enough this scheme _always_ seems to produce exact results
when expected, but I don't have a proof. I remember I left this in because the 
specification gives some leeway with respect to exact
results:


Square-root can also be calculated by using the power operation (with a second 
operand of 0.5). The result in that case will not be exact in most cases, and 
may not be correctly rounded.


Anyway, the algorithm from decimal.py gives the desired guarantees
and is also faster.


Since we're almost in beta-2 stage, would someone be able to do a
post commit review of mpd_qsqrt()? It should be a direct translation
from the function in decimal.py.

--

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



[issue15336] Argparse required arguments incorrectly displayed as optional arguments

2012-07-12 Thread Raymond Hettinger

New submission from Raymond Hettinger raymond.hettin...@gmail.com:

In this script, '-x' is required argument:
--
import argparse
p = argparse.ArgumentParser()
p.add_argument('-x', required=True)
p.print_help()

However, the automatically generated help shows it as optional:
---
usage: ap_demo.py [-h] -x X

optional arguments:
  -h, --help  show this help message and exit
  -x X

--
components: Library (Lib)
messages: 165331
nosy: rhettinger
priority: normal
severity: normal
status: open
title: Argparse required arguments incorrectly displayed as optional arguments
type: behavior
versions: Python 2.7, Python 3.2, Python 3.3

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



[issue15337] The cmd module incorrectly lists help as an undocument command

2012-07-12 Thread Raymond Hettinger

New submission from Raymond Hettinger raymond.hettin...@gmail.com:

The following minimal script:
-
import cmd
class C(cmd.Cmd): pass
C().cmdloop()

Creates the following help display:
---
(Cmd) help

Undocumented commands:
==
help

For people who are consistently documenting their other commands, it is 
annoying to have anything at all listed in the undocumented section.  So, 
help should have it's own default help message.

--
components: Library (Lib)
keywords: easy
messages: 165332
nosy: rhettinger
priority: normal
severity: normal
status: open
title: The cmd module incorrectly lists help as an undocument command
type: behavior
versions: Python 2.7, Python 3.2, Python 3.3

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



[issue15338] test_UNC_path failure in test_import

2012-07-12 Thread Antoine Pitrou

New submission from Antoine Pitrou pit...@free.fr:

On the Win64 buildbot, trying to access an UNC path raises PermissionError, 
which makes a test fail:

==
ERROR: test_UNC_path (test.test_import.PathsTests)
--
Traceback (most recent call last):
  File D:\buildbot.python.org\3.x.kloth-win64\build\lib\test\test_import.py, 
line 469, in test_UNC_path
os.listdir(unc)
PermissionError: [Error 5] Access is denied: 
'hades\\D$\\buildbot.python.org\\3.x.kloth-win64\\build\\build\\test_python_3612\\@test_3612_tmp\\*.*'


If this is expected or normal, maybe we should simply skip the test when the 
listdir() call above fails.

--
components: Library (Lib), Tests, Windows
messages: 165333
nosy: brian.curtin, jeremy.kloth, pitrou, tim.golden
priority: normal
severity: normal
status: open
title: test_UNC_path failure in test_import
type: behavior
versions: Python 2.7, Python 3.2, Python 3.3

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



[issue15338] test_UNC_path failure in test_import

2012-07-12 Thread Antoine Pitrou

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

Example URL for the aforementioned failure:

http://buildbot.python.org/all/builders/AMD64%20Windows7%20SP1%203.x/builds/282/steps/test/logs/stdio

--

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



[issue9867] Interrupted system calls are not retried

2012-07-12 Thread Daniel Neuhäuser

Changes by Daniel Neuhäuser dasdas...@googlemail.com:


--
nosy: +DasIch

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



[issue9867] Interrupted system calls are not retried

2012-07-12 Thread Antoine Pitrou

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

This has been fixed in issue #10956 (Python 3 and the io module) and issue 
#12268 (Python 2's file objects).

--
components: +Interpreter Core
resolution:  - out of date
status: open - closed
versions:  -Python 3.1

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



[issue9867] Interrupted system calls are not retried

2012-07-12 Thread Antoine Pitrou

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


--
resolution: out of date - duplicate
superseder:  - file readline, readlines  readall methods can lose data on 
EINTR
versions:  -Python 3.2, Python 3.3

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



[issue15339] document the threading facts of life in Python

2012-07-12 Thread Chris Jerdonek

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

I think it would be helpful if the Python documentation included certain 
high-level information about multi-threading in Python.

At minimum, I think it would help for the documentation to provide a definition 
that can be linked to of what it means when some part of the Python 
documentation says something is thread-safe.  In particular, such a 
definition could clarify that this is different from being atomic.  This might 
best be addressed by an entry in the glossary for the term thread-safe.
  
Other documentation possibilities include stating what guarantees one should or 
should not expect regarding thread-safety, both within and across 
implementations, and providing centralized guidance on how to approach 
multi-threaded programming in Python.  A HOWTO is one possibility for 
addressing these other possibilities.

This issue stems from the discussion in issue 15329, which is more specific.

--
assignee: docs@python
components: Documentation
messages: 165336
nosy: cjerdonek, docs@python
priority: normal
severity: normal
status: open
title: document the threading facts of life in Python

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



[issue15329] clarify which deque methods are thread-safe

2012-07-12 Thread Chris Jerdonek

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

I created issue 15339 to document the multi-threading facts of life in Python 
(independent of any particular module or package, including this one), along 
the lines suggested by Raymond.

--

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



[issue15339] document the threading facts of life in Python

2012-07-12 Thread Antoine Pitrou

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

This sounds like a good idea. Either a HOWTO or a FAQ would sound appropriate.

--
nosy: +pitrou
versions: +Python 2.7, Python 3.2, Python 3.3

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



[issue7652] Merge C version of decimal into py3k.

2012-07-12 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc amaur...@gmail.com added the comment:

I compared both implementations, and they are the same.

I noticed that on line 7537, the call to mpd_qshiftl() may goto 
malloc_error;.  I think there is a memory leak in this case, mpd_del(c) and 
2 others lines are skipped.

--

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



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

2012-07-12 Thread Ian Wienand

New submission from Ian Wienand i...@wienand.org:

Hi,

Lib/random.py has a fallback if os.urandom() returns NotImplementedError

---
from os import urandom as _urandom
...
   def seed(self, a=None):
if a is None:
try:
a = long(_hexlify(_urandom(16)), 16)
except NotImplementedError:
import time
a = long(time.time() * 256) # use fractional seconds
---

In 2.6, this is indeed what happens in Lib/os.py where import urandom from os 
gets [2]:

---
if not _exists(urandom):
def urandom(n):
...
  try:
_urandomfd = open(/dev/urandom, O_RDONLY)
except (OSError, IOError):
raise NotImplementedError(/dev/urandom (or equivalent) not found)
---

however, in 2.7, things have shuffled around as a result of issue Issue #13703 
and now _PyOS_URandom will return an OSError if it can't find /dev/urandom [3].

This means if you import random without /dev/urandom available it crashes 
trying to seed

I'm not sure if this is intentional?  One easy solution would be to catch 
OSError in random.py and fall back then too

[1] http://hg.python.org/cpython/file/70274d53c1dd/Python/random.c#l227
[2] http://hg.python.org/cpython/file/9f8771e09052/Lib/os.py#l746
[3] http://hg.python.org/cpython/file/70274d53c1dd/Lib/random.py#l111

--
components: Library (Lib)
messages: 165340
nosy: iwienand
priority: normal
severity: normal
status: open
title: OSError with import random when /dev/urandom doesn't exist (regression 
from 2.6)
versions: Python 2.7

___
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



[issue7652] Merge C version of decimal into py3k.

2012-07-12 Thread Stefan Krah

Stefan Krah stefan-use...@bytereef.org added the comment:

Thanks, Amaury! -- goto malloc_error should not leak, because there's always
a jump to the out label in line 7563.

I use this idiom a lot ever since I saw it in several places in the Linux
kernel. Of course it's a matter of taste.

--

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



[issue15341] Cplex and python

2012-07-12 Thread moras moorshed

New submission from moras moorshed moorshe...@yahoo.com:

Im beginner with python, and I want to connect python to Cplex, IBM optimizer, 
I installed the python on this path:
'C:\Program Files\IBM\ILOG\CPLEX_Studio123\cplex\python\x86_win32\cplex'
but when i want to create new file using cplex.Cplex() it gives me this error:
AttributeError: 'module' object has no attribute 'cplex'

so what is wrong?
please help me.

--
components: Library (Lib)
messages: 165342
nosy: moorshed
priority: normal
severity: normal
status: open
title: Cplex and python
versions: Python 3.2

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15341
___
___
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-07-12 Thread Matthias Klose

Matthias Klose d...@debian.org added the comment:

like other platform dependent files _sysconfigdata.py should be installed in 
plat-*

--

___
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



[issue15298] _sysconfigdata is generated in srcdir, not builddir

2012-07-12 Thread Antoine Pitrou

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

 like other platform dependent files _sysconfigdata.py should be installed in 
 plat-*

What are you talking about? plat-* files are only OS-specific, while
_sysconfigdata also depends on configure options and other stuff.

--

___
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



[issue15341] Cplex and python

2012-07-12 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc amaur...@gmail.com added the comment:

Hi, the bug tracker is not designed to get help.
Please ask questions on the python-list forum, or the comp.lang.python 
newsgroup.  There are many friendly people there...
Be ready to come with a short script showing the error.

--
nosy: +amaury.forgeotdarc
resolution:  - invalid
status: open - closed

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



[issue4832] idle filename extension

2012-07-12 Thread Ned Deily

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

Terry, are you planning to commit this?  If not, I can do it. It would be good 
to get this into 3.3.0b2 since it does fix an important usability issue.

--

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



[issue4832] idle filename extension

2012-07-12 Thread Terry J. Reedy

Terry J. Reedy tjre...@udel.edu added the comment:

I agree. Go ahead. But what do you think of applying to 2.7 and or 3.2?

I want to add a sentence to Idle help, which I want to edit for the tooltips 
issue also. But that is not a rush.

--

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



[issue15342] os.path.join behavior

2012-07-12 Thread Pan Yongzhi

New submission from Pan Yongzhi fossi...@users.sourceforge.net:

I am constructing a source directory argument to rsync. It has to end with 
slash due to rsync behavior. I use:

os.path.join('/src/dir', os.path.sep)

And run it and realized the source directory becomes '/'. Luckily it is not the 
destination.

Why should join discard all previous path components if any component is an 
absoulute path? This is such a surprise and renders this function useless.

--
messages: 165348
nosy: fossilet
priority: normal
severity: normal
status: open
title: os.path.join behavior
type: behavior
versions: Python 2.7

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



[issue15320] thread-safety issue in regrtest.main()

2012-07-12 Thread Chris Jerdonek

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

Here is another patch -- this one making no implementation assumptions about 
thread-safety or atomicity.

--
Added file: http://bugs.python.org/file26371/issue-15320-3.patch

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



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

2012-07-12 Thread Eli Bendersky

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

Thanks, this looks much better. I've reviewed the _4 patch with some minor 
comments.

--

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



[issue15336] Argparse required arguments incorrectly displayed as optional arguments

2012-07-12 Thread Ezio Melotti

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


--
nosy: +bethard, ezio.melotti
stage:  - needs patch

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



[issue10614] ZipFile: add a filename_encoding argument

2012-07-12 Thread umedoblock

umedoblock umedobl...@gmail.com added the comment:

I fixed this problem.
I make new methos _decode_filename().

--
keywords: +patch
nosy: +umedoblock
Added file: http://bugs.python.org/file26372/zipfile.patch

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



[issue15343] pydoc -w package write out page with empty package contents section

2012-07-12 Thread Christopher the Magnificent

New submission from Christopher the Magnificent 
ultimate.mac.fana...@gmail.com:

Let there be a folder testpkg contained in $SOME_DIR with three empty files: 
__init__.py, bob.py, and sally.py

If I run pydoc3.2 -w testpkg inside $SOME_DIR, it will output the file 
$SOME_DIR/testpkg.html

In testpkg.html there will be a section called Package Contents with two 
links named bob and sally.

If I instead run pydoc3.3 -w testpkg inside $SOME_DIR, it will still output 
the file $SOME_DIR/testpkg.html

Only this time, in testpkg.html the section called Package Contents will be 
empty when there should be links named bob and sally

--
messages: 165352
nosy: christopherthemagnificent
priority: normal
severity: normal
status: open
title: pydoc -w package write out page with empty package contents section
type: behavior
versions: Python 3.3

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



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

2012-07-12 Thread Christopher the Magnificent

Changes by Christopher the Magnificent ultimate.mac.fana...@gmail.com:


--
title: pydoc -w package writes out page with empty package contents 
section - pydoc -w package writes out page with empty Package Contents 
section

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



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

2012-07-12 Thread Christopher the Magnificent

Changes by Christopher the Magnificent ultimate.mac.fana...@gmail.com:


--
title: pydoc -w package write out page with empty package contents 
section - pydoc -w package writes out page with empty package contents 
section

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



[issue15296] Minidom can't create ASCII representation

2012-07-12 Thread Eli Bendersky

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

Serhiy - why did you remove that documentation bit?

--

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



[issue15344] devinabox: failure when running make_a_box multiple times

2012-07-12 Thread Eric Snow

New submission from Eric Snow ericsnowcurren...@gmail.com:

When running make_a_box.py:

Fetching Mercurial ...
make_a_box.py:197: ResourceWarning: unclosed socket.socket object, fd=3, 
family=2, type=1, proto=6
  file_url = self._download_url()
Traceback (most recent call last):
  File make_a_box.py, line 323, in module
ins.create()
  File make_a_box.py, line 219, in create
self._create_mercurial()
  File make_a_box.py, line 200, in _create_mercurial
with open(os.path.join(self.directory, file_name), 'wb') as file:
IsADirectoryError: [Errno 21] Is a directory: 'Mercurial/'

Apparently running it more than once requires that you delete some things first.

--
messages: 165354
nosy: brett.cannon, eric.snow
priority: normal
severity: normal
status: open
title: devinabox: failure when running make_a_box multiple times
type: behavior

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



[issue15344] devinabox: failure when running make_a_box multiple times

2012-07-12 Thread Eric Snow

Eric Snow ericsnowcurren...@gmail.com added the comment:

I'm re-running it from a clean directory one more time just to make sure.

--

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



[issue14790] use packaging in setup.py

2012-07-12 Thread Eli Bendersky

Changes by Eli Bendersky eli...@gmail.com:


--
priority:  - deferred blocker

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



[issue14600] Change ImportError reference handling, naming

2012-07-12 Thread Eli Bendersky

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

Eric: your note appears to be fixed in the code.
Can this issue be closed?

--
nosy: +eli.bendersky

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



[issue13238] Add shell command helpers to subprocess module

2012-07-12 Thread Eric Snow

Changes by Eric Snow ericsnowcurren...@gmail.com:


--
nosy: +eric.snow

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