[issue15216] Support setting the encoding on a text stream after creation

2012-08-06 Thread Nick Coghlan

Nick Coghlan added the comment:

The reason I marked this as a release blocker for 3.4 is because it's a key 
piece of functionality for writing command line apps which accept an encoding 
argument. I'll use "high" instead.

An interesting proposal was posted to the python-dev thread [1]: using 
self.detach() and self.__init__() to reinitialise the wrapper *in-place*.

With that approach, the pure Python version of set_encoding() would look 
something like this:

_sentinel = object()
def set_encoding(self, encoding=_sentinel, errors=_sentinel):
if encoding is _sentinel:
encoding = self.encoding
if errors is _sentinel:
errors = self.errors
self.__init__(self.detach(),
  encoding, errors,
  self._line_buffering,
  self._readnl,
  self._write_through)

(The pure Python version currently has no self._write_through attribute - see 
#15571)

Note that this approach addresses my main concern with the use of detach() for 
this: because the wrapper is reinitialised in place, old references (such as 
the sys.__std*__ attributes) will also see the change.

Yes, such a function would need a nice clear warning to say "Calling this may 
cause data loss or corruption if used without due care and attention", but it 
should *work*. (Without automatic garbage collection, the C implementation 
would need an explicit internal "reinitialise" function rather than being able 
to just use the existing init function directly, but that shouldn't be a major 
problem).

[1] http://mail.python.org/pipermail/python-ideas/2012-August/015898.html

--
priority: normal -> high

___
Python tracker 

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



[issue15571] Python version of TextIOWrapper ignores "write_through" arg

2012-08-06 Thread Nick Coghlan

New submission from Nick Coghlan:

In discussing #15216, I noticed that the write_through parameter is completely 
unused in the Python implementation of TextIOWrapper.

That also means we have a hole in the test coverage: there is no test that is 
run on both the C and Python versions to ensure that the data is being written 
directly through to the underlying buffer (e.g. by passing in a mock buffer 
object).

--
components: Library (Lib)
messages: 167603
nosy: ncoghlan
priority: release blocker
severity: normal
stage: test needed
status: open
title: Python version of TextIOWrapper ignores "write_through" arg
type: behavior
versions: Python 3.3

___
Python tracker 

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



[issue15570] email.header.decode_header parses differently

2012-08-06 Thread Dmitry Dvoinikov

New submission from Dmitry Dvoinikov:

The following script
---
import email.header
print(email.header.decode_header("foo =?windows-1251?Q?bar?="))
---
produces

[(b'foo', None), (b'bar', 'windows-1251')]

in Python 3.2 but

[(b'foo ', None), (b'bar', 'windows-1251')]

in Python 3.3.0b1

--
components: Library (Lib)
messages: 167602
nosy: ddvoinikov
priority: normal
severity: normal
status: open
title: email.header.decode_header parses differently
type: behavior
versions: Python 3.3

___
Python tracker 

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



[issue15122] Add an option to always rewrite single-file mailboxes in-place.

2012-08-06 Thread Petri Lehtinen

Petri Lehtinen added the comment:

Thinking about this again, I guess the original design rationale was not to 
prepare for crashes, but for the ease of implementation. It's not generally 
possible to rewrite the mailbox fully in-place, because the messages are not 
loaded into memory. If the order of messages changes, for example, a message 
can be overwritten in the mailbox file, and its contents need to be read 
afterwards.

Mutt copes with this by writing the changes to a temporary file, and then 
copying them over to the original file. This is what we should also be doing.

--

___
Python tracker 

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



[issue9890] Visual C++ Runtime Library Error is there a fix?

2012-08-06 Thread Roger Serwy

Roger Serwy added the comment:

Karen, thank you for your reply and your cooperation. This issue may 
take some time to resolve.

It looks like the error you are receiving has been addressed in 
issue11288. Can you check it out?

--

___
Python tracker 

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



[issue15216] Support setting the encoding on a text stream after creation

2012-08-06 Thread STINNER Victor

STINNER Victor added the comment:

> My implementation permits to change both (encoding, errors, encoding and 
> errors).

We may also add a set_errors() method:

def set_errors(self, errors):
   self.set_encoding(self.encoding, errors)

--

___
Python tracker 

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



[issue15216] Support setting the encoding on a text stream after creation

2012-08-06 Thread STINNER Victor

STINNER Victor added the comment:

> That will be fragile. A bit of prematurate input or output
> (for whatever reason) and your program breaks.

I agree that it is not the most pure solution, but sometimes practicality beats 
purity (rule #9) ;-) We can add an ugly big red warning in the doc ;-)

--

___
Python tracker 

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



[issue15216] Support setting the encoding on a text stream after creation

2012-08-06 Thread STINNER Victor

STINNER Victor added the comment:

Here is a Python implementation of TextIOWrapper.set_encoding().

The main limitation is that it is not possible to set the encoding on a 
non-seekable stream after the first read (if the read buffer is not empty, ie. 
if there are pending decoded characters).

+# flush read buffer, may require to seek backward in the underlying
+# file object
+if self._decoded_chars:
+if not self.seekable():
+raise UnsupportedOperation(
+"It is not possible to set the encoding "
+"of a non seekable file after the first read")
+assert self._snapshot is not None
+dec_flags, next_input = self._snapshot
+offset = self._decoded_chars_used - len(next_input)
+if offset:
+self.buffer.seek(offset, SEEK_CUR)

--

I don't have an use case for setting the encoding of sys.stdout/stderr after 
startup, but I would like to be able to control the *error handler* after the 
startup! My implementation permits to change both (encoding, errors, encoding 
and errors).

For example, Lib/test/regrtest.py uses the following function to force the 
backslashreplace error handler on sys.stdout. It changes the error handler to 
avoid UnicodeEncodeError when displaying the result of tests.

def replace_stdout():
"""Set stdout encoder error handler to backslashreplace (as stderr error
handler) to avoid UnicodeEncodeError when printing a traceback"""
import atexit

stdout = sys.stdout
sys.stdout = open(stdout.fileno(), 'w',
encoding=stdout.encoding,
errors="backslashreplace",
closefd=False,
newline='\n')

def restore_stdout():
sys.stdout.close()
sys.stdout = stdout
atexit.register(restore_stdout)

The doctest module uses another trick to change the error handler:

save_stdout = sys.stdout
if out is None:
encoding = save_stdout.encoding
if encoding is None or encoding.lower() == 'utf-8':
out = save_stdout.write
else:
# Use backslashreplace error handling on write
def out(s):
s = str(s.encode(encoding, 'backslashreplace'), encoding)
save_stdout.write(s)
sys.stdout = self._fakeout

--
keywords: +patch
nosy: +haypo
Added file: http://bugs.python.org/file26715/set_encoding.patch

___
Python tracker 

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



[issue15566] tarfile.TarInfo.frombuf documentation is out of date

2012-08-06 Thread Meador Inge

Changes by Meador Inge :


--
stage:  -> needs patch
type:  -> behavior

___
Python tracker 

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



[issue15424] __sizeof__ of array should include size of items

2012-08-06 Thread Meador Inge

Meador Inge added the comment:

I left some commits in Rietveld.  Otherwise, looks OK.

--
assignee:  -> meador.inge

___
Python tracker 

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



[issue14182] collections.Counter equality test thrown-off by zero counts

2012-08-06 Thread Meador Inge

Meador Inge added the comment:

Raymond, Stephen's analysis seems correct.  Are we missing something or can 
this issue be closed?

--
nosy: +meador.inge

___
Python tracker 

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



[issue15569] Dev Guide format-only roles

2012-08-06 Thread Chris Jerdonek

New submission from Chris Jerdonek:

After the section describing roles that create cross-references to C-language 
constructs, the Dev Guide says this, "The following roles don’t do anything 
special except formatting the text in a different style."

http://hg.python.org/devguide/file/f518f23d06d5/documenting.rst#l984

However, some of the roles following in that section do do special things other 
than formatting.  For example--

envvar
An environment variable. Index entries are generated.

keyword
The name of a Python keyword. Using this role will generate a link to the 
documentation of the keyword

The description should be changed, or better yet, the roles that do something 
special should be moved to a different section.

--
components: Devguide
keywords: easy
messages: 167594
nosy: cjerdonek, ezio.melotti
priority: normal
severity: normal
status: open
title: Dev Guide format-only roles

___
Python tracker 

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



[issue15216] Support setting the encoding on a text stream after creation

2012-08-06 Thread INADA Naoki

Changes by INADA Naoki :


--
nosy: +naoki

___
Python tracker 

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



[issue15568] yield from missed StopIteration raised from iterator instead of getting value

2012-08-06 Thread Roundup Robot

Roundup Robot added the comment:

New changeset ee55f8e4fb50 by Benjamin Peterson in branch 'default':
fix yield from return value on custom iterators (closes #15568)
http://hg.python.org/cpython/rev/ee55f8e4fb50

--
nosy: +python-dev
resolution:  -> fixed
stage:  -> committed/rejected
status: open -> closed

___
Python tracker 

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



[issue15543] central documentation for 'universal newlines'

2012-08-06 Thread Chris Jerdonek

Chris Jerdonek added the comment:

Updating patch to current tip.

--
Added file: http://bugs.python.org/file26714/issue-15543-2.patch

___
Python tracker 

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



[issue15568] yield from missed StopIteration raised from iterator instead of getting value

2012-08-06 Thread Meador Inge

Changes by Meador Inge :


--
nosy: +meador.inge

___
Python tracker 

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



[issue15568] yield from missed StopIteration raised from iterator instead of getting value

2012-08-06 Thread Alex Gaynor

Changes by Alex Gaynor :


--
nosy: +alex

___
Python tracker 

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



[issue15568] yield from missed StopIteration raised from iterator instead of getting value

2012-08-06 Thread Dino Viehland

New submission from Dino Viehland:

When implementing an iterable object by hand, and raising StopIteration with a 
value, the value is not provided as the result of the yield from expression.  
This differs from the behavior in the "Formal Semantics" section.  Here's an 
example of how it differs from working with a normal generator:

class C:
def __iter__(self): return self
def __next__(self):
raise StopIteration(100)


def g():
if False:
yield 100
return 100

def f(val):
x = yield from val
print('x', x)

list(f(C()))
list(f(g()))


This makes it impossible to wrap a generator in a non-generator and get the 
same behavior.  The issue seems to be that the yield from implementation calls 
PyIter_Next which clears the StopIteration exception rather than say directly 
doing something like "(*iter->ob_type->tp_iternext)(iter);".

--
components: Interpreter Core
messages: 167591
nosy: dino.viehland
priority: normal
severity: normal
status: open
title: yield from missed StopIteration raised from iterator instead of getting 
value
type: behavior
versions: Python 3.3

___
Python tracker 

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



[issue15424] __sizeof__ of array should include size of items

2012-08-06 Thread Ludwig Hähne

Ludwig Hähne added the comment:

Serhiy, the tests now explicitly check the base size of the array.

I'm not sure if I got the base size compution right (only checked on 32bit 
Linux). Could you check that the struct definition in the test makes sense and 
matches the C arrayobject definition? Thanks, Ludwig

--
Added file: http://bugs.python.org/file26713/array_sizeof_v4.patch

___
Python tracker 

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



[issue15437] Merge Doc/ACKS.txt names into Misc/ACKS

2012-08-06 Thread Chris Jerdonek

Chris Jerdonek added the comment:

For completeness, I am attaching the modified version of the script that was 
used to generate the latest output.

--
Added file: http://bugs.python.org/file26712/merge-acks-2.py

___
Python tracker 

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



[issue15437] Merge Doc/ACKS.txt names into Misc/ACKS

2012-08-06 Thread Chris Jerdonek

Chris Jerdonek added the comment:

Is this issue awaiting feedback from anyone else before it can proceed further? 
 (Just this issue and not issue 15439 to make any adjustments to the docs.)

I am attaching an updated diff after generating the script output again against 
the tip (modified to prefix matching last names with '>>> ').

--
Added file: http://bugs.python.org/file26711/issue-15437-script-output-2.patch

___
Python tracker 

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



[issue15471] importlib's __import__() argument style nit

2012-08-06 Thread Barry A. Warsaw

Barry A. Warsaw added the comment:

On Aug 05, 2012, at 11:50 PM, Brett Cannon wrote:

>I went with Barry's approach but made it compatible with PEP 8 (bad, FLUFL;
>no unneeded parens!).

I actually think I picked that up from the big guy himself, but I could be
misremembering. ;)

--

___
Python tracker 

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



[issue15163] pydoc displays __loader__ as module data

2012-08-06 Thread Brett Cannon

Brett Cannon added the comment:

Don't worry about it, Eric. while the idea of grouping by concept is laudable, 
when the list is that long it's best to just alphabetize to make diffs easier 
to read.

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

___
Python tracker 

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



[issue15163] pydoc displays __loader__ as module data

2012-08-06 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 6a27b9f37b05 by Brett Cannon in branch 'default':
Issue #15163: Pydoc shouldn't show __loader__ as a part of a module's
http://hg.python.org/cpython/rev/6a27b9f37b05

--
nosy: +python-dev

___
Python tracker 

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



[issue15561] update subprocess docs to reference io.TextIOWrapper

2012-08-06 Thread Chris Jerdonek

Chris Jerdonek added the comment:

Victor, would you be able to take a look at this minor documentation patch?  It 
incorporates the change that you suggested we make on python-dev.

--

___
Python tracker 

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



[issue15163] pydoc displays __loader__ as module data

2012-08-06 Thread Éric Araujo

Éric Araujo added the comment:

Sorry for the annoyance.  I changed the order (and did not choose to 
alphabetize) because I thought it was easier to read with names grouped by 
topic, as I said in an earlier message, but please do as you think best.

--

___
Python tracker 

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



[issue15163] pydoc displays __loader__ as module data

2012-08-06 Thread Brett Cannon

Brett Cannon added the comment:

I will alphabetize as part of the patch (I had the same issue myself of 
verifying the change).

--
assignee: georg.brandl -> brett.cannon

___
Python tracker 

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



[issue9890] Visual C++ Runtime Library Error is there a fix?

2012-08-06 Thread Karen KarenL

Karen KarenL added the comment:

Additional info on error in python 3.2
I am using 32 bit Win 7 enterprise SP1. I download and installed python-3.2.msi 
from python.org I than start python pythonw from window menu just like any 
other program. Running python command line also failed, and this is the error 
message:
Fatal Python error: Py_Initialize: unable to load the file system codec
LookupError: no codec search functions registered: can't find encoding

This application has requested the runtime to terminate it in an unusual way.
Please contact the application's support team for more information.

I have uninstalled python 26, 27, 32. Then reinstalled 32. Problem is still 
presents. I also have cygwin on my system. Python 26 and 27 worked without any 
issue. Python 26 that comes with cywin worked as well. I just updated my cygwin 
to get python 3.2 binaries from cygwin's dist. It is working.
Let me know if there is anything I can do to help.

Karen

--

___
Python tracker 

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



[issue15163] pydoc displays __loader__ as module data

2012-08-06 Thread Georg Brandl

Georg Brandl added the comment:

Great to review such patches, where I have to take out a notepad and write the 
names down to check a 1-item addition.

But it seems it does what's on the label, so go ahead.

--

___
Python tracker 

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



[issue15545] sqlite3.Connection.iterdump() does not work with row_factory = sqlite3.Row

2012-08-06 Thread Peter Otten

Peter Otten added the comment:

Here's a minimal fix that modifies the sql in sqlite3.dump._iterdump() to sort 
the tables by name. It is then no longer necessary to sort the resultset in 
Python for the unit tests to pass.

--
keywords: +patch
nosy: +peter.otten
Added file: http://bugs.python.org/file26710/iterdump.diff

___
Python tracker 

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



[issue15471] importlib's __import__() argument style nit

2012-08-06 Thread Brett Cannon

Changes by Brett Cannon :


--
resolution:  -> fixed
status: open -> closed

___
Python tracker 

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



[issue15471] importlib's __import__() argument style nit

2012-08-06 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 4240282a9f4a by Brett Cannon in branch 'default':
Issue #15471: Don't use mutable object as default values for the
http://hg.python.org/cpython/rev/4240282a9f4a

--
nosy: +python-dev

___
Python tracker 

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



[issue15163] pydoc displays __loader__ as module data

2012-08-06 Thread Brett Cannon

Brett Cannon added the comment:

Georg, is it okay if I commit this on Eric's behalf for 3.3?

--
assignee:  -> georg.brandl
nosy: +georg.brandl
priority: low -> release blocker

___
Python tracker 

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



[issue9890] Visual C++ Runtime Library Error is there a fix?

2012-08-06 Thread Roger Serwy

Roger Serwy added the comment:

What are the precise steps you are taking to cause this error?

What version of Windows are you using? Is it 32-bit?

--

___
Python tracker 

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



[issue15554] correct and clarify str.splitlines() documentation

2012-08-06 Thread R. David Murray

R. David Murray added the comment:

Thanks for sticking with it.

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

___
Python tracker 

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



[issue15554] correct and clarify str.splitlines() documentation

2012-08-06 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 768b188262e7 by R David Murray in branch '3.2':
#15554: clarify splitlines/split differences.
http://hg.python.org/cpython/rev/768b188262e7

New changeset 0d6eea2330d0 by R David Murray in branch 'default':
Merge #15554: clarify splitlines/split differences.
http://hg.python.org/cpython/rev/0d6eea2330d0

New changeset e057a7d18fa2 by R David Murray in branch '2.7':
#15554: clarify splitlines/split differences.
http://hg.python.org/cpython/rev/e057a7d18fa2

--
nosy: +python-dev

___
Python tracker 

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



[issue9890] Visual C++ Runtime Library Error is there a fix?

2012-08-06 Thread Karen KarenL

Karen KarenL added the comment:

I just run into this problem. I am running python 3.2, but I do have python 26 
and python 27 install on the same computer.

--
nosy: +Karen.KarenL
status: pending -> open

___
Python tracker 

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



[issue15554] correct and clarify str.splitlines() documentation

2012-08-06 Thread Chris Jerdonek

Chris Jerdonek added the comment:

Here you go.  Thanks again.

--
Added file: http://bugs.python.org/file26709/issue-15554-4.patch

___
Python tracker 

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



[issue13072] Getting a buffer from a Unicode array uses invalid format

2012-08-06 Thread Stefan Krah

Stefan Krah added the comment:

I have a patch already for the unknown format codes in memoryview.
Currently fighting (as usual) with the case explosions in the tests.
I think I can have a full patch by next weekend.

--

___
Python tracker 

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



[issue15554] correct and clarify str.splitlines() documentation

2012-08-06 Thread R. David Murray

R. David Murray added the comment:

Good point.  Difference paragraph after the example would be best, I think.

--

___
Python tracker 

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



[issue15554] correct and clarify str.splitlines() documentation

2012-08-06 Thread Chris Jerdonek

Chris Jerdonek added the comment:

> I think the problem really is that 'split' has such radically different 
> behavior when given an argument as opposed to when it isn't.

Yep, the split() documentation is much more involved because of that.

> Please move the keeplines discussion back up into the initial paragraph, and 
> then I think we'll be good to go.

Sounds good.  Would you also like me to move the example before the paragraph 
about differences, or should I leave the example at the end?

Mention of the example may flow better after the keepends discussion, because 
the example is more about keepends rather than about the differences with 
split().  But it can go either way.

--

___
Python tracker 

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



[issue15553] Segfault in test_6_daemon_threads() of test_threading, on Mac OS X Lion

2012-08-06 Thread Ronald Oussoren

Ronald Oussoren added the comment:

The test passes fine on OSX 10.8 (even when running the threading test in a 
loop). This might be because a platform bug is fixed in OSX 10.8, or because 
the crash happens due to a race condition of some sort (either in Python itself 
or the system).

This could be related to #3863 (this test is skipped on a number of platforms 
because of that issue)

--

___
Python tracker 

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



[issue15163] pydoc displays __loader__ as module data

2012-08-06 Thread Éric Araujo

Éric Araujo added the comment:

Now I have hardware issues, so no.

--
assignee: eric.araujo -> 

___
Python tracker 

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



[issue13072] Getting a buffer from a Unicode array uses invalid format

2012-08-06 Thread Nick Coghlan

Nick Coghlan added the comment:

I think Victor's patch is a good solution to killing the 'u' and 'w' exports in 
3.4, but we need to restore some tolerance for unknown format codes to 
memoryview in 3.3 regardless.

--

___
Python tracker 

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



[issue14225] _cursesmodule compile error in OS X 32-bit-only installer build

2012-08-06 Thread Ned Deily

Ned Deily added the comment:

P.P.S. I've updated the OS X installers as of 3.3.0b2 to build and link with a 
local copy of ncurses 5.9 rather than older Apple-supplied ones.  test_curses 
now passes.

--

___
Python tracker 

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



[issue15037] curses.unget_wch and test_curses fail when linked with ncurses 5.7 and earlier

2012-08-06 Thread Ned Deily

Ned Deily added the comment:

I've updated the OS X installers to build and link with a local copy of ncurses 
5.9 rather than older Apple-supplied ones, thus avoiding the library bug.  
test_curses now passes for them.

--

___
Python tracker 

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



[issue15037] curses.unget_wch and test_curses fail when linked with ncurses 5.7 and earlier

2012-08-06 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 8282e4846e43 by Ned Deily in branch 'default':
Issue #15037: Build OS X installers with local copy of ncurses 5.9 libraries
http://hg.python.org/cpython/rev/8282e4846e43

--
nosy: +python-dev

___
Python tracker 

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



[issue15565] pdb displays runt Exception strings

2012-08-06 Thread R. David Murray

R. David Murray added the comment:

As far as I can see it has been.  In both 2.7 and 3.3 I get:

rdmurray@hey:~/python/p33>./python somecode.py
> /home/rdmurray/python/p33/somecode.py(3)()
-> raise Exception('This is a message that contains a lot of characters and is 
very long indeed.')
(Pdb) n
Exception: This is a message that contains a lot of characters and is very long 
indeed.
> /home/rdmurray/python/p33/somecode.py(3)()
-> raise Exception('This is a message that contains a lot of characters and is 
very long indeed.')
(Pdb)

--
nosy: +r.david.murray
resolution:  -> out of date
stage:  -> committed/rejected
status: open -> closed

___
Python tracker 

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



[issue15564] cgi.FieldStorage should not call read_multi on files

2012-08-06 Thread R. David Murray

Changes by R. David Murray :


--
nosy: +r.david.murray

___
Python tracker 

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



[issue13072] Getting a buffer from a Unicode array uses invalid format

2012-08-06 Thread Stefan Krah

Stefan Krah added the comment:

> Did you see attached patch array_unicode_format.patch? It uses struct
> format "H" or "I" depending on the size of wchar_t.

I totally overlooked that. Given that memoryview can be fixed to
compare buffers with unknown formats, I don't have a strong opinion
on whether array's getbufferproc should alter the format codes of 'u'
and 'w' or not.

The only advantage for memoryview would be that tolist() etc.
would work. However, tolist() previously only worked for bytes,
so in this case raising an exception for 'u' and 'w' is not a
regression but an improvement. :)


If we're deprecating 'u' and 'w' anyway, the getbufferproc should
probably continue to return 'u' and 'w' until the removal of these
format codes.

--

___
Python tracker 

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



[issue15500] Python should support naming threads

2012-08-06 Thread R. David Murray

R. David Murray added the comment:

It is indeed the compatibility that is the worse issue.  The problem is what 
people have gotten used to and may have coded their applications to expect/deal 
with.  I agree with you that most people would *not* find it surprising to see 
the name reflected in the OS, but I don't think the convenience of that is 
worth introducing a potential backward incompatibility.

On the other hand, I think this might be an appropriate place to use a global 
control, so that getting thread names out to the OS would require adding just a 
single line of code to any given application.  I know of an application that 
does this.  It chose to implement it as a global change, and that makes sense 
to me.

--

___
Python tracker 

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



[issue15500] Python should support naming threads

2012-08-06 Thread R. David Murray

Changes by R. David Murray :


--
Removed message: http://bugs.python.org/msg167559

___
Python tracker 

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



[issue15500] Python should support naming threads

2012-08-06 Thread R. David Murray

R. David Murray added the comment:

It is indeed the compatibility that is the worse issue.  The problem is what 
people have gotten used to and may have coded their applications to expect/deal 
with. what people have gotten used to.  I agree with you that most people would 
*not* find it surprising to see the name reflect in the OS, but I don't think 
the convenience of that is worth introducing a potential backward 
incompatibility.

On the other hand, I think this might be an appropriate place to use a global 
control, so that getting thread names out to the OS would require adding just a 
single line of code to any given application.  I know of an application that 
does this.  It chose to implement it as a global change, and that makes sense 
to me.

--

___
Python tracker 

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



[issue15554] correct and clarify str.splitlines() documentation

2012-08-06 Thread R. David Murray

R. David Murray added the comment:

Ah, I read too quickly before.  But that expression "when a delimiter string 
*sep* is given" is hard to wrap ones head around in this context.  I think the 
problem really is that 'split' has such radically different behavior when given 
an argument as opposed to when it isn't.  I consider that a design flaw in 
split, and always have.  So, I suppose we can't do any better here because of 
that.

Please move the keeplines discussion back up into the initial paragraph, and 
then I think we'll be good to go.

--

___
Python tracker 

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



[issue15554] correct and clarify str.splitlines() documentation

2012-08-06 Thread R. David Murray

Changes by R. David Murray :


--
Removed message: http://bugs.python.org/msg167557

___
Python tracker 

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



[issue15554] correct and clarify str.splitlines() documentation

2012-08-06 Thread R. David Murray

R. David Murray added the comment:

Ah, I read too quickly before.  But that expression "when a delimiter string 
*sep* is given" is hard to wrap ones head around in this context.  I think the 
problem really is that 'split' has such radically different behavior when given 
an argument as opposed to when it isn't.  I consider that a design flaw in 
strip, and always have.  So, I suppose we can't do any better here because of 
that.

Please move the keeplines discussion back up into the initial paragraph, and 
then I think we'll be good to go.

--

___
Python tracker 

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



[issue15528] Better support for finalization with weakrefs

2012-08-06 Thread Richard Oudkerk

Richard Oudkerk added the comment:

> In _make_callback, I still think the default error reporting mechanism 
> should be kept. It can be improved separately.

New patch.  This time I have got rid of _make_callback, and just given __call__ 
an ignored optional argument.

--
Added file: http://bugs.python.org/file26708/finalize.patch

___
Python tracker 

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



[issue15464] ssl: add set_msg_callback function

2012-08-06 Thread Thiébaud Weksteen

Thiébaud Weksteen added the comment:

When I wrote this patch, I was focusing on a particular usage and the buffer 
was the only parameter that interested me. But you're right, the other 
parameters should be included. Which brings the following questions:

* write_p looks like a boolean, would it be appropriate to make it like that? 
Or keep it integer?
* version can be SSL2_VERSION , SSL3_VERSION or TLS1_VERSION. However, these 
constants are not used yet in _ssl. Should they be mapped to the current ones 
(with the tricky exception of PROTOCOL_SSLv23)?
* content_type could just be passed as a regular integer.

Thanks

--

___
Python tracker 

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



[issue10182] match_start truncates large values

2012-08-06 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
keywords: +easy

___
Python tracker 

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



[issue10182] match_start truncates large values

2012-08-06 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
components: +Library (Lib)
stage:  -> needs patch
type:  -> behavior

___
Python tracker 

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



[issue10182] match_start truncates large values

2012-08-06 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
nosy: +storchaka
versions: +Python 3.3 -Python 3.1

___
Python tracker 

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



[issue15567] threading.py contains undefined name in self-test code

2012-08-06 Thread Stefan Behnel

New submission from Stefan Behnel:

Line 912 of threading.py, Py2.7, reads:

self.queue = deque()

"deque" hasn't been imported.

--
components: Library (Lib)
messages: 167554
nosy: scoder
priority: normal
severity: normal
status: open
title: threading.py contains undefined name in self-test code
type: behavior
versions: Python 2.7

___
Python tracker 

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



[issue15566] tarfile.TarInfo.frombuf documentation is out of date

2012-08-06 Thread Sebastian Ramacher

New submission from Sebastian Ramacher:

tarfile.TarInfo.frombuf has gained two more parameters: encoding and errors. 
The documentation of frombuf claims that the only parameter is buf, which is 
not true anymore.

--
assignee: docs@python
components: Documentation
messages: 167553
nosy: docs@python, sebastinas
priority: normal
severity: normal
status: open
title: tarfile.TarInfo.frombuf documentation is out of date
versions: Python 3.2, Python 3.3

___
Python tracker 

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



[issue15500] Python should support naming threads

2012-08-06 Thread Attila Nagy

Attila Nagy added the comment:

"I don't think this should be done by default as it will break people's 
expectations and, perhaps worse, compatibility."
I won't mind another thread naming API, if somebody does this. :)
But personally I expected python to name my threads (and if the OS supports it, 
on that level), I was actually surprised to see that it doesn't, mostly because 
I remembered a patch for FreeBSD, which did this years ago, so I thought it has 
been merged into mainline since then.

--

___
Python tracker 

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



[issue13072] Getting a buffer from a Unicode array uses invalid format

2012-08-06 Thread STINNER Victor

STINNER Victor added the comment:

> memoryview is not aware of the 'u' format code, since it's not part of
> the struct syntax and the PEP-3118 proposition 'u' -> UCS2, 'w' -> UCS4
> wasn't considered useful.

Did you see attached patch array_unicode_format.patch? It uses struct
format "H" or "I" depending on the size of wchar_t.

--

___
Python tracker 

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



[issue15565] pdb displays runt Exception strings

2012-08-06 Thread Paul

New submission from Paul:

In Python 2.6, pdb doesn't show exception strings properly:

#somecode.py
import pdb
pdb.set_trace()
raise Exception('This is a message that contains a lot of characters and is 
very long indeed.')

#terminal
> somecode.py
-> raise Exception('This is a message that contains a lot of characters and is 
very long indeed.')
(Pdb) n
Exception: Exceptio...ndeed.',)

The pdb code assumes that sys.exc_info()[1] is a string. In fact it's an 
Exception instance.

The solution I found was to use str()

#pdb.py line 186
print >>self.stdout, exc_type_name + ':', _saferepr(str(exc_value))

This may have been fixed already but I couldn't find any reference to it.

--
components: None
messages: 167550
nosy: powlo
priority: normal
severity: normal
status: open
title: pdb displays runt Exception strings
type: behavior
versions: Python 2.6

___
Python tracker 

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



[issue13072] Getting a buffer from a Unicode array uses invalid format

2012-08-06 Thread Nick Coghlan

Nick Coghlan added the comment:

Perhaps if memoryview doesn't understand the format code, it can fall back on 
memcmp() if strcmp() indicates the format codes are the same?

Otherwise we're at risk of breaking backwards compatibility with more than just 
array('u').

Also, if it isn't already, the change to take format codes into a account in 
memoryview comparisons should be mentioned in the What's New porting section.

--

___
Python tracker 

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



[issue13072] Getting a buffer from a Unicode array uses invalid format

2012-08-06 Thread Stefan Krah

Stefan Krah added the comment:

Of course, if two formats *are* the same, it is possible to use
memcmp(). I'll work on a patch.

--

___
Python tracker 

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



[issue15564] cgi.FieldStorage should not call read_multi on files

2012-08-06 Thread patrick vrijlandt

New submission from patrick vrijlandt:

.mht is an archive format created by Microsoft IE 8 when saving a webpage. It 
is essentially a mime multipart message.

My problem occurred when I uploaded such a file to a cgi-based server. The 
posted data would be fed to cgi.FieldStorage. (I can't post the file 
unfortunately)

As it turns out, cgi.FieldStorage tries to recursively parse the postdata, 
thereby splitting up the uploaded file; this fails. However, this (automatic) 
recursive behaviour seems unwanted for an uploaded file.

My proposal is thus to adapt cgi.py (line number for Python 3.2), so that in 
FieldStorage.__init__, line 542, read_multi would not be invoked in this case.

Currently it says:

elif ctype[:10] == 'multipart/':
self.read_multi(environ, keep_blank_values, strict_parsing)

Change this to:

elif ctype[:10] == 'multipart/' and not self.filename: 
self.read_multi(environ, keep_blank_values, strict_parsing)

(I apologise for not submitting a test case. When trying to create it, it is 
either very complicated, or not easily recognizable as valid. Moreover, my 
server used a 3rd party software (bottlypy.org: bottle.py))

--
components: Library (Lib)
messages: 167548
nosy: patrick.vrijlandt
priority: normal
severity: normal
status: open
title: cgi.FieldStorage should not call read_multi on files
type: behavior
versions: Python 3.2

___
Python tracker 

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



[issue13072] Getting a buffer from a Unicode array uses invalid format

2012-08-06 Thread Stefan Krah

Stefan Krah added the comment:

Also, it was suggested that 'u' should be deprecated:

http://mail.python.org/pipermail/python-dev/2012-March/117392.html


Personally, I don't have an opinion on that; I don't use the 'u'
format code.


Nick, could you have a look at msg167545 and see if any action
should be taken?

--
nosy: +ncoghlan

___
Python tracker 

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



[issue13072] Getting a buffer from a Unicode array uses invalid format

2012-08-06 Thread Stefan Krah

Stefan Krah added the comment:

STINNER Victor  wrote:
> Hum, this issue is a regression from Python 3.2.
> 
> Python 3.2.3+ (3.2:243ad1a6f638+, Aug  4 2012, 01:36:41) 
> [GCC 4.6.3 20120306 (Red Hat 4.6.3-2)] on linux2
> >>> import array
> >>> a=array.array('u', 'xyz')
> >>> b=memoryview(a)
> >>> a == b
> True
> >>> b == a
> True

[3.3 returns False]

That's actually deliberate. The new memoryview does not consider arrays equal
if the format codes do not match, to avoid situations like (32-bit Python):

Python 3.2a0 (py3k:76143M, Nov  7 2009, 17:05:38) 
[GCC 4.2.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import array
>>> a = array.array('f', [0])
>>> b = array.array('i', [0])
>>> x = memoryview(a)
>>> y = memoryview(b)
>>> 
>>> a == b
True
>>> x == y
True
>>> 

I think that (for buffers at least) an array of float should not compare
equal to an array of int, especially since the 3.2 memoryview uses memcmp()
in richcompare().

See also the comment in the documentation for memoryview.format:

http://docs.python.org/dev/library/stdtypes.html#memoryview-type

memoryview is not aware of the 'u' format code, since it's not part of
the struct syntax and the PEP-3118 proposition 'u' -> UCS2, 'w' -> UCS4
wasn't considered useful.

Now in your example I see that array's getbufferproc actually already uses
'w' for UCS4. It would still be an option to make memoryview aware of
'u' and 'w' (as suggested by the PEP).

--

___
Python tracker 

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



[issue15501] Document exception classes in subprocess module

2012-08-06 Thread Tshepang Lekhonkhobe

Changes by Tshepang Lekhonkhobe :


--
nosy: +tshepang

___
Python tracker 

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



[issue15504] pickle/cPickle saves invalid/incomplete data

2012-08-06 Thread Tshepang Lekhonkhobe

Changes by Tshepang Lekhonkhobe :


--
nosy: +tshepang

___
Python tracker 

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



[issue15506] configure should use PKG_PROG_PKG_CONFIG

2012-08-06 Thread Tshepang Lekhonkhobe

Changes by Tshepang Lekhonkhobe :


--
nosy: +tshepang

___
Python tracker 

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



[issue15520] Document datetime.timestamp() in 3.3 What's New

2012-08-06 Thread Tshepang Lekhonkhobe

Changes by Tshepang Lekhonkhobe :


--
nosy: +tshepang

___
Python tracker 

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



[issue15523] Block on close TCP socket in SocketServer.py

2012-08-06 Thread Tshepang Lekhonkhobe

Changes by Tshepang Lekhonkhobe :


--
nosy: +pitrou

___
Python tracker 

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



[issue15509] webbrowser.open sometimes passes zero-length argument to the browser.

2012-08-06 Thread Tshepang Lekhonkhobe

Changes by Tshepang Lekhonkhobe :


--
nosy: +tshepang

___
Python tracker 

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



[issue15563] wrong conversion reported by

2012-08-06 Thread Martin v . Löwis

Martin v. Löwis added the comment:

It's a timezone issue. Try

datetime.datetime.utcfromtimestamp(1341183050)

--
nosy: +loewis
resolution:  -> invalid
status: open -> closed

___
Python tracker 

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



[issue15545] sqlite3.Connection.iterdump() does not work with row_factory = sqlite3.Row

2012-08-06 Thread Pierre Le Marre

Pierre Le Marre added the comment:

By the way, this issue does not appear with Python 3.2.2.

--

___
Python tracker 

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



[issue15563] wrong conversion reported by

2012-08-06 Thread Walid Shaari

Walid Shaari added the comment:

the issue i believe is in datetime module

--

___
Python tracker 

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



[issue15563] wrong conversion reported by

2012-08-06 Thread Walid Shaari

New submission from Walid Shaari:

In the code below the time stamp 1341183050 should be 01 July 2012.  however 
datetime is converting it back to 7 July 2012, the reverse too is wrong, is 
that just the way i am using the code?

[g_geadm@plcig2 ~]$ ipython
Python 2.6.5 (r265:79063, Jul 14 2010, 11:36:05)
Type "copyright", "credits" or "license" for more information.


In [2]: import datetime
In [3]: import time
In [4]: datetime.datetime.fromtimestamp(1341183050)
Out[4]: datetime.datetime(2012, 7, 2, 1, 50, 50)
time.mktime(dt.timetuple())

In [5]: dt=datetime.datetime(2012, 7, 2, 1, 50, 50)
In [6]: time.mktime(dt.timetuple())
Out[6]: 1341183050.0

In [7]: dt=datetime.datetime(2012, 7, 1, 22, 50, 50)
In [8]: time.mktime(dt.timetuple())
Out[8]: 1341172250.0

In [9]: datetime.datetime.fromtimestamp(1341172250.0)
Out[9]: datetime.datetime(2012, 7, 1, 22, 50, 50)

--
components: Library (Lib)
messages: 167541
nosy: wshaari
priority: normal
severity: normal
status: open
title: wrong conversion reported by
versions: Python 2.6

___
Python tracker 

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



[issue8912] `make patchcheck` should check the whitespace of .c/.h files

2012-08-06 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
nosy: +storchaka

___
Python tracker 

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