[issue14880] csv.reader and .writer use wrong kwargs notation in 2.7 docs

2012-08-27 Thread Petri Lehtinen
Petri Lehtinen added the comment: Chris: Thanks for the patch. I'm not sure register_dialect()'s signature is good like that, though. Hynek, what do you think? -- stage: - patch review ___ Python tracker rep...@bugs.python.org http

[issue11964] Undocumented change to indent param of json.dump in 3.2

2012-08-27 Thread Petri Lehtinen
Petri Lehtinen added the comment: I don't think the test changes are needed, because both dump() and dumps() use JSONEncoder internally, and all current indent testing is done using dumps() anyway. More important would be to update the documentation of indent for JSONEncoder to match

[issue11964] Undocumented change to indent param of json.dump in 3.2

2012-08-27 Thread Petri Lehtinen
Petri Lehtinen added the comment: Attached a new patch. -- Added file: http://bugs.python.org/file27017/issue11964.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11964

[issue13769] json.dump(ensure_ascii=False) return str instead of unicode

2012-08-26 Thread Petri Lehtinen
Petri Lehtinen added the comment: It seems to me that when ensure_ascii is False, the return value will be a unicode instance if and only if there's a unicode object anywhere in the input. json.dumps({'foo': 'bar'}, ensure_ascii=False) '{foo: bar}' json.dumps({'foo': u'bar'}, ensure_ascii

[issue15222] mailbox.mbox writes without empty line after each message

2012-08-25 Thread Petri Lehtinen
Petri Lehtinen added the comment: Attaching two patches. Patch 1 changes the common message template in mailbox tests to end in a newline. If this wasn't done, more or less all common mailbox tests would have to be special cased for mbox. Patch 2 adds a single blank line after each message

[issue15222] mailbox.mbox writes without empty line after each message

2012-08-25 Thread Petri Lehtinen
Changes by Petri Lehtinen pe...@digip.org: -- keywords: +needs review stage: - patch review Added file: http://bugs.python.org/file26999/issue15222_v1_0002_insert_blank_after_each_message_in_mbox.patch ___ Python tracker rep...@bugs.python.org http

[issue14674] Link to explain deviations from RFC 4627 in json module docs

2012-08-23 Thread Petri Lehtinen
Petri Lehtinen added the comment: Using the word scalar sounds wrong to me. Are strings really considered scalars in Python? At least RFC 4627 doesn't talk about scalars. +Since the RFC permits RFC-compliant parsers to accept input texts that are not +RFC-compliant, this module's deserializer

[issue15393] JSONDecoder.raw_decode breaks on leading whitespace

2012-08-23 Thread Petri Lehtinen
Petri Lehtinen added the comment: I think skipping preceding whitespace in raw_decode() wouldn't hurt, but skipping following whitespace would be wrong. David: Any examples of how this could break backwards compatibility? -- nosy: +petri.lehtinen

[issue13212] json library is decoding/encoding when it should not

2012-08-23 Thread Petri Lehtinen
Petri Lehtinen added the comment: The strict flag sounds good to me, too. I don't think it should be called strict though, as that would imply that we comply with RFC 4627 strictly (which is not true without passing allow_nan=False for dump() or passing a parse_constant function for load

[issue15249] email.generator.BytesGenerator doesn't mangle From lines when non-ASCII bytes are present

2012-08-23 Thread Petri Lehtinen
Petri Lehtinen added the comment: The patch looks good to me and seems to fix my test case. I find the email code somewhat complicated, so I'll let David decide whether it's the correct fix :) -- stage: needs patch - patch review ___ Python tracker

[issue15742] SQLite3 documentation changes

2012-08-20 Thread Petri Lehtinen
Petri Lehtinen added the comment: + print(c.fetchone()) I don't think this line should be added because it's not there after the first select. -- nosy: +petri.lehtinen ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15742

[issue15199] Default mimetype for javascript should be application/javascript

2012-08-20 Thread Petri Lehtinen
Petri Lehtinen added the comment: Fixed, thanks for the patch. -- nosy: +petri.lehtinen resolution: - fixed stage: - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15199

[issue15588] quopri: encodestring and decodestring handle bytes, not strings

2012-08-18 Thread Petri Lehtinen
Petri Lehtinen added the comment: The encode() and decode() functions also expect binary file objects. Attached a patch that changes documentation and docstrings. Removed the mentions of readline(), because read() is called on input instead, if the binascii module is available. Also removed

[issue14977] mailcap does not respect precedence in the presence of wildcards

2012-08-17 Thread Petri Lehtinen
Petri Lehtinen added the comment: Sounds like a bug to me. It's not too straightforward to fix, though. The order of MIME types is lost because they are stored as keys of a dict. AFAICS, it wouldn't help to use OrderedDict and checking for the wildcard type first if its index is smaller

[issue14977] mailcap does not respect precedence in the presence of wildcards

2012-08-17 Thread Petri Lehtinen
Changes by Petri Lehtinen pe...@digip.org: -- keywords: -easy ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14977 ___ ___ Python-bugs-list

[issue11062] mailbox fails to round-trip a file to a Babyl mailbox

2012-08-16 Thread Petri Lehtinen
Petri Lehtinen added the comment: Tests are now passing on Windows, too. Closing. -- resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11062

[issue6484] No unit test for mailcap module

2012-08-16 Thread Petri Lehtinen
Petri Lehtinen added the comment: Any reason why this hasn't been backported to 3.2 or 2.7? -- nosy: +petri.lehtinen ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6484

[issue4253] Maildir dumpmessage on

2012-08-16 Thread Petri Lehtinen
Petri Lehtinen added the comment: No reply in two years, closing. -- nosy: +petri.lehtinen resolution: - invalid status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4253

[issue11062] mailbox fails to round-trip a file to a Babyl mailbox

2012-08-15 Thread Petri Lehtinen
Petri Lehtinen added the comment: This happens because of a bug in Babyl._install_message(). When adding a message from file, the *** EOOH *** line is written also after the second set of headers. -- nosy: +petri.lehtinen ___ Python tracker rep

[issue11062] mailbox fails to round-trip a file to a Babyl mailbox

2012-08-15 Thread Petri Lehtinen
Changes by Petri Lehtinen pe...@digip.org: -- resolution: - fixed stage: needs patch - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11062

[issue11062] mailbox fails to round-trip a file to a Babyl mailbox

2012-08-15 Thread Petri Lehtinen
Changes by Petri Lehtinen pe...@digip.org: -- versions: +Python 2.7 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11062 ___ ___ Python-bugs-list

[issue11062] mailbox fails to round-trip a file to a Babyl mailbox

2012-08-15 Thread Petri Lehtinen
Petri Lehtinen added the comment: Yeah. Enabling the Babyl tests discovered yet another bug on a code path that wasn't excercised at all. I'll fix it. -- assignee: - petri.lehtinen resolution: fixed - ___ Python tracker rep...@bugs.python.org http

[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

[issue15232] email.generator.Generator doesn't mangle From lines in MIME preamble

2012-07-23 Thread Petri Lehtinen
Petri Lehtinen pe...@digip.org added the comment: Thanks. The news entry should probably say 'From ' instead of 'From'. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15232

[issue5053] http.client.HTTPMessage.getallmatchingheaders() always returns []

2012-07-07 Thread Petri Lehtinen
Petri Lehtinen pe...@digip.org added the comment: My 4) actually meant that it should always return []. This is what it currently does, so it could be spelled out clearly in the code. IIRC, getallmatchingheaders() cannot be emulated one-to-one using get_all(), because it handles continuation

[issue5053] http.client.HTTPMessage.getallmatchingheaders() always returns []

2012-07-07 Thread Petri Lehtinen
Petri Lehtinen pe...@digip.org added the comment: The CGIHTTPRequestHandler fix and test would be the best thing to start with, though, as it's not related to the eventual fate of getallmatchingheaders(). -- stage: - needs patch ___ Python tracker

[issue15222] mailbox.mbox writes without empty line after each message

2012-07-07 Thread Petri Lehtinen
Petri Lehtinen pe...@digip.org added the comment: MDAs blindly write their message to the end of the user's mail spool file. So, if there's no newline at the end, the mailbox gets corrupted (the new message is joined with the previous one). I tested with Postfix, but this probably happens

[issue15249] email.generator.BytesGenerator doesn't mangle From lines when non-ASCII bytes are present

2012-07-04 Thread Petri Lehtinen
New submission from Petri Lehtinen pe...@digip.org: The _handle_text function of BytesGenerator writes the payload straight through if there surrogateescape sequences are present, and skips the From mangling. -- components: email messages: 164641 nosy: barry, petri.lehtinen

[issue15249] email.generator.BytesGenerator doesn't mangle From lines when non-ASCII bytes are present

2012-07-04 Thread Petri Lehtinen
Petri Lehtinen pe...@digip.org added the comment: Attached a test case that fails. -- keywords: +patch Added file: http://bugs.python.org/file26258/issue115249_test.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15249

[issue15222] mailbox.mbox writes without empty line after each message

2012-07-04 Thread Petri Lehtinen
Petri Lehtinen pe...@digip.org added the comment: Well, by appending newmail to the mailbox, you effectively break the next-to-last message by not inserting a newline after it. This can also be achieved by adding a message that doesn't end in a newline to the mbox (using the mailbox module

[issue11728] mbox parser incorrect behaviour

2012-07-03 Thread Petri Lehtinen
Petri Lehtinen pe...@digip.org added the comment: Some thoughts on doing clever tricks to enhance mbox parsing: http://www.jwz.org/doc/content-length.html -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11728

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

2012-07-02 Thread Petri Lehtinen
Petri Lehtinen pe...@digip.org added the comment: This might be the only way to fix #1599254, see http://bugs.python.org/issue1599254#msg30590. If another program is waiting on the fcntl lock (and doesn't use dotlocking), as soon as mailbox.py closes the original file (to replace

[issue15232] email.generator.Generator doesn't mangle From lines in MIME preamble

2012-07-01 Thread Petri Lehtinen
Petri Lehtinen pe...@digip.org added the comment: Hi and thanks for the report. It seems that this is a bug in email.generator.Generator, as it fails to mangle From lines in the MIME preamble (after the headers, before the first --Boundary... line). -- components: +Library (Lib) nosy

[issue15222] mailbox.mbox writes without empty line after each message

2012-06-30 Thread Petri Lehtinen
Petri Lehtinen pe...@digip.org added the comment: I'm afraid that's not enough details to do any fixing. I would need a concrete way to reproduce the issue. -- status: open - pending ___ Python tracker rep...@bugs.python.org http://bugs.python.org

[issue9559] mailbox.mbox creates new file when adding message to mbox

2012-06-29 Thread Petri Lehtinen
Changes by Petri Lehtinen pe...@digip.org: -- resolution: - fixed stage: patch review - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9559

[issue15222] mailbox.mbox writes without end-of-line at the file end.

2012-06-29 Thread Petri Lehtinen
Petri Lehtinen pe...@digip.org added the comment: I cannot reproduce this on 3.2 or 2.7. My mailboxes always have an ending newline if the last message also has it. Only if the last message doesn't end in a newline, there's no newline in the end of the mbox. Furthermore, if a message doesn't

[issue5346] mailbox._singlefileMailbox.flush doesn't preserve file rights

2012-06-29 Thread Petri Lehtinen
Petri Lehtinen pe...@digip.org added the comment: Fixed. -- resolution: - fixed stage: patch review - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5346

[issue15222] mailbox.mbox writes without empty line after each message

2012-06-29 Thread Petri Lehtinen
Petri Lehtinen pe...@digip.org added the comment: Since there's no empty line between the content of mail 2 and the From line of mail 3, the body of mail 2 isn't really terminated by a newline. Reading the message confirms this: import mailbox mbox = mailbox.mbox('mbox') mbox[1

[issue9559] mailbox.mbox creates new file when adding message to mbox

2012-06-28 Thread Petri Lehtinen
Petri Lehtinen pe...@digip.org added the comment: Fixed. I removed the extra newlines. -- resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9559

[issue9559] mailbox.mbox creates new file when adding message to mbox

2012-06-28 Thread Petri Lehtinen
Petri Lehtinen pe...@digip.org added the comment: See #15122 for always modifying single-file mailboxes in-place. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9559

[issue13886] readline-related test_builtin failure

2012-06-28 Thread Petri Lehtinen
Petri Lehtinen pe...@digip.org added the comment: I had exactly the same error on 3.3b1 when running the test suite with randomized order. -- nosy: +petri.lehtinen ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13886

[issue9559] mailbox.mbox creates new file when adding message to mbox

2012-06-28 Thread Petri Lehtinen
Petri Lehtinen pe...@digip.org added the comment: The _pre_mailbox_hook may be called twice, like this: babyl = mailbox.Babyl('new_file') babyl.add('foo\n') babyl.remove(0) babyl.add('bar\n') This only affects Babyl, that writes the mailbox header in _pre_mailbox_hook. The mailbox

[issue15214] list.startswith() and list.remove() fails to catch consecutive items in a list.

2012-06-27 Thread Petri Lehtinen
Petri Lehtinen pe...@digip.org added the comment: This happens because you modify the list while iterating over it, which makes the loop not work as you expect. Essentially, when you remove the item that's currently being pointed to, the loop skips over the next item. An idiomatic way

[issue7360] [mailbox] race: mbox may lose data with concurrent access

2012-06-26 Thread Petri Lehtinen
Petri Lehtinen pe...@digip.org added the comment: I created #15122 for adding an option to rewrite the contents of single-file mailboxes in-place. Closing this issue as wontfix. -- resolution: - wont fix stage: - committed/rejected status: open - closed superseder: - Add an option

[issue5346] mailbox._singlefileMailbox.flush doesn't preserve file rights

2012-06-26 Thread Petri Lehtinen
Petri Lehtinen pe...@digip.org added the comment: Attached a patch. It copies the mode of the original mailbox file to the new file on flush(). -- components: +email keywords: +patch nosy: +barry, r.david.murray stage: test needed - patch review versions: +Python 3.3 -Python 3.1 Added

[issue9559] mailbox.mbox creates new file when adding message to mbox

2012-06-26 Thread Petri Lehtinen
Petri Lehtinen pe...@digip.org added the comment: Attached a patch that doesn't rewrite+rename if messages have only been added. In this case, flush() only syncs the mailbox file to make sure all changes have been written to disk. David Barry: what do you think about including this on bugfix

[issue11728] mbox parser incorrect behaviour

2012-06-25 Thread Petri Lehtinen
Petri Lehtinen pe...@digip.org added the comment: Actually, you're right. Sorry for overlooking the RFC. But that said, the RFC itself refers to the same manpage as a reference that's mostly authoritative for those variations that are otherwise only documented in anecdotal form. So I guess

[issue13698] Mailbox module should support other mbox formats in addition to mboxo

2012-06-25 Thread Petri Lehtinen
Petri Lehtinen pe...@digip.org added the comment: The default mode for reading mbox files should also be modified a bit to maximize the support fordifferent implementations. See #11728. I think we should still use the mboxo format by default when writing, and the default format of RFC 4155

[issue13698] Mailbox module should support other mbox formats in addition to mboxo

2012-06-25 Thread Petri Lehtinen
Petri Lehtinen pe...@digip.org added the comment: endolith wrote: - If the mailbox is written using the mboxrd format and read using - the mboxo format, lines that were meant to start with From - are changed to From . This is a new type of corruption. Well, yes. So the choices

[issue1599254] mailbox: other programs' messages can vanish without trace

2012-06-25 Thread Petri Lehtinen
Petri Lehtinen pe...@digip.org added the comment: It seems to me that there are three separate issues here: 1) Concurrent access to a single-file mailbox will discard some messages even if locking is correctly used. This is demonstrated by mailbox-test.patch, which despite its age applies

[issue11728] mbox parser incorrect behaviour

2012-06-24 Thread Petri Lehtinen
Petri Lehtinen pe...@digip.org added the comment: It seems to me that ^From is the correct way to match the start of each message. This is also what the qmail manual page (linked in the previous message) says. So closing as invalid. -- nosy: +petri.lehtinen resolution: - invalid

[issue15121] devguide doesn't document all bug tracker components

2012-06-21 Thread Petri Lehtinen
New submission from Petri Lehtinen pe...@digip.org: http://docs.python.org/devguide/triaging.html#components The undocumented components are: - None - Cross-Build - email -- components: Devguide messages: 163321 nosy: ezio.melotti, petri.lehtinen priority: normal severity: normal

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

2012-06-21 Thread Petri Lehtinen
New submission from Petri Lehtinen pe...@digip.org: This seems like a common feature request. Many people suffer from the fact that upon flush, the contents of single-file mailboxes are written into a new file which is then renamed over the old file. For example: #1599254, #5346, #7359, #7360

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

2012-06-21 Thread Petri Lehtinen
Changes by Petri Lehtinen pe...@digip.org: -- components: +email nosy: +barry, r.david.murray ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15122

[issue13698] Mailbox module should support other mbox formats in addition to mboxo

2012-06-21 Thread Petri Lehtinen
Changes by Petri Lehtinen pe...@digip.org: -- nosy: +petri.lehtinen versions: +Python 3.4 -Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13698

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

2012-06-21 Thread Petri Lehtinen
Petri Lehtinen pe...@digip.org added the comment: I actually already researched mutt 1.5.21 (on Ubuntu), and it seems to overwrite the file in-place. At least the inode number doesn't change when I append and/or delete files from an mbox file and save

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

2012-06-21 Thread Petri Lehtinen
Petri Lehtinen pe...@digip.org added the comment: Now I also tested rmail (the Emacs email client). It seems to write-and-rename, at least the inode number changes. It seems to even use the mboxo format nowadays (used to use Babyl). -- ___ Python

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

2012-06-21 Thread Petri Lehtinen
Petri Lehtinen pe...@digip.org added the comment: Alpine (the successor of pine) also seems to overwrite in-place, just like mutt. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15122

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

2012-06-21 Thread Petri Lehtinen
Petri Lehtinen pe...@digip.org added the comment: I looked at the source code of mutt to see how it rewrites mbox files. It does roughly this: 1. Block some signals. 2. Lock the mbox file (with dotlock, fcntl and flock). 3. Create a temporary file in /tmp. 4. Write messages to the temporary

[issue13698] Mailbox module should support other mbox formats in addition to mboxo

2012-06-21 Thread Petri Lehtinen
Petri Lehtinen pe...@digip.org added the comment: I'm a little concerned about backwards compatibility. Someone might get upset if extra 's start appearing in the messages when they read the mailbox contents with an application that uses the mboxo format. A little analysis on the possible

[issue15036] mailbox.mbox fails to pop two items in a row, flushing in between

2012-06-18 Thread Petri Lehtinen
Petri Lehtinen pe...@digip.org added the comment: Perfect, fixed. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15036 ___ ___ Python-bugs-list

[issue9559] mailbox.mbox creates new file when adding message to mbox

2012-06-18 Thread Petri Lehtinen
Petri Lehtinen pe...@digip.org added the comment: This is actually not true. When calling add(), mbox (and MMDF and Babyl) append the message to the file without rewriting it. It's the following flush() call that rewrites the whole mailbox contents. I think this could be changed to work

[issue1590744] mail message parsing glitch

2012-06-18 Thread Petri Lehtinen
Changes by Petri Lehtinen pe...@digip.org: -- nosy: +petri.lehtinen ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1590744 ___ ___ Python-bugs-list

[issue7360] [mailbox] race: mbox may lose data with concurrent access

2012-06-18 Thread Petri Lehtinen
Petri Lehtinen pe...@digip.org added the comment: Can this be closed? -- nosy: +petri.lehtinen ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7360

[issue5346] mailbox._singlefileMailbox.flush doesn't preserve file rights

2012-06-18 Thread Petri Lehtinen
Changes by Petri Lehtinen pe...@digip.org: -- nosy: +petri.lehtinen ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5346 ___ ___ Python-bugs-list

[issue7359] mailbox cannot modify mailboxes in system mail spool

2012-06-18 Thread Petri Lehtinen
Petri Lehtinen pe...@digip.org added the comment: Every program that accesses mailboxes in the system-wide mail spool directory needs to have write access to it. This is because dot-locking is achieved by creating additional files to that directory, and it must be used (in addition to fcntl

[issue15036] mailbox.mbox fails to pop two items in a row, flushing in between

2012-06-16 Thread Petri Lehtinen
Petri Lehtinen pe...@digip.org added the comment: Yes, this is what I tried to say. It's hard for me to find a good wording, so what would you suggest? I also noticed now that there's a typo in the commit messages. But those cannot be fixed anymore

[issue15061] hmac.secure_compare() leaks information about length of strings

2012-06-15 Thread Petri Lehtinen
Petri Lehtinen pe...@digip.org added the comment: For example, Django uses time independent comparison to compare signatures of signed cookies. A signed cookie consists of a plain-text value followed by a signature. An attacker wants to construct a cookie that has a malformed value

[issue15036] mailbox.mbox fails to pop two items in a row, flushing in between

2012-06-15 Thread Petri Lehtinen
Petri Lehtinen pe...@digip.org added the comment: As I suspected, all single-file mailboxes(mbox, MMDF, Babyl) have this issue. Attached a patch with tests. -- keywords: +patch Added file: http://bugs.python.org/file26017/issue15036.patch ___ Python

[issue15036] mailbox.mbox fails to pop two items in a row, flushing in between

2012-06-15 Thread Petri Lehtinen
Changes by Petri Lehtinen pe...@digip.org: -- resolution: - fixed stage: needs patch - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15036

[issue15036] mailbox.mbox fails to pop two items in a row, flushing in between

2012-06-14 Thread Petri Lehtinen
Petri Lehtinen pe...@digip.org added the comment: The fix seems to be very simple: diff --git a/Lib/mailbox.py b/Lib/mailbox.py index a677729..2be4c83 100644 --- a/Lib/mailbox.py +++ b/Lib/mailbox.py @@ -675,6 +675,7 @@ class _singlefileMailbox(Mailbox): new_file.write

[issue15036] mailbox.mbox fails to pop two items in a row, flushing in between

2012-06-08 Thread Petri Lehtinen
New submission from Petri Lehtinen pe...@digip.org: test_mbox is an mbox mailbox with a few messages in it. import mailbox inbox = mailbox.mbox('test_mbox') inbox.lock() inbox.popitem() (0, mailbox.mboxMessage instance at 0x7f78016bc680) inbox.flush() inbox.unlock() inbox.lock

[issue15036] mailbox.mbox fails to pop two items in a row, flushing in between

2012-06-08 Thread Petri Lehtinen
Petri Lehtinen pe...@digip.org added the comment: Actually, you don't even need to unlock() and lock() the mailbox before the second popitem() and flush(). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15036

[issue15017] threading.Lock documentation conflict

2012-06-06 Thread Petri Lehtinen
New submission from Petri Lehtinen pe...@digip.org: In the description of section 16.2.2. Lock objects: If an attempt is made to release an unlocked lock, a RuntimeError will be raised. In the description of Lock.release(): When invoked on an unlocked lock, a ThreadError is raised

[issue15017] threading.Lock documentation conflict

2012-06-06 Thread Petri Lehtinen
Changes by Petri Lehtinen pe...@digip.org: -- versions: +Python 3.2, Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15017 ___ ___ Python

[issue14502] Document better what happens on releasing an unacquired lock

2012-06-06 Thread Petri Lehtinen
Petri Lehtinen pe...@digip.org added the comment: The docs of 2.7 and 3.2 still first say that RuntimeError is raised, and then that a ThreadError is raised: ... If an attempt is made to release an unlocked lock, a RuntimeError will be raised. ... Lock.release

[issue9544] xdrlib.Packer().pack_fstring throws a TypeError when called with a str()

2012-06-06 Thread Petri Lehtinen
Petri Lehtinen pe...@digip.org added the comment: Attached a patch against 3.2. It reflects the facts that pack_fstring and pack_fopaque are the same methd, and pack_string, pack_opaque and pack_bytes are the same method. -- versions: +Python 3.2, Python 3.3 -Python 3.1

[issue9544] xdrlib.Packer().pack_fstring throws a TypeError when called with a str()

2012-06-06 Thread Petri Lehtinen
Changes by Petri Lehtinen pe...@digip.org: Added file: http://bugs.python.org/file25849/issue9544.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9544

[issue12354] packaging.pypi.simple docs use both client and crawler name, which might be confusing

2012-06-05 Thread Petri Lehtinen
Changes by Petri Lehtinen pe...@digip.org: -- nosy: -petri.lehtinen ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12354 ___ ___ Python-bugs-list

[issue11694] xdrlib raises ConversionError in inconsistent way

2012-06-05 Thread Petri Lehtinen
Petri Lehtinen pe...@digip.org added the comment: I see one obvious issue with the patch: The ConversionErrors it creates are passed the struct.error or TypeError instance as a parameter. The first argument of these exceptions would be better, i.e. try: ... except struct.error as e

[issue9544] xdrlib.Packer().pack_fstring throws a TypeError when called with a str()

2012-06-01 Thread Petri Lehtinen
Changes by Petri Lehtinen pe...@digip.org: -- nosy: +petri.lehtinen ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9544 ___ ___ Python-bugs-list

[issue12354] packaging.pypi.simple docs use both client and crawler variable, which might be confusing

2012-06-01 Thread Petri Lehtinen
Petri Lehtinen pe...@digip.org added the comment: Can this be closed? -- nosy: +petri.lehtinen ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12354

[issue12354] packaging.pypi.simple docs use both client and crawler variable, which might be confusing

2012-06-01 Thread Petri Lehtinen
Changes by Petri Lehtinen pe...@digip.org: -- status: open - pending ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12354 ___ ___ Python-bugs-list

[issue11685] possible SQL injection into db APIs via table names... sqlite3

2012-05-29 Thread Petri Lehtinen
Petri Lehtinen pe...@digip.org added the comment: No SQL library that I know of provides a way to escape table names. The quoting functions are always meant to escape string parameters. This is true for sqlite3_mprintf(), too (the %q and %Q options). If you build table names from user input

[issue12014] str.format parses replacement field incorrectly

2012-05-25 Thread Petri Lehtinen
Petri Lehtinen pe...@digip.org added the comment: I added some comments on rietveld. These are only nit-picking about style and mostly reflect my personal taste, not show stoppers in any case. -- ___ Python tracker rep...@bugs.python.org http

[issue14863] Update docs of os.fdopen()

2012-05-24 Thread Petri Lehtinen
Changes by Petri Lehtinen pe...@digip.org: -- resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14863

[issue12014] str.format parses replacement field incorrectly

2012-05-23 Thread Petri Lehtinen
Petri Lehtinen pe...@digip.org added the comment: Ben Wolfson wrote: Maybe, but the last time it went to python-dev (in December) there was little discussion at all, and the patches that exist now worked on the codebase as it existed then. Maybe it's pointless to bring it up on python-dev

[issue13445] Enable linking the module pysqlite with Berkeley DB SQL instead of SQLite

2012-05-23 Thread Petri Lehtinen
Petri Lehtinen pe...@digip.org added the comment: Ok. Closing as wontfix then. -- resolution: - wont fix stage: - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13445

[issue13934] sqlite3 test typo

2012-05-23 Thread Petri Lehtinen
Petri Lehtinen pe...@digip.org added the comment: poq: I see you have submitted a few other patches to the tracker, too. For us to be able to use your patches, you should sign the PSF Contributor Agreement as described here: http://www.python.org/psf/contrib

[issue14862] os.__all__ is missing some names

2012-05-23 Thread Petri Lehtinen
Changes by Petri Lehtinen pe...@digip.org: -- title: fdopen not listed in __all__ of os.py - os.__all__ is missing some names ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14862

[issue14862] os.__all__ is missing some names

2012-05-23 Thread Petri Lehtinen
Changes by Petri Lehtinen pe...@digip.org: -- resolution: - fixed stage: needs patch - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14862

[issue14880] csv.reader and .writer use wrong kwargs notation in 2.7 docs

2012-05-22 Thread Petri Lehtinen
Petri Lehtinen pe...@digip.org added the comment: I verified from the source that it should be **fmtparams also in 2.7. Make sure you change the description texts, too, to s/fmtparam/fmtparams/. -- nosy: +petri.lehtinen ___ Python tracker rep

[issue14472] .gitignore is outdated

2012-05-22 Thread Petri Lehtinen
Petri Lehtinen pe...@digip.org added the comment: Fixed in default and 3.2 branches, which are quite similar. Thanks for the patch! Closing now. Feel free to reopen if you want to provide a patch for the 2.7 branch, too. -- resolution: - fixed status: open - closed versions: +Python

[issue12014] str.format parses replacement field incorrectly

2012-05-22 Thread Petri Lehtinen
Petri Lehtinen pe...@digip.org added the comment: Ben, As I've said, I think that we should go for the documented behavior with the addition of not allowing braces inside the format string (with the exception of format_spec). So AFAICS, index_string would become index_string ::= any

[issue14075] argparse: unused method?

2012-05-22 Thread Petri Lehtinen
Petri Lehtinen pe...@digip.org added the comment: Nobody's really sure whether it's safe to remove, so let it be there. Leaving it can be justified by symmetry with _get_kwargs. Closing. -- resolution: - wont fix stage: - committed/rejected status: open - closed

[issue13445] Enable linking the module pysqlite with Berkeley DB SQL instead of SQLite

2012-05-22 Thread Petri Lehtinen
Petri Lehtinen pe...@digip.org added the comment: Still waiting for the info about whether this can be done at run-time. -- status: open - pending ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13445

[issue13934] sqlite3 test typo

2012-05-22 Thread Petri Lehtinen
Petri Lehtinen pe...@digip.org added the comment: Both patches LGTM. -- nosy: +petri.lehtinen ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13934

[issue11685] possible SQL injection into db APIs via table names... sqlite3

2012-05-22 Thread Petri Lehtinen
Changes by Petri Lehtinen pe...@digip.org: -- nosy: +petri.lehtinen ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11685 ___ ___ Python-bugs-list

[issue14804] Wrong defaults args notation in docs

2012-05-21 Thread Petri Lehtinen
Petri Lehtinen pe...@digip.org added the comment: The 3.x patch looks good to me. What comes to the 2.7 patch, there's at least the problem with fmtparam in the csv module (should be **fmtparams instead of [, fmtparam]). And that's were I stopped reviewing, so there may also be other errors

[issue14870] Descriptions of os.utime() and os.utimensat() use wrong notation

2012-05-21 Thread Petri Lehtinen
Petri Lehtinen pe...@digip.org added the comment: os.utime() uses the same notation: os.utime(path[, times, *, ns=(atime_ns, mtime_ns)]) -- nosy: +petri.lehtinen title: os.utimensat's method description uses wrong notation - Descriptions of os.utime() and os.utimensat() use wrong

<    1   2   3   4   5   6   7   >