[issue32514] 0x80070002 - The system cannot find the file specified

2022-02-20 Thread John


Change by John :


Removed file: https://bugs.python.org/file47373/Python 3.6.4 
(32-bit)_20180107153053_000_core_JustForMe[3206].log

___
Python tracker 
<https://bugs.python.org/issue32514>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32514] 0x80070002 - The system cannot find the file specified

2022-02-20 Thread John


Change by John :


Removed file: https://bugs.python.org/file47370/Python 3.6.4 
(32-bit)_20180107153053[3191].log

___
Python tracker 
<https://bugs.python.org/issue32514>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11230] "Full unicode import system" not in 3.2

2011-07-05 Thread John

John  added the comment:

Sorry for the long delay.

haypo wrote:
  Can you propose a sentence which is more clear about bytes/Unicode?

On this page:
http://www.python.org/download/releases/3.2/
is this line:
"- countless fixes regarding bytes/string issues; among them full support for a 
bytes environment (filenames, environment variables)"

How about adding to that line something like:
" on UNIX; but on Windows the path to and name of each module you import can 
contain only characters that are in the ANSI codepage that your Windows is 
using"

and maybe
" (will be fixed in Python 3.3)"

and maybe (or not) also something like:
" (ANSI codepage = basic latin + other characters of only your own language 
group)"

-- jh

--

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



[issue11136] imaplib IMAP4_SSL shutdown gets socket error in py 3.2

2011-02-06 Thread John

New submission from John :

windows vista
Python 3.2 rc2

situation: 
connected to gmail with IMAP4_SSL, did stuff, and finally IMAP4_SSL.close() 
IMAP4_SSL.logout()
IMAP4_SSL.shutdown() 

shutdown() gets this error:

socket.error: [Errno 10038] An operation was attempted on something that is not 
a socket

No problem in Python 3.1.2

For now I don't use shutdown(), and hope the socket is closed automatically 
when the interpreter exits (as open files are).

-- jh

--
components: Library (Lib)
messages: 128092
nosy: jh45
priority: normal
severity: normal
status: open
title: imaplib IMAP4_SSL shutdown gets socket error in py 3.2
type: behavior
versions: Python 3.2

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



[issue11137] clarify use of imaplib IMAP4(_SSL) shutdown

2011-02-06 Thread John

New submission from John :

Attempting IMAP4_SSL.shutdown() after IMAP4_SSL.logout() throws an error 
because the socket is already closed. (I cannot test with plain IMAP4.)

Please add appropriate notice, perhaps under IMAP4.shutdown().

Perhaps something like "If you do not use open(), and do only login() and 
logout(), you do not need shutdown(), as logout() does it for you."

-- jh

--
assignee: docs@python
components: Documentation
messages: 128096
nosy: docs@python, jh45
priority: normal
severity: normal
status: open
title: clarify use of imaplib IMAP4(_SSL) shutdown
versions: Python 3.2

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



[issue11230] "Full unicode import system" not in 3.2

2011-02-16 Thread John

New submission from John :

A few months ago I read that in 3.2 it will be possible to import modules that 
are located on paths containing any unicode character. (more precisely, with 
chars not in the local code page)

After an hour or two trying to get this to work in 3.2rc3, I went looking for 
clues, and found these 2 messages in which Victor Stinner says this feature is 
delayed until Python 3.3:
http://bugs.python.org/issue3080#msg126514
http://bugs.python.org/issue10828#msg125787

Could you please make it clear in documentation and web pages, that this 
feature is not working yet. 

The Python 3.2 download page includes this:
"countless fixes regarding bytes/string issues; among them full support for a 
bytes environment (filenames, environment variables)"
and I guessed this must cover importing from any unicode path, as there was no 
mention that such importing had been abandoned for this version.

-- jh

--
assignee: docs@python
components: Documentation
messages: 128711
nosy: docs@python, jh45
priority: normal
severity: normal
status: open
title: "Full unicode import system" not in 3.2
versions: Python 3.2

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



[issue11230] "Full unicode import system" not in 3.2

2011-02-17 Thread John

John  added the comment:

Victor asked "Which web page should updated/fixed?"

Answer: The Python 3.2 download page.

But what should it say?

The main point is that people like me, who remember seeing a statement about 
this a few months ago, may expect unicode to work in every conceivable 
situation, and a prominent warning that it's not *all* fixed yet, with a link 
to details in the documentation, would save them from trying things that don't 
work.

By the way, I hadn't grasped a simple point from issue 3080: I tested on 
*English* Windows by putting a Greek character in the path to some python 
modules. But the usual situation is where a *Greek* version of Windows has some 
Greek characters in the path, and from what you just wrote, that's OK now.

-- jh

--

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



[issue4002] A Bug in the Documentation

2008-09-30 Thread John

New submission from John <[EMAIL PROTECTED]>:

Hello,

I've found a little bug in the documentation again and I wanna report 
it. Please navigate to where the built-in property() function is 
documented and look at the beginning of the 3rd code snippet:

class C(object):
def __init__(self): self._x = None


Please fix this to the following...

class C(object):
def __init__(self):
self._x = None

--
assignee: georg.brandl
components: Documentation
messages: 74081
nosy: fretai, georg.brandl
severity: normal
status: open
title: A Bug in the Documentation
versions: Python 3.0, Python 3.1

___
Python tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue4002>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4009] A Minor Glitch in the Documentation

2008-10-01 Thread John

New submission from John <[EMAIL PROTECTED]>:

Hello,

I don't know why my previous bug report was ignored, but I must report 
this. Since this is a minor glitch, I hope it will be fixed. Please be 
so kind and fix this.

Please go here and see the 3rd code example:
http://docs.python.org/dev/3.0/library/functions.html?
highlight=property#property

class C(object):
def __init__(self): self._x = None


All other lines in the code example are written in the way that the 
code block of the function definition is in the next line and properly 
indented. Please fix this little glitch. Thank you.

--
assignee: georg.brandl
components: Documentation
messages: 74132
nosy: fretai, georg.brandl
severity: normal
status: open
title: A Minor Glitch in the Documentation
versions: Python 3.0, Python 3.1

___
Python tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue4009>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4110] A minor slip while typing

2008-10-12 Thread John

New submission from John <[EMAIL PROTECTED]>:

Hello,

please let me focus your attention to a little slip that was made while
typing a code example in the Python 3.0 documentation. Please visit the
link  
http://docs.python.org/dev/3.0/library/functions.html?highlight=property#property
  and note the 3rd code example which starts like this:

class C(object):
def __init__(self): self._x = None


This is probably a slip, because it should better be like this:

class C(object):
def __init__(self):
self._x = None


And since this is the only method with such coding style used, it's
probably a slip. Please fix this if you have the time to do so. After
all, it's not a very time-consuming thing to do.


P.S.: I have discovered that the code example

class C(object):
def __init__(self): self._x = None

was used from the documentation of Python 2.5.x which is

class C(object):
def __init__(self): self._x = None
def getx(self): return self._x
def setx(self, value): self._x = value
def delx(self): del self._x
x = property(getx, setx, delx, "I'm the 'x' property.")

but the author of the documentation forgot to put the part  self._x =
None  in a new line and indent the code block.

This slip is present in the documentation for both Python 2.6 and Python
3.0. Please fix it if it is doable. Thanks.

--
assignee: georg.brandl
components: Documentation
messages: 74669
nosy: georg.brandl, vinetou
severity: normal
status: open
title: A minor slip while typing
versions: Python 2.6, Python 2.7, Python 3.0, Python 3.1

___
Python tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue4110>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43849] Typo in calendar doc

2021-04-14 Thread John


New submission from John :

I believe the parenthesis in 

calendar.firstweekday()

should be removed. As it is, it produces 'int' cannot be called.

--
assignee: docs@python
components: Documentation
messages: 391098
nosy: JohnCC330, docs@python
priority: normal
severity: normal
status: open
title: Typo in calendar doc
versions: Python 3.9

___
Python tracker 
<https://bugs.python.org/issue43849>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43849] Typo in calendar doc

2021-04-14 Thread John


John  added the comment:

Sorry for the noise. My confusion.

--
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 
<https://bugs.python.org/issue43849>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32812] edited code only runs after closing and re-opening Python.

2018-02-09 Thread john

New submission from john :

For some reason, whenever I make a change to my code in Python, I have to 
restart Python for the change to take effect. 
Otherwise Python just runs whatever the code was when I opened the .py file.

Worth noting is that this has not always been true, and is not always true. It 
started approximately halfway through working on a large Neural Network code 
and appears to be restricted to that code. (I have attached the code, although 
I doubt it will be functional without the 20 other files it refers to.)

This has become a huge pain in the neck, wasting an estimated 23.7% of my life. 
Please send help. 

Thanks! ^.^

--
files: train.py
messages: 311927
nosy: johnschwarcz
priority: normal
severity: normal
status: open
title: edited code only runs after closing and re-opening Python.
versions: Python 3.6
Added file: https://bugs.python.org/file47433/train.py

___
Python tracker 
<https://bugs.python.org/issue32812>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32812] edited code only runs after closing and re-opening Python.

2018-02-09 Thread john

john  added the comment:

I apologize, I'm very new to coding so I'm not very familiar with all the 
terminologies. 

I'm user Spyder (Python 3.6) on Windows 10. I run my code in Console via 
highlighting and Shift + Enter. 

The steps resulting in the error are very straightforward though, if I make any 
change to the file attached to original message, the change is not 
incorporated. Spyder just runs the code as it was written when I opened the .py 
file. 
For any change to a code to take effect, I have to close and reopen Spyder. 

I apologize if this still isn't specific enough. Please let me know what other 
information I should provide. 
Again, I apologize for my lack of knowledge in this area.

--

___
Python tracker 
<https://bugs.python.org/issue32812>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2943] Distutils should generate a better error message when the SDK is not installed

2014-10-14 Thread John

John added the comment:

error message should contain more details about what went wrong and why

--
nosy: +lambda

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



[issue22906] PEP 479: Change StopIteration handling inside generators

2015-10-06 Thread John

John added the comment:

Consider the following generator function similar to the one that started this 
issue:

from __future__ import generator_stop

def myzip(*seqs):
its = (iter(seq) for seq in seqs)
while True:
try:
yield tuple(next(it) for it in its)
except RuntimeError:
return

g = myzip('abc', 'xyz')
print([next(g) for i in range(5)]) # prints: [('a', 'x'), (), (), (), ()]

A print(list(g)) would cause a hang.

--
nosy: +john.black.3k

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



[issue22906] PEP 479: Change StopIteration handling inside generators

2015-10-06 Thread John

John added the comment:

Please ignore my previous comment - now I understood what is going on. The 
`its` generator is a one-shot iterator so is exhausted the first time the while 
loop is run. Therefore, on subsequent loops, only empty tuples are yielded.

Still learning about generators... :)

--

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



[issue16597] close not being called with context manager on IOError when device is full.

2012-12-02 Thread John-John Tedro

New submission from John-John Tedro:

In 3.2.2 and 3.2.3 on linux64, when running the following code. 

try:
print("Writing to /dev/full")

with open("/dev/full", "w") as f:
 f.write("Write to full device")
except:
print("Catch, file closed?")

Using

strace -e close ~/usr/python3.2.3/bin/python3 test.py
...
Writing to /dev/full
Catch, file closed?
close(3)= 0

The file descriptor being used (3) to attempt writing to /dev/full is not 
closed until the process exits.

I expected this to be closed when leaving the context manager.

--
components: IO
messages: 176816
nosy: udoprog
priority: normal
severity: normal
status: open
title: close not being called with context manager on IOError when device is 
full.
type: behavior
versions: Python 3.2

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



[issue16597] file descriptor not being closed with context manager on IOError when device is full

2012-12-02 Thread John-John Tedro

Changes by John-John Tedro :


--
title: close not being called with context manager on IOError when device is 
full. -> file descriptor not being closed with context manager on IOError when 
device is full

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



[issue16597] file descriptor not being closed with context manager on IOError when device is full

2012-12-02 Thread John-John Tedro

John-John Tedro added the comment:

Originally discovered on 
http://stackoverflow.com/questions/13649330/what-happens-to-file-descriptors-in-python-3-when-close-fails

--

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



[issue45995] string formatting: normalize negative zero

2021-12-11 Thread John Belmonte


Change by John Belmonte :


--
keywords: +patch
nosy: +jbelmonte
nosy_count: 5.0 -> 6.0
pull_requests: +28274
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30049

___
Python tracker 
<https://bugs.python.org/issue45995>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45995] string formatting: normalize negative zero

2021-12-12 Thread John Belmonte


John Belmonte  added the comment:

> For Decimal, we'd need to "own" the string formatting, taking that 
> responsibility away from mpdecimal, but there are already other reasons to do 
> that.

After some digging, I believe this is the background on forking pieces of 
mpdecimal (and why the existing source copy inside Python doesn't count as a 
fork):
  https://bugs.python.org/issue45708#msg405895
  https://github.com/python/cpython/pull/29438

If I understand correctly, the PR for supporting underscore separators in 
Decimal formatting is only taking control of generating a mpd_spec_t from the 
spec string.  Formatting itself is still done by mpd_qformat_spec().

So there's outstanding work to also pull the formatting code itself into 
_decimal.c.  (And this is wanted anyway to reconcile existing libmpdec 
formatting modifications:  
https://github.com/python/cpython/commit/298131a44896a4fec1ea829814ad52409d59aba5)

And this is all because vendors have the crazy practice of unbundling libmpdec 
from Python.  (If a project is bundling the source of another, there may be 
some reason...?)

--

___
Python tracker 
<https://bugs.python.org/issue45995>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45995] string formatting: normalize negative zero

2021-12-12 Thread John Belmonte


John Belmonte  added the comment:

potential short-term solution for Decimal:

  if negative zero option is set and sign is negative:
  pre-round into a temp using mpd_qrescale()
  if mpd_iszero(temp):
  change sign to positive

--

___
Python tracker 
<https://bugs.python.org/issue45995>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45995] string formatting: normalize negative zero

2021-12-14 Thread John Belmonte


John Belmonte  added the comment:

implemented float and Decimal-- PR is ready for review

--

___
Python tracker 
<https://bugs.python.org/issue45995>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45554] multiprocessing exitcode is insufficiently documented

2021-12-16 Thread John Marshall


Change by John Marshall :


--
keywords: +patch
pull_requests: +28360
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30142

___
Python tracker 
<https://bugs.python.org/issue45554>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46259] float formatting error?

2022-01-04 Thread John Holman


New submission from John Holman :

Example:

str(1.12345678901234)
Out[24]: '1.123456789011'

shouldn't the last digit should be 2?

--
messages: 409696
nosy: johngholman
priority: normal
severity: normal
status: open
title: float formatting error?
type: behavior
versions: Python 3.9

___
Python tracker 
<https://bugs.python.org/issue46259>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46259] float formatting error?

2022-01-04 Thread John Holman


John Holman  added the comment:

Thanks - sorry to waste your time.

On Tue, 4 Jan 2022 at 18:17, Raymond Hettinger 
wrote:

>
> Raymond Hettinger  added the comment:
>
> The two numbers you gave become the same when rounded to the limited
> internal precision used by floats.
>
> >>> 1.12345678901234 == 1.123456789011
> True
>
> When it comes to displaying the number, Python tries to show the shortest
> possible member of the equivalence class.
>
> --
> nosy: +rhettinger
> resolution:  -> not a bug
> stage:  -> resolved
> status: open -> closed
>
> ___
> Python tracker 
> <https://bugs.python.org/issue46259>
> ___
>

--

___
Python tracker 
<https://bugs.python.org/issue46259>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46376] PyMapping_Check returns 1 for list

2022-01-14 Thread John Millikin


Change by John Millikin :


--
nosy:  -jmillikin

___
Python tracker 
<https://bugs.python.org/issue46376>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45995] string formatting: normalize negative zero

2022-01-17 Thread John Belmonte


John Belmonte  added the comment:

Mark, would you give it a review this month?  (PR has been marked stale.)

--

___
Python tracker 
<https://bugs.python.org/issue45995>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45554] multiprocessing exitcode is insufficiently documented

2022-01-18 Thread John Marshall


John Marshall  added the comment:

Ping -- This issue has an associated PR that expands the 
multiprocessing.Process.exitcode documentation to cover normal, sys.exit(), and 
exception-raised termination of the child process.

https://github.com/python/cpython/pull/30142

The PR has been available for a month but has not received any review comments.

--

___
Python tracker 
<https://bugs.python.org/issue45554>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44408] imaplib fails when server sends extra blank line after literal value

2022-01-19 Thread John L


John L  added the comment:

It causes an exception and traceback, don't remember which exception six months 
later.  I'll see if I can add a suitable test case to the unit test.

--

___
Python tracker 
<https://bugs.python.org/issue44408>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45995] string formatting: normalize negative zero

2022-01-22 Thread John Belmonte


John Belmonte  added the comment:

Thank you Mark and Eric.

> I'll note that the paper is proposing a 'z' modifier to the sign, so I guess 
> for us that would translate to: [sign[optional-z]] instead of just sign.  I'd 
> have to noodle through the differences between that the proposed [sign][~].

The C++ paper proposes [sign][z] (i.e. you can have the `z` alone without an 
explicit +/-), and this is what I implemented in the Python PR.  My original 
proposal with tilde was discarded.

> My only reservation is Mark's comment:  """For Decimal, we'd need to "own" 
> the string formatting, taking that responsibility away from mpdecimal, but 
> there are already other reasons to do that."""

In the PR I was able to avoid taking that on by preprocessing the format string 
before handing it to mpdecimal.  The code was already doing such things to 
handle the NULL fill character.

--

___
Python tracker 
<https://bugs.python.org/issue45995>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45995] string formatting: normalize negative zero

2022-02-02 Thread John Belmonte


John Belmonte  added the comment:

PEP at https://github.com/python/peps/pull/2295

--

___
Python tracker 
<https://bugs.python.org/issue45995>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46715] asyncio.create_unix_server has an off-by-one error concerning the backlog parameter

2022-02-10 Thread John Snow


New submission from John Snow :

Hi, asyncio.create_unix_server appears to treat the "backlog" parameter as 
where 0 means that *no connection will ever possibly be pending*, which (at the 
very least for UNIX sockets on my machine) is untrue.

Consider a (non-asyncio) server:

```python
import os, socket, sys, time

sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
sock.bind('test.sock')

sock.listen(backlog=0)

while True:
print('.', end='', file=sys.stderr)
time.sleep(1)
```

This server never calls accept(), and uses a backlog of zero. However, a client 
can actually still successfully call connect against such a server:

```python
import os, socket, time

sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
sock.setblocking(False)

sock.connect('test.sock')
print("Connected!")
```

When run against the server example, the first invocation of this client will 
actually connect successfully (Surprising, but that's how the C syscalls work 
too, so... alright) but the second invocation of this client will raise 
BlockingIOError (EAGAIN).

Further, if we amend the first server example to actually call accept(), it 
will succeed when the first client connects -- demonstrating that the actual 
total queue length here was actually effectively 1, not 0.

(i.e. there's always room for at least one connection to be considered, and the 
backlog counts everybody else.)

However, in asyncio.BaseSelectorEventLoop._accept_connection(...), the code 
uses `for _ in range(backlog)` to determine the maximum number of accept calls 
to make. When backlog is set to zero, this means we will *never* call accept, 
even when there are pending connections.

Note that when backlog=1, this actually allows for *two* pending connections 
before clients are rejected, but this loop will only fire once. This behavior 
is surprising, because backlog==0 means we'll accept no clients, but backlog==1 
means we will allow for two to enqueue before accepting both. There is 
seemingly no way with asyncio to actually specify "Exactly one pending 
connection".

I think this loop should be amended to reflect the actual truth of the backlog 
parameter, and it should iterate over `backlog + 1`. This does necessitate a 
change to `Lib/test/test_asyncio/test_selector_events.py` which believes that 
backlog=100 means that accept() should be called 100 times (instead of 101.)

A (very) simple fix is attached here; if it seems sound, I can spin a real PR 
on GitHub.

--
components: asyncio
files: issue.patch
keywords: patch
messages: 413025
nosy: asvetlov, jnsnow, yselivanov
priority: normal
severity: normal
status: open
title: asyncio.create_unix_server has an off-by-one error concerning the 
backlog parameter
type: behavior
versions: Python 3.10, Python 3.11, Python 3.7, Python 3.8, Python 3.9
Added file: https://bugs.python.org/file50618/issue.patch

___
Python tracker 
<https://bugs.python.org/issue46715>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39529] Deprecate get_event_loop()

2022-02-25 Thread John Mellor


Change by John Mellor :


--
nosy: +johnmellor

___
Python tracker 
<https://bugs.python.org/issue39529>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



Python 2.5, missing KERNEL32.DLL, Win95B

2007-03-12 Thread John Collins
Hello all,
Total newbie: Installed Python 2.5 onto a Win 95
4.00.950B O/S. (BTW, fixed CTL3D32.DLL, it was
the wrong one!) I'm getting this error message
every time I attempt to start Python:

"The PYTHON25.DLL file is linked to missing export
 KERNEL32.DLL:GetFileAttributesExA."

Helup! Many thanks, John.

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



GetFileAttributesExA and Win95

2007-03-12 Thread John Collins
Hi all,
Just installed Python 2.5 on my Win95B machine, tried to run
it, but immediately got this error message;
"The PYTHON25.DLL file is
 linked to missing export KERNELL32.DLL :GetFileAttributedExA"
In FAQ, I noted this has been asked before[1], but I cannot find
the solution? Can anyone please help? Perhaps, Martin v. Löwis? 
Thank you all&
Best Regards,
John Collins.
[1] -Copy of Previous Q&A on this problem-
Category: None
Group: None
>Status: Open
Resolution: Fixed
Priority: 7
Submitted By: giomach (giomach)
Assigned to: Martin v. Löwis (loewis)
Summary: GetFileAttributesExA and Win95

Initial Comment:
When Python 2.5 is run under Win95 (Windows 
4.00.950B), it immediately fails with "The 
PYTHON25.DLL file is linked to missing export 
KERNEL32.DLL.GetFileAttributesExA".

Python 2.4.3 is fine.

Ciarán Ó Duibhín.

My e-mail: ciaran at oduibhin.freeserve.co.uk


--

>Comment By: giomach (giomach)
Date: 2006-10-15 18:46

Message:
Logged In: YES 
user_id=1116705

Thanks, this new installer seems to work under Win95.
Vielen Dank,
Ciarán Ó Duibhín.

--

Comment By: Martin v. Löwis (loewis)
Date: 2006-10-15 10:07

Message:
Logged In: YES 
user_id=21627

This should now be fixed in r52339 and r52340. I can't test
it on Win95, though, so I created an inofficial, incomplete
installer on 

http://www.dcl.hpi.uni-potsdam.de/home/loewis/python-2.5.13436.msi

Please try it out and report here whether it works.


--


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



[issue12820] Tests for Lib/xml/dom/minicompat.py

2011-09-15 Thread John Chandler

John Chandler  added the comment:

Just to let you know I haven't forgotten this! I've been pretty busy recently 
so might be a while before I implement the changes to the patch suggested in 
the code review.

John

--

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



[issue6715] xz compressor support

2011-09-15 Thread John Reese

Changes by John Reese :


--
nosy:  -jreese

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



[issue12911] Expose a private accumulator C API

2011-09-16 Thread John O'Connor

Changes by John O'Connor :


--
nosy: +jcon

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



[issue13087] C BufferedReader seek() is inconsistent with UnsupportedOperation for unseekable streams

2011-10-01 Thread John O'Connor

New submission from John O'Connor :

The C implementation of BufferedReader.seek() does not throw an 
UnsupportedOperation exception when its underlying stream is unseekable IF the 
current buffer can accommodate the seek in memory. It probably saves a few 
cycles for the seekable streams but, I think currently, it is inconsistent with 
the _pyio implementation and documentation.

--
components: IO
files: unseekable.patch
keywords: patch
messages: 144751
nosy: haypo, jcon, pitrou
priority: normal
severity: normal
status: open
title: C BufferedReader seek() is inconsistent with UnsupportedOperation for 
unseekable streams
type: behavior
versions: Python 3.2, Python 3.3
Added file: http://bugs.python.org/file23287/unseekable.patch

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



[issue12807] Optimization/refactoring for {bytearray, bytes, unicode}.strip()

2011-10-01 Thread John O'Connor

John O'Connor  added the comment:

The patch no longer applies cleanly. Is there enough interest in this to 
justify rebasing?

--
title: Optimizations for {bytearray,bytes,unicode}.strip() -> 
Optimization/refactoring for {bytearray,bytes,unicode}.strip()

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



[issue12053] Add prefetch() for Buffered IO (experiment)

2011-10-03 Thread John O'Connor

John O'Connor  added the comment:

Here is an update with the C implementation. I think a working prototype will 
be helpful before another round on python-dev. 


I'm not sure how to handle unseekable, non-blocking streams where the read 
returns before `skip` bytes are exhausted. If prefetch() returns 0, then the 
caller would then have to use tell() to ensure subsequent reads are sane. In 
other words it seems prefetch() will leave the stream in an unpredictable 
state. Antoine, what are your thoughts?

--
Added file: http://bugs.python.org/file23308/prefetch.patch

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



[issue13152] textwrap: support custom tabsize

2011-10-11 Thread John Feuerstein

New submission from John Feuerstein :

The textwrap module calls .expandtabs() to expand tabs to spaces.

This patch adds support for a custom tabsize, so that .expandtabs(tabsize) is 
called instead.

Includes test case.

--
components: Library (Lib)
files: textwrap_tabsize.diff
keywords: patch
messages: 145341
nosy: jfeuerstein
priority: normal
severity: normal
status: open
title: textwrap: support custom tabsize
type: feature request
versions: Python 3.3
Added file: http://bugs.python.org/file23376/textwrap_tabsize.diff

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



[issue12807] Optimization/refactoring for {bytearray, bytes, unicode}.strip()

2011-10-11 Thread John O'Connor

John O'Connor  added the comment:

New patch.

Please double check the removal of _PyUnicode_XStrip.

--
Added file: http://bugs.python.org/file23383/stringlib_strip2.patch

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



[issue12807] Move strip() to stringlib

2011-10-11 Thread John O'Connor

Changes by John O'Connor :


--
title: Optimization/refactoring for {bytearray, bytes, unicode}.strip() -> Move 
strip() to stringlib

___
Python tracker 
<http://bugs.python.org/issue12807>
___
___
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

2011-10-12 Thread John O'Connor

Changes by John O'Connor :


--
nosy: +jcon

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



[issue13217] Missing header dependencies in Makefile

2011-10-18 Thread John O'Connor

New submission from John O'Connor :

I think ucs{1,2,4}lib.h, asciilib.h and a few other files should be in the 
Makefile deps list for unicodeobject.c. 

Patch included.

--
components: Build
files: makefile.patch
keywords: patch
messages: 145881
nosy: haypo, jcon, pitrou
priority: normal
severity: normal
status: open
title: Missing header dependencies in Makefile
type: behavior
versions: Python 3.2, Python 3.3
Added file: http://bugs.python.org/file23456/makefile.patch

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



[issue13288] SSL module doesn't allow access to cert issuer information

2011-10-28 Thread John Nagle

New submission from John Nagle :

The SSL module still doesn't return much information from the
certificate.  SSLSocket.getpeercert only returns a few basic items
about the certificate subject.  You can't retrieve issuer information,
and you can't get the extensions needed to check if a cert is an EV cert.

With the latest flaps about phony cert issuers, (another CA compromise hit the 
news today) it's worth having issuer info available.
It was available in the old M2Crypto module, but not in the current Python SSL 
module.

John Nagle

--
components: Library (Lib)
messages: 146579
nosy: nagle
priority: normal
severity: normal
status: open
title: SSL module doesn't allow access to cert issuer information
versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3, Python 3.4

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



[issue1336] subprocess.Popen hangs when child writes to stderr

2011-10-31 Thread john doe

john doe  added the comment:

The following piece of code does not seem to be thread-safe:

gc.disable()
try:
os.fork()
except:
...

If calling subprocess.Popen() is supposed to work from threads without any 
particular protection, then a lock is needed in subprocess.py:

try:
   spawn_lock.acquire()
   gc.disable()
   try:
   os.fork()
   except:
   ...
finally:
   spawn_lock.release()

Such issues are very difficult to reproduce and to track. The documentation 
should at least mention that calling gc.enable() may cause subprocess() to hang!

The following issue seems to be relevant: http://bugs.python.org/issue12739

--
nosy: +ita1024

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



[issue12567] curses implementation of Unicode is wrong in Python 3

2011-11-07 Thread John Feuerstein

Changes by John Feuerstein :


--
nosy: +john.feuerstein

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



[issue13152] textwrap: support custom tabsize

2011-11-07 Thread John Feuerstein

John Feuerstein  added the comment:

textwrap_tabsize_v2.diff:

* Moved the tabsize parameter to the end of the parameter list
* Added documentation update
* Made the test case more obvious

--
Added file: http://bugs.python.org/file23624/textwrap_tabsize_v2.diff

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



[issue13365] str.expandtabs documentation is wrong

2011-11-07 Thread John Feuerstein

New submission from John Feuerstein :

The documentation for str.expandtabs([tabsize]) is wrong:
 
"Return a copy of the string where all tab characters are replaced by one or 
more spaces, depending on the current column and the given tab size. [...]"

This should read "zero or more spaces":

>>> 'a\tb'.expandtabs(0)
'ab'
>>> 'a\tb'.expandtabs(-1)
'ab'

The description in Objects/unicodeobject.c does not include this error.

--
assignee: docs@python
components: Documentation
files: expandtabs_doc.diff
keywords: patch
messages: 147222
nosy: docs@python, john.feuerstein
priority: normal
severity: normal
status: open
title: str.expandtabs documentation is wrong
versions: Python 3.3
Added file: http://bugs.python.org/file23625/expandtabs_doc.diff

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



[issue9530] integer undefined behaviors

2011-11-19 Thread John Regehr

John Regehr  added the comment:

This is great.  I'd be happy to re-run the tests sometime, and also we're 
talking with the LLVM folks about getting our patches into the main LLMM tree.  
Basically it'll act as a more powerful -ftrapv, and the error message will be 
much better than "aborted".

--

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



[issue9530] integer undefined behaviors

2011-11-21 Thread John Regehr

John Regehr  added the comment:

Hi Mark, yes you can run the overflow checker but "easy instructions" depends 
on whether you feel like building your own LLVM.  It is not at all difficult, 
but it's certainly not as easy as "apt-get install ...".

Patch and instructions are here:

  http://embed.cs.utah.edu/ioc/

If/when we get this into LLVM (the earliest possible release containing IOC 
will be 3.1), I'll let you know.  Thanks again.

--

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



[issue13521] Make dict.setdefault() atomic

2011-12-09 Thread John O'Connor

Changes by John O'Connor :


--
nosy: +jcon

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



[issue11900] 2.7.1 unicode subclasses not calling __str__() for print statement

2011-12-15 Thread John Nagle

John Nagle  added the comment:

This has nothing to do with Python 3.  There's a difference in __str__ handling 
between Python 2.6 and Python 2.7.2.  It's enough to crash BeautifulSoup:

[Thread-8] Unexpected EXCEPTION while processing page 
"http://www.verisign.com": global name '__str__' is not defined
[Thread-8] Traceback (most recent call last):
...
[Thread-8]   File "C:\projects\sitetruth\BeautifulSoup.py", line 646, in 
prettify
[Thread-8] return self.__str__(encoding, True)
[Thread-8]   File "C:\projects\sitetruth\BeautifulSoup.py", line 621, in __str__
[Thread-8] contents = self.renderContents(encoding, prettyPrint, 
indentContents)
[Thread-8]   File "C:\projects\sitetruth\BeautifulSoup.py", line 656, in 
renderContents
[Thread-8] text = c.__str__(encoding)
[Thread-8]   File "C:\projects\sitetruth\BeautifulSoup.py", line 415, in __str__
[Thread-8] return "" % NavigableString.__str__(self, encoding)
[Thread-8]   File "C:\projects\sitetruth\BeautifulSoup.py", line 393, in 
__unicode__
[Thread-8] return __str__(self, None)
[Thread-8] NameError: global name '__str__' is not defined

The class method that's failing is simply

class NavigableString(unicode, PageElement):
...
def __unicode__(self):
return __str__(self, None)    EXCEPTION RAISED HERE 

def __str__(self, encoding=DEFAULT_OUTPUT_ENCODING):
if encoding:
return self.encode(encoding)
else:
return self

Using __str__ in the global namespace is probably wrong, and in a later version 
of BeautifulSoup, that code is changed to

def __unicode__(self):
return str(self).decode(DEFAULT_OUTPUT_ENCODING)

which seems to work.  However, it is a real change from 2.6 to 2.7 that breaks 
code.

--
nosy: +nagle

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



[issue12053] Add prefetch() for Buffered IO (experiment)

2011-05-28 Thread John O'Connor

John O'Connor  added the comment:

I started a draft in python. I am attaching the _pyio version along with tests. 
I will continue work on the C implementation and eventually documentation if 
this is well received. It seems straightforward, I am interested to see what 
you guys think.

Also, there are now 2 places which use hasattr(self, "peek"). I was wondering 
if it would make sense to add peek() to BufferedIOBase and raise 
UnsupportedOperation or return b"".

Some benchmarks..

$ ./python -m timeit -s "from _pyio import open;f = open('LICENSE', 'rb'); 
b=bytearray(128)" 'while f.prefetch(b, 4, 4): pass'
_pyio.BufferedIOBase.prefetch:
10 loops, best of 3: 10.6 usec per loop
_pyio.BufferedReader.prefetch:
10 loops, best of 3: 6 usec per loop

$ ./python -m timeit -s "from _pyio import open;f = open('LICENSE', 
'rb');b=bytearray(4);" 'while f.read(4): f.readinto(b)'
10 loops, best of 3: 5.07 usec per loop

--
keywords: +patch
Added file: http://bugs.python.org/file22168/issue12053-pyio.patch

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



[issue12053] Add prefetch() for Buffered IO (experiment)

2011-05-28 Thread John O'Connor

Changes by John O'Connor :


Added file: http://bugs.python.org/file22169/issue12053-tests.patch

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



[issue12229] Remove unused variable in bufferedio.c

2011-05-31 Thread John O'Connor

New submission from John O'Connor :

Remove second (unused) argument to _bufferedreader_peek_unlocked()

--
components: IO
files: bufferedreader_peek.patch
keywords: patch
messages: 137391
nosy: haypo, jcon, pitrou
priority: normal
severity: normal
status: open
title: Remove unused variable in bufferedio.c
versions: Python 3.3
Added file: http://bugs.python.org/file22214/bufferedreader_peek.patch

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



[issue2091] file accepts 'rU+' as a mode

2011-05-31 Thread John O'Connor

John O'Connor  added the comment:

It seems to me that adding the proper check is a good idea. It also may not be 
obvious to some that 'U' is now more or less an alias for 'r'. I have updated 
the patch so that it at least applies.

I also removed a redundant `reading = 1`

--
nosy: +jcon
Added file: http://bugs.python.org/file22217/issue2091-2.patch

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



[issue1152248] Enhance file.readlines by making line separator selectable

2011-05-31 Thread John O'Connor

Changes by John O'Connor :


--
nosy: +jcon

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



[issue11197] information leakage with SimpleHTTPServer

2011-05-31 Thread John O'Connor

Changes by John O'Connor :


--
nosy: +jcon

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



[issue8578] PyWeakref_GetObject

2011-05-31 Thread John O'Connor

Changes by John O'Connor :


--
nosy: +jcon

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



[issue10399] AST Optimization: inlining of function calls

2011-05-31 Thread John O'Connor

Changes by John O'Connor :


--
nosy: +jcon

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



[issue9858] Python and C implementations of io are out of sync

2011-06-01 Thread John O'Connor

Changes by John O'Connor :


--
nosy: +jcon

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



[issue12268] file readline, readlines & readall methods can lose data on EINTR

2011-06-05 Thread John O'Connor

Changes by John O'Connor :


--
nosy: +jcon

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



[issue12169] Factor out common code for d2 commands register, upload and upload_docs

2011-06-09 Thread John Edmonds

John Edmonds  added the comment:

I'd like to try tackling this issue.  I've made a patch that moves 
encode_multipart from upload_docs to the distutils2.command module and changed 
the register and upload commands to use this function.

--
keywords: +patch
nosy: +John.Edmonds
Added file: http://bugs.python.org/file22309/patch.diff

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



[issue12169] Factor out common code for d2 commands register, upload and upload_docs

2011-06-11 Thread John Edmonds

John Edmonds  added the comment:

Here is the patch, re-written for the packaging module.

--
Added file: http://bugs.python.org/file22330/patch.diff

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



[issue1602133] non-framework built python fails to define environ properly

2011-06-16 Thread John Whitney

John Whitney  added the comment:

I have also been experiencing this problem with _environ (using the latest 
Python - 2.7.2), and this patch works great. I'd love to see it committed so 
that I don't have to patch Python.

--
nosy: +jjw

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



[issue5231] Change format of a memoryview

2011-06-20 Thread John O'Connor

Changes by John O'Connor :


--
nosy: +jcon

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



[issue10181] Problems with Py_buffer management in memoryobject.c (and elsewhere?)

2011-06-20 Thread John O'Connor

Changes by John O'Connor :


--
nosy: +jcon

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



[issue12169] Factor out common code for d2 commands register, upload and upload_docs

2011-06-25 Thread John Edmonds

John Edmonds  added the comment:

Thanks for reviewing the patch.  I don't believe I received an email for the 
review.  I think I have addressed your comment about the usage of str(body) by 
removing the call to str() and changing the tests to use byte literals.

As for the content-length changing in the tests, that is because 
encode_multipart uses '\r\n' to end lines while the previous code only ended 
lines in '\n'.

--
Added file: http://bugs.python.org/file22478/patch.diff

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



[issue11549] Build-out an AST optimizer, moving some functionality out of the peephole optimizer

2011-06-29 Thread John O'Connor

Changes by John O'Connor :


--
nosy: +jcon

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



[issue8728] 2.7 regression in httplib.py: AttributeError: 'NoneType' object has no attribute 'makefile'

2011-07-14 Thread John Doe

Changes by John Doe :


--
nosy: +John.Doe

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



[issue12639] msilib Directory.start_component() fails if keyfile is not None

2011-07-25 Thread John Keeping

New submission from John Keeping :

If msilib.Directory.start_component() is called with the keyfile argument not 
None then it attempts to call self.cab.gen_id(self.absolute, keyfile) but the 
msilib.CAB.gen_id() method takes only two arguments (not three).

--
components: Windows
files: msilib.gen_id.patch
keywords: patch
messages: 141098
nosy: john.keeping
priority: normal
severity: normal
status: open
title: msilib Directory.start_component() fails if keyfile is not None
versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3, Python 3.4
Added file: http://bugs.python.org/file22751/msilib.gen_id.patch

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



[issue12688] ConfigParser.__init__(iterpolation=None) documentation != behavior

2011-08-03 Thread John Simon

New submission from John Simon :

The ConfigParser docs say that when __init__ is called with interpolation=None, 
no interpolation occurs. But when this is done in Python 3.2.1, it actually 
results in an AttributeError upon getting or setting a value, due to 
self._interpolation being set to None.

This incredibly simple patch brings the behavior inline with the docs.

--
components: Library (Lib)
files: patch.txt
messages: 141615
nosy: zildjohn01
priority: normal
severity: normal
status: open
title: ConfigParser.__init__(iterpolation=None) documentation != behavior
type: behavior
Added file: http://bugs.python.org/file22832/patch.txt

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



[issue12805] Optimzations for bytes.join() et. al

2011-08-21 Thread John O'Connor

New submission from John O'Connor :

I noticed there are a few more common cases that can be sped up in bytes.join().

When:
 - The sequence length and separator length are both 0
 - The separator length is 0 or 1
 - The separator string contains only 1 distinct byte

These could also be applied to other sequence types.

for i in {{0..5}}; do
./python -m timeit -s "f=open('/usr/share/dict/words', 'rb'); L=f.readlines()" \
"b' '.join(L)"; 
done

- BEFORE -
100 loops, best of 3: 3.79 msec per loop
100 loops, best of 3: 3.5 msec per loop
100 loops, best of 3: 3.75 msec per loop
- AFTER -
100 loops, best of 3: 2.81 msec per loop
100 loops, best of 3: 2.81 msec per loop
100 loops, best of 3: 3.03 msec per loop

~20% speedup

Same test on a smaller list (lines from LICENSE file) yields a similar 15-20% 
speedup.
Same test on L = [b'1', b'2', b'3'] yields 10% speedup

--
components: Interpreter Core
files: bytes_join_optimization.patch
keywords: patch
messages: 142650
nosy: benjamin.peterson, ezio.melotti, haypo, jcon, pitrou
priority: normal
severity: normal
status: open
title: Optimzations for bytes.join() et. al
type: performance
versions: Python 3.3
Added file: http://bugs.python.org/file22976/bytes_join_optimization.patch

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



[issue12805] Optimizations for bytes.join() et. al

2011-08-21 Thread John O'Connor

Changes by John O'Connor :


--
title: Optimzations for bytes.join() et. al -> Optimizations for bytes.join() 
et. al

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



[issue12807] Optimizations for {bytearray,bytes,unicode}.strip()

2011-08-21 Thread John O'Connor

New submission from John O'Connor :

bytearray() is using a less efficient implementation of split() than its 
similar friends bytes and unicode.

I added a couple extra checks to return early in {bytes,unicode} split().
 - if length is 0
 - if left strip removed all bytes

Looking at just how similar these 3 implementations are I feel that we could 
also unify/generalize them into one generic helper implementation and leave the 
object marshaling up to the type specific methods.

--
components: Interpreter Core
files: strip_perf.patch
keywords: patch
messages: 142660
nosy: benjamin.peterson, ezio.melotti, haypo, jcon, pitrou
priority: normal
severity: normal
status: open
title: Optimizations for {bytearray,bytes,unicode}.strip()
type: performance
versions: Python 3.3
Added file: http://bugs.python.org/file22982/strip_perf.patch

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



[issue11159] Sax parser crashes if given unicode file name

2011-08-21 Thread John Chandler

John Chandler  added the comment:

Confirmed about not being an issue in Python 3. Just checked with Python 
3.3.0a0 and the example works fine - no exception raised.

--
nosy: +John.Chandler

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



[issue12820] Tests for Lib/xml/dom/minicompat.py

2011-08-22 Thread John Chandler

New submission from John Chandler :

The Lib/xml/dom/minicompat.py module doesn't appear to have any test coverage, 
probably because it's not the largest or most exciting of modules! :-) I 
therefore attach a patch to add test coverage for the EmptyNodeList and 
NodeList classes. I can add tests for the defproperty function if this patch 
proves acceptable.

The patch adds a new file (Lib/test/test_xml_dom_minicompat.py) and modifies 
one line of an existing file (Lib/test/xmltests.py)

I've used Python 3.3.0a0, courtesy of Brett's devinabox, but should be 
back-portable to older versions of Python.

--
components: Tests
files: minicompat_tests.patch
keywords: patch
messages: 142779
nosy: John.Chandler
priority: normal
severity: normal
status: open
title: Tests for Lib/xml/dom/minicompat.py
type: behavior
versions: Python 3.3
Added file: http://bugs.python.org/file23010/minicompat_tests.patch

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



[issue10408] Denser dicts and linear probing

2011-08-23 Thread John O'Connor

Changes by John O'Connor :


--
nosy: +jcon

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



[issue12807] Optimizations for {bytearray,bytes,unicode}.strip()

2011-08-24 Thread John O'Connor

John O'Connor  added the comment:

You are right about those lines in particular; 'dubious' as you say.
Though, the point overall was that the general implementation was noticeably
faster (regardless of those smaller changes).

However, I do think that the single check for len == 0 saves time
particularly
from do_xstrip where we call _getbuffer().

I see. I must have been trigger happy.

> > diff -r b5ccdf7c032a Python/bltinmodule.c
> > Binary file Python/bltinmodule.c has changed
>
> Uh, what's this? bltinmodule.c shouldn't be considered a binary file.
> It probably means you added a NUL byte in it by mistake.
>
> I didn't touch that file at all. I'm not sure what that is. :-P

> Looking at just how similar these 3 implementations are I feel that we
> > could also unify/generalize them into one generic helper implementation
> > and leave the object marshaling up to the type specific methods.
>
> You could put it in Objects/stringlib.
>

I figured. I will when I am able to get to it.

- John

--
Added file: http://bugs.python.org/file23040/unnamed

___
Python tracker 
<http://bugs.python.org/issue12807>
___
Antoine Pitrou <mailto:pit...@free.fr";>pit...@free.fr> added 
the comment:

+    if (len == 0) {
+        if (PyByteArray_CheckExact(self)) {
+            Py_INCREF(self);
+            return (PyObject *)self;
+        }
+        return PyByteArray_FromStringAndSize(NULL, 0);
+    }

This looks like a dubious micro-optimization. If len == 0,
all loops will exit early anyway (same for similar snippets in bytesobject.c 
and unicodeobject.c).
You are right about 
those lines in particular; 'dubious' as you say. Though, the 
point overall was that the general implementation was noticeably
faster (regardless of those smaller 
changes). However, I do think that the single 
check for len == 0 saves time particularlyfrom do_xstrip where we 
call _getbuffer().

+    if (i == 0 && j == len && PyByteArray_CheckExact(self)) 
{
+        Py_INCREF(self);
+        return (PyObject *)self;
+    }

bytearray objects are mutable, so you can't return the same object without 
breaking expected semantics. e.g.:
I see. I must have been trigger 
happy.
> diff -r b5ccdf7c032a Python/bltinmodule.c
> Binary file Python/bltinmodule.c has changed

Uh, what's this? bltinmodule.c shouldn't be considered a binary 
file.
It probably means you added a NUL byte in it by mistake.
I didn't touch that file at 
all. I'm not sure what that is. :-P

> Looking at just how similar these 3 implementations are I feel that we
> could also unify/generalize them into one generic helper implementation
> and leave the object marshaling up to the type specific methods.

You could put it in 
Objects/stringlib.I figured. I will when I 
am able to get to it.- 
John
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12807] Optimizations for {bytearray,bytes,unicode}.strip()

2011-08-24 Thread John O'Connor

Changes by John O'Connor :


Removed file: http://bugs.python.org/file23040/unnamed

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



[issue12807] Optimizations for {bytearray,bytes,unicode}.strip()

2011-08-24 Thread John O'Connor

John O'Connor  added the comment:

Antoine Pitrou  added the comment:

> This looks like a dubious micro-optimization. If len == 0,
> all loops will exit early anyway (same for similar snippets in bytesobject.c 
> and unicodeobject.c).

You are right about those lines in particular; 'dubious' as you say. 
Though, the point overall was that the general implementation was noticeably
faster (regardless of those smaller changes). 

However, I do think that the single check for len == 0 saves time particularly
from do_xstrip where we call _getbuffer().


> bytearray objects are mutable, so you can't return the same object without 
> breaking expected semantics. e.g.:

I see. I must have been trigger happy.


> diff -r b5ccdf7c032a Python/bltinmodule.c
> Binary file Python/bltinmodule.c has changed

> Uh, what's this? bltinmodule.c shouldn't be considered a binary file.
> It probably means you added a NUL byte in it by mistake.

I didn't touch that file at all. I'm not sure what that is. :-P

> You could put it in Objects/stringlib.

I figured. I will when I am able to get to it.

--

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



[issue12820] Tests for Lib/xml/dom/minicompat.py

2011-08-26 Thread John Chandler

John Chandler  added the comment:

Cool, thanks for the feedback! :-)

I'll make the appropriate changes to the tests and add some coverage for 
defproperty as soon as I can.

John

--

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



[issue12941] add random.pop()

2011-09-08 Thread John Feuerstein

New submission from John Feuerstein :

This patch against current hg tip (72314:92842e347d98) adds random.pop():

pop(self, seq) method of Random instance
Remove and return a random element from a non-empty sequence.

Includes test case.

--
components: Library (Lib)
files: random_pop.diff
keywords: patch
messages: 143748
nosy: jfeuerstein
priority: normal
severity: normal
status: open
title: add random.pop()
type: feature request
versions: Python 3.4
Added file: http://bugs.python.org/file23120/random_pop.diff

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



[issue12941] add random.pop()

2011-09-09 Thread John Feuerstein

John Feuerstein  added the comment:

> r.pop(random.randrange(0, len(r)))

So seq[random.randrange(0, len(seq))] suddenly makes random.choice(seq) 
obsolete? There is no functional reasoning here, it's convenience for a common 
operation.

> Not all the sequences have a .pop() method.

Not all sequences support indexing or item assignment either:

>>> random.choice({1, 2})
TypeError: 'set' object does not support indexing
>>> random.shuffle("abc")
TypeError: 'str' object does not support item assignment
...

> I'd rather see random.choice support sets: ...
> But that's another (rejected) issue; see issue 7522.

So the implicit requirement for random.choice() is support for indexing.
The implicit requirement for random.shuffle() is support for indexing and item 
assignment. The implicit requirement for random.pop() is support for 
seq.pop()...

I don't think random's convenience functions should validate (or even worse, 
convert) input. It's actually great that they are thin wrappers without magic, 
resulting in the same behaviour as if done without them.

> self.assertIn(pop([25, 75]), [25, 75])
> These should also verify that the element is not in the list anymore.
> Also other test with different (and possibly wrong) input types should be 
> added.

This is true for many convenience functions in random. I've considered doing 
that at first and came to the conclusion that the tests for random should test 
the behaviour specific to random, not that of the underlying functionality?

So seq[random] should test for random behaviour, not that indexing of seq 
itself works correctly. Similarly, seq.pop(random) should test for random 
behaviour and not for a working seq.pop()?

All we would do here is duplicate tests not related to random.

Please correct me if I'm wrong. I'm glad that this started a discussion.

--

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



[issue12941] add random.pop()

2011-09-09 Thread John Feuerstein

John Feuerstein  added the comment:

> The test doesn't have to check that seq.pop() is working fine (there are 
> other tests for that) but that it's actually called and that it pops the 
> right element from the input sequence (and not e.g. from a copy of the 
> sequence that might have been created at some point).

I agree, that makes sense.

> One use case I might think of is picking all the elements of a sequence until 
> there are no more left, without risking to pick the same element twice.  The 
> same result can be achieved by shuffling the sequence and iterate over the 
> elements though (that doesn't actually leave you with an empty sequence, but 
> that's probably just a unimportant side-effect).

One problem with shuffling in this use case is that you lose the otherwise 
original order of the remaining elements, so there is no way to return from 
"pop random elements" to "pop elements in order" (without working on a shallow 
copy). However, I would agree that this is rather uncommon.

Feel free to close this as "wont fix", after all it is trivial for the user to 
randomly pop elements out of a sequence himself (see above).

There might be other use cases. If nothing else, there's at least issue 12941 
to reference now.

Thanks!

--

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



[issue12807] Optimizations for {bytearray,bytes,unicode}.strip()

2011-09-09 Thread John O'Connor

John O'Connor  added the comment:

Moved {l,r,}strip to stringlib as well as the bloom filters from unicodeobject. 
I think it cleans things up nicely. Now there is one implementation for all 3 
types. This patch also improves performance for bytearray and slightly for 
bytes. I see no delta for unicodeobject.

Added a test case for the mistake I made before (returning inc ref for mutable 
type).

grep -R couldn't find any other references to _PyUnicode_XStrip so I removed 
it. Though, someone with better knowledge of this should confirm.

--
Added file: http://bugs.python.org/file23124/stringlib_strip.patch

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



[issue12807] Optimizations for {bytearray,bytes,unicode}.strip()

2011-09-09 Thread John O'Connor

Changes by John O'Connor :


Removed file: http://bugs.python.org/file22982/strip_perf.patch

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



[issue877121] configure detects incorrect compiler optimization

2010-08-18 Thread John Levon

John Levon  added the comment:

That's a little abrupt. Whilst it would be nice if the compiler had a correct 
return value, it occurs with multiple compilers, and I pointed
you to a suitable workaround Python could employ. Even if Studio gets fixed, 
there are previous releases out there for a long time.

--

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



[issue877121] configure detects incorrect compiler optimization

2010-08-18 Thread John Levon

John Levon  added the comment:

Even worse, a nasty hack was added just for Intel's compiler as seen in
http://bugs.python.org/issue1162001

--

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



[issue6715] xz compressor support

2010-08-19 Thread John Reese

Changes by John Reese :


--
nosy: +jreese

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



[issue1495802] cygwin: popen3 lock up

2010-08-22 Thread John Pham

John Pham  added the comment:

last time I use - it is still a problem

--
nosy: +jpham
Added file: http://bugs.python.org/file18611/unnamed

___
Python tracker 
<http://bugs.python.org/issue1495802>
___

<!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
-->


last time I use - it is still a problem> Subject: [issue1495802] 
cygwin: popen3 lock up> To: jpsc986...@users.sourceforge.net> 
From: rep...@bugs.python.org> Date: Sun, 22 Aug 2010 10:31:34 
+> > > Mark Lawrence <breamore...@yahoo.co.uk> 
added the comment:> > Any Cygwin/Windows people interested in 
this, or can it be closed?> > --> nosy: 
+BreamoreBoy> versions: +Python 2.7, Python 3.1, Python 3.2 -Python 
2.6> > ___> Python 
tracker <rep...@bugs.python.org>> 
<http://bugs.python.org/issue1495802>;> 
___ 

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



[issue1209447] os.path.join() fails if 2nd arg is a UNC path

2010-08-26 Thread John Ehresman

John Ehresman  added the comment:

I say close it since it is a change in behavior and shouldn't go in a point 
release.  I'm happy to see it fixed in 3.1.

--
status: open -> closed

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



[issue9745] MSVC .pdb files not created by python 2.7 distutils

2010-09-02 Thread John Ehresman

New submission from John Ehresman :

.pdb files are not created because /pdb:None is set as an option on line 415 of 
msvc9compiler.py.  Removing the /pdb:None works to write the .pdb file and 
allow symbols to be loaded in the VS 2008 debugger in the one extension I 
tried.  Anyone know why /pdb:None was added?

--
components: Windows
messages: 115389
nosy: jpe
priority: normal
severity: normal
status: open
title: MSVC .pdb files not created by python 2.7 distutils
versions: Python 2.7

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



[issue9846] ZipExtFile provides no mechanism for closing the underlying file object

2010-09-13 Thread John Admanski

New submission from John Admanski :

When creating a ZipExtFile through ZipFile.open, the if the original ZipFile 
object was created with a filename then a new file object will be opened and 
given to the ZipExtFile to use for its file operations. There is no explicit 
mechanism that will allow you to release this file.

ZipExtFile does have an (undocumented?) close method, but this won't actually 
close the file object that underlies it; probably because it has no way of 
knowing if it actually owns the file object or if it just has a reference to a 
file object that belongs to the ZipFile.

You can work around this by destroying references to the ZipExtFile and letting 
the file's __del__ handle the close for you but this relies on implementation 
details of ZipExtFile.

Found in Python 3.1 but a look at svn.python.org suggests that this problem is 
still there in 2.7 and 3.2; however, I haven't actually tried it with them.

--
components: Library (Lib)
messages: 116322
nosy: john.admanski
priority: normal
severity: normal
status: open
title: ZipExtFile provides no mechanism for closing the underlying file object
type: feature request
versions: Python 3.1

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



[issue9846] ZipExtFile provides no mechanism for closing the underlying file object

2010-09-13 Thread John Admanski

John Admanski  added the comment:

I'm not sure that's much of an improvement on the existing behavior, though; as 
I mentioned you can already work around it by killing all the references to the 
ZipExtFile and the underlying file object will get automatically closed if the 
ZipExtFile is the only object using it, so adding an explicit __del__ that does 
the same thing isn't much of an improvement.

Since ZipExtFile is supposed to be a file-like object (albeit a read-only one) 
it would make sense to be able to release the underlying resources the same way 
you normally do with a file...by closing it.

--

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



  1   2   3   4   5   6   7   8   9   10   >