[issue25758] ensurepip/venv broken on Windows if path includes unicode

2015-11-28 Thread Laura Creighton

Changes by Laura Creighton :


--
nosy: +Marcus.Smith, dstufft, ncoghlan, paul.moore

___
Python tracker 

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



[issue25741] Usual Installation Directory

2015-11-28 Thread Eryk Sun

Eryk Sun added the comment:

> LOCALAPPDATA is set by the operating system, typically to 
> C:\Users\\AppData\Local (at least since Vista I
> think? Certainly since Win7

Vista introduced LOCALAPPDATA, so there's no problem referencing it in the docs 
for 3.5+. 

On a related note, section 3.4.4.1 [1] could be changed to use %LOCALAPPDATA% 
instead of referring to the shell function SHGetFolderPath and 
CSIDL_LOCAL_APPDATA. 

[1]: https://docs.python.org/3.5/using/windows.html#customization-via-ini-files

--
nosy: +eryksun

___
Python tracker 

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



[issue9504] signal.signal/signal.alarm not working as expected

2015-11-28 Thread Ronald Oussoren

Ronald Oussoren added the comment:

Victor: read(2) and recv(2) are defined as returning all available data when 
interrupted by a signal and might therefore not return an error. The same is 
true for write(2): it returns the number of bytes written when there are any 
bytes written (instead of setting errno to SIGINT and returning an error).

I'd expect the C implementation of readall to behave the same as the Python 
implementation: a signal handler that raises an exception can cause data loss 
due to discarding the buffer that's used to collect the data.  The data loss in 
the script isn't worse than it currently is, AFAIK it would currently lose data 
due to raising the exception just after the call to readall in the next loop 
through the eval loop.

If I read the issue correctly the signal handling issue mentioned here is 
basically similar to the one in this scriptlet:

# BEGIN
import signal, sys
import subprocess

def handler(sig, frames):
raise RuntimeError("Alarm!")

signal.signal(signal.SIGALRM, handler)
signal.alarm(5)
b = sys.stdin.buffer.raw.readall()
print(len(b))
signal.alarm(0)
#END

When you run this with a large file on stdin (I've used /dev/zero) the script 
will continue to run indefinitely and cannot be cleanly interrupted at all (on 
my system its eventually killed by the system due to running out of its rlimit 
limitations, otherwise it can only be killed by sending it an uncatchable 
signal like SIGKILL or SIGABRT).

--
nosy: +ronaldoussoren

___
Python tracker 

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



[issue25751] ctypes.util , Shell Injection in find_library()

2015-11-28 Thread Bernd Dietzel

Bernd Dietzel added the comment:

i made the ubuntu link readable for everyone.

--

___
Python tracker 

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



[issue25732] functools.total_ordering does not correctly implement not equal behaviour

2015-11-28 Thread Raymond Hettinger

Changes by Raymond Hettinger :


--
assignee: ncoghlan -> rhettinger

___
Python tracker 

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



[issue25757] Subclasses of property lose docstring

2015-11-28 Thread Torsten Landschoff

Torsten Landschoff added the comment:

Prompted by Emanuel's comment I ran the test with repetitions. This does not 
actually test his assertion that I missed a decref since he referred to the 
error case when setting the __doc__ key of the instance dict fails. But I was 
curious none the less.

I was shocked that this failed with

```
torsten@defiant:~/mirror/cpython$ make test TESTOPTS="-R 3:2 test_property"
...
test test_property failed -- Traceback (most recent call last):
  File "/home/torsten/mirror/cpython/Lib/test/test_property.py", line 172, in 
test_property_decorator_doc_writable
self.assertEqual(sub.__class__.spam.__doc__, 'Eggs')
AssertionError: 'Spam' != 'Eggs'
```

But this was not introduced by my changes, rather it is an existing bug in the 
tests: test_property_decorator_doc_writable modifies a class created on module 
level so the second repetition sees the already updated class.

fix_repetitions.diff contains a fix for this problem (by defining the class 
locally in the test method).

While at it I introduced a refleak on purpose and this is correctly reported by 
the tests. Good to know how to test for this :-)

--
Added file: http://bugs.python.org/file41183/fix_repetitions.diff

___
Python tracker 

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



[issue25732] functools.total_ordering does not correctly implement not equal behaviour

2015-11-28 Thread Raymond Hettinger

Raymond Hettinger added the comment:

The docs are correct but are apparently misleading ("rich comparison methods" 
means all six comparison methods while "rich comparison ordering methods" means 
only the four that provide order).  That said, I think it would be perfectly 
reasonable to amend the code to supply __ne__ if it is missing.  That would be 
reduce the likelihood of bugs arising when supplied only __eq__ and one of the 
four ordering methods but not __ne__.

--
assignee:  -> ncoghlan
keywords: +patch
Added file: http://bugs.python.org/file41180/total_ordering_ne.diff

___
Python tracker 

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



[issue25732] functools.total_ordering does not correctly implement not equal behaviour

2015-11-28 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Now defined __ne__ always silently overridden.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue25741] Usual Installation Directory

2015-11-28 Thread Firat Ozgul

Firat Ozgul added the comment:

Maybe that part of the tutorial should also include a link to 
https://docs.python.org/3/using/windows.html. This document contains all the 
details for using Python on Windows.

--

___
Python tracker 

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



[issue25757] Subclasses of property lose docstring

2015-11-28 Thread Emanuel Barry

Emanuel Barry added the comment:

Looking at it again, it appears you didn't have to decref it; my bad.

Both patches LGTM.

--

___
Python tracker 

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



[issue6395] Infinite Recursion during Unpickling a codecs Object

2015-11-28 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Implementing only .__get/setstate__() doesn't fix all problem. We have 
implement also __getnewargs_ex__(). But implemented __getnewargs_ex__() has 
priority over __getnewargs__() implemented in subclasses.

And may be there are problems with other optional special methods that are 
incorrectly delegated to the stream in codecs IO classes.

I think more reliable way is to disallow delegating all special (or may be even 
private) methods. Here is a patch.

--
assignee:  -> serhiy.storchaka
nosy: +serhiy.storchaka
stage:  -> patch review
type: enhancement -> behavior
versions: +Python 3.5, Python 3.6 -Python 3.3

___
Python tracker 

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



[issue6395] Infinite Recursion during Unpickling a codecs Object

2015-11-28 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
keywords: +patch
Added file: http://bugs.python.org/file41184/codecs_stream_delegating.patch

___
Python tracker 

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



[issue18068] pickle + weakref.proxy(self)

2015-11-28 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

The weakref.proxy object delegates all attribute access to referred object, 
including special attributes used in pickling, like __class__ or __getstate__.

test.recursive is not test, but it looks as TestPickle instance for the 
pickler. It is pickled and unpickled as TestPickle instance.

>>> test.recursive.__class__

>>> test.recursive.__getstate__
>
>>> test.recursive.__reduce_ex__(2)
__getstate__ 3071478700
(, (,), 
{'recursive': }, None, 
None)
>>> pickle.loads(pickle.dumps(test.recursive, 2))
__getstate__ 3071478700
__setstate__ 3071525356
<__main__.TestPickle object at 0xb713c1ec>

Since test.recursive.recursive is test.recursive, this recursion is detected by 
pickler.

This issue is similar to issue6395, but since weakref.proxy is not 
subclassable, we can just implement correct __reduce__.

--
assignee:  -> serhiy.storchaka
nosy: +serhiy.storchaka
stage:  -> needs patch

___
Python tracker 

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



[issue25757] Subclasses of property lose docstring

2015-11-28 Thread Torsten Landschoff

Changes by Torsten Landschoff :


Added file: http://bugs.python.org/file41181/subprop_doc_r2.diff

___
Python tracker 

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



[issue25758] ensurepip/venv broken on Windows if path includes unicode

2015-11-28 Thread Dima Tisnek

New submission from Dima Tisnek:

One of my students installed Python 3.5 on Windows 10 to default location where 
user name "Łukasz" contains unicode.

Now "-m venv" and "-m ensurepip" do not work:

C:\Users\Łukasz>C:\Users\Łukasz\AppData\Local\Programs\Python\Python35-32\python.exe
 -m venv workshops
Error: Command '['C:\\Users\\\u0141ukasz\\workshops\\Scripts\\python.exe', 
'-Im', 'ensurepip', '--upgrade', '--default-pip']' returned non-zero exit 
status 1

C:\Users\Łukasz>C:\Users\Łukasz\AppData\Local\Programs\Python\Python35-32\python.exe
 -m ensurepip
Traceback (most recent call last):
  File 
"C:\Users\\u0141ukasz\AppData\Local\Programs\Python\Python35-32\lib\runpy.py", 
line 170, in _run_module_as_main
"__main__", mod_spec)
  File 
"C:\Users\\u0141ukasz\AppData\Local\Programs\Python\Python35-32\lib\runpy.py", 
line 85, in _run_code
exec(code, run_globals)
  File 
"C:\Users\\u0141ukasz\AppData\Local\Programs\Python\Python35-32\lib\ensurepip\__main__.py",
 line 4, in 
ensurepip._main()
  File 
"C:\Users\\u0141ukasz\AppData\Local\Programs\Python\Python35-32\lib\ensurepip\__init__.py",
 line 209, in _main
default_pip=args.default_pip,
  File 
"C:\Users\\u0141ukasz\AppData\Local\Programs\Python\Python35-32\lib\ensurepip\__init__.py",
 line 116, in bootstrap
_run_pip(args + [p[0] for p in _PROJECTS], additional_paths)
  File 
"C:\Users\\u0141ukasz\AppData\Local\Programs\Python\Python35-32\lib\ensurepip\__init__.py",
 line 40, in _run_pip
import pip
  File "", line 969, in _find_and_load
  File "", line 954, in _find_and_load_unlocked
  File "", line 896, in _find_spec
  File "", line 1136, in find_spec
  File "", line 1112, in _get_spec
  File "", line 1093, in _legacy_get_spec
  File "", line 444, in spec_from_loader
  File "", line 530, in 
spec_from_file_location
UnicodeEncodeError: 'mbcs' codec can't encode characters in position 0--1: 
invalid character

--
components: Unicode
messages: 255534
nosy: Dima.Tisnek, ezio.melotti, haypo
priority: normal
severity: normal
status: open
title: ensurepip/venv broken on Windows if path includes unicode
versions: Python 3.5

___
Python tracker 

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



[issue25758] ensurepip/venv broken on Windows if path includes unicode

2015-11-28 Thread SilentGhost

Changes by SilentGhost :


--
components: +Windows
nosy: +brett.cannon, eric.snow, steve.dower, tim.golden, zach.ware

___
Python tracker 

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



[issue25732] functools.total_ordering does not correctly implement not equal behaviour

2015-11-28 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

This doesn't work with new-style classes that always have __ne__ inherited from 
object.

I afraid that the only way to fix this issue is to backport Python 3 behavior 
of default __ne__, automatically fallback to __eq__.

--

___
Python tracker 

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



[issue25732] functools.total_ordering does not correctly implement not equal behaviour

2015-11-28 Thread Raymond Hettinger

Changes by Raymond Hettinger :


--
assignee: rhettinger -> ncoghlan
Added file: http://bugs.python.org/file41182/total_ordering_ne2.diff

___
Python tracker 

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



[issue25758] ensurepip/venv broken on Windows if path includes unicode

2015-11-28 Thread Eryk Sun

Eryk Sun added the comment:

The problem is that the compile_source function in Modules/zipimport.c calls 
PyUnicode_EncodeFSDefault to get an encoded string to pass as the filename 
argument of Py_CompileString. On Windows this uses the ANSI codepage (i.e. 
'mbcs'). Apparently your system's ANSI codepage doesn't map the "Ł" character. 

I reproduced the problem more simply by copying pip-7.1.2-py2.py3-none-any.whl 
to a subdirectory named "Łukasz"; adding the wheel path to sys.path; and 
attempting to execute "import pip". 

One solution is to replace Py_CompileString with Py_CompileStringObject. This 
way compile_source doesn't have to worry about encoding its pathname argument. 
A minimal patch is attached, but it needs a test.

--
keywords: +patch
nosy: +eryksun
versions: +Python 3.6
Added file: http://bugs.python.org/file41185/issue25758_1.patch

___
Python tracker 

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



[issue25732] functools.total_ordering does not correctly implement not equal behaviour

2015-11-28 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Oh, sorry. Then the patch LGTM.

--
stage: needs patch -> commit review

___
Python tracker 

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



[issue25735] math.factorial doc should mention integer return type

2015-11-28 Thread Mark Dickinson

Mark Dickinson added the comment:

[Terry]

>>> factorial(decimal.Decimal(5.2))
120

Yep, that's definitely wrong. If we want to behave the same way as for float, 
we should accept only integral Decimal values. (Though I'm not much of a fan of 
the float behaviour: I would have preferred math.factorial not to accept floats 
at all.)

--

___
Python tracker 

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



[issue25634] Add a dedicated subclass for attribute missing errors

2015-11-28 Thread Ethan Furman

Ethan Furman added the comment:

Note for posterity:  the current behavior of __getattr__ is what allows Enum to 
work correctly.

--
nosy: +ethan.furman

___
Python tracker 

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



[issue20836] Pickle Nonetype

2015-11-28 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


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

___
Python tracker 

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



[issue25732] functools.total_ordering does not correctly implement not equal behaviour

2015-11-28 Thread Raymond Hettinger

Raymond Hettinger added the comment:

In Python 2.7, __ne__ isn't inherited from object.

--

___
Python tracker 

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



[issue25732] functools.total_ordering does not correctly implement not equal behaviour

2015-11-28 Thread Raymond Hettinger

Changes by Raymond Hettinger :


--
assignee: ncoghlan -> 

___
Python tracker 

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



[issue25485] Add a context manager to telnetlib.Telnet

2015-11-28 Thread R. David Murray

R. David Murray added the comment:

Thanks, Stéphane.  I adjusted the docs...we don't seem to be very consistent 
about how we document addition of content manager support, so I picked what I 
liked best.  Also, FYI it is generally best (at this point in time) to not 
include the NEWS item, but enhancements should inlcude a what's new entry (I 
added one).

--
resolution:  -> fixed
stage: needs patch -> resolved
status: open -> closed

___
Python tracker 

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



[issue25485] Add a context manager to telnetlib.Telnet

2015-11-28 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 277824f2d133 by R David Murray in branch 'default':
#25485: Add context manager support to Telnet class.
https://hg.python.org/cpython/rev/277824f2d133

--
nosy: +python-dev

___
Python tracker 

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



[issue25732] functools.total_ordering does not correctly implement not equal behaviour

2015-11-28 Thread Raymond Hettinger

Changes by Raymond Hettinger :


Added file: http://bugs.python.org/file41186/total_ordering_ne3.diff

___
Python tracker 

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



[issue25759] Python 2.7.11rc1 not building with Visual Studio 2015

2015-11-28 Thread Kovid Goyal

New submission from Kovid Goyal:

The Pcbuild/readme.txt file implies that it is possible to build python 
2.7.11rc1 with Visual Studio 2015 (although it is not officially supported). 
However, there are at least a couple of problems, that I have encountered so 
far:

1) timemodule.c uses timezone, tzname and daylight which are no longer defined 
in visual studio, as a quick hackish workaround, one can do
#if defined _MSC_VER && MSC_VER >= 1900
#define timezone _timezone
#define tzname _tzname
#define daylight _daylight
#endif

2) More serious, the code in posixmodule.c to check if file descriptors are 
valid no longer links, since it relies on an internal structure from microsoft 
ddls, __pioinfo that no longer exists. See
https://bugs.python.org/issue23524 for discussion about this in the python 3.x 
branch

As a quick and dirty fix one could just replace _PyVerify_fd with a stub 
implementation that does nothing for _MSC_VER >= 1900

However, a proper fix should probably be made.

--
components: Interpreter Core
messages: 20
nosy: kovidgoyal
priority: normal
severity: normal
status: open
title: Python 2.7.11rc1 not building with Visual Studio 2015
type: compile error
versions: Python 2.7

___
Python tracker 

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



[issue25732] functools.total_ordering does not correctly implement not equal behaviour

2015-11-28 Thread Raymond Hettinger

Raymond Hettinger added the comment:

Nick, I'm inclined to put this in.  Only bugs can come out of the current 
arrangement.   Do you have any further thoughts?

--
assignee:  -> ncoghlan

___
Python tracker 

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



[issue23150] urllib parse incorrect handing of params

2015-11-28 Thread Martin Panter

Martin Panter added the comment:

Marking as Python 3 since you mentioned urllib.parse, rather than just urllib. 
However you need to be more specific. We already have a urllib.parse.urlsplit() 
function which seems to do what you want:

>>> urllib.parse.urlsplit("http://example.com/;;).path
'/;'

I see that the “params” bit can be dropped by urljoin(). My proposal in Issue 
22852 could probably be adapted to help with that.

--
nosy: +martin.panter
stage:  -> test needed
versions: +Python 3.4, Python 3.5, Python 3.6

___
Python tracker 

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



[issue25750] tp_descr_get(self, obj, type) is called without owning a reference to "self"

2015-11-28 Thread Jeroen Demeyer

Changes by Jeroen Demeyer :


--
type:  -> crash

___
Python tracker 

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



[issue25754] Test test_rlcompleter failed if run twice

2015-11-28 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 2e889344436e by Martin Panter in branch 'default':
Issue #25754: Allow test_rlcompleter to be run multiple times
https://hg.python.org/cpython/rev/2e889344436e

--
nosy: +python-dev

___
Python tracker 

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



[issue25754] Test test_rlcompleter failed if run twice

2015-11-28 Thread Martin Panter

Changes by Martin Panter :


--
resolution:  -> fixed
stage: commit review -> resolved
status: open -> closed

___
Python tracker 

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



[issue25759] Python 2.7.11rc1 not building with Visual Studio 2015

2015-11-28 Thread SilentGhost

Changes by SilentGhost :


--
components: +Build, Windows
nosy: +paul.moore, steve.dower, tim.golden, zach.ware

___
Python tracker 

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



[issue25759] Python 2.7.11rc1 not building with Visual Studio 2015

2015-11-28 Thread Steve Dower

Steve Dower added the comment:

The proper fix is to remove any hint in the readme file that this will work. 
Building 2.7 with VS 2015 will not work unless someone forks CPython and makes 
the updates themselves.

--

___
Python tracker 

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



[issue17620] Python interactive console doesn't use sys.stdin for input

2015-11-28 Thread Adam Bartoš

Adam Bartoš added the comment:

I've formulated a proposal regarding this issue: 
https://mail.python.org/pipermail/python-dev/2015-November/142246.html . Does 
it make sense?

--

___
Python tracker 

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



[issue22636] avoid using a shell in ctypes.util: replace os.popen with subprocess

2015-11-28 Thread Martin Panter

Martin Panter added the comment:

I think it is better to return None without an exception, to keep the current 
behaviour, and because that’s what the documentation implies.

--

___
Python tracker 

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



[issue25717] tempfile.TemporaryFile fails when dir option set to directory residing on host OS mount

2015-11-28 Thread Martin Panter

Martin Panter added the comment:

Antoine or Bohuslav, since you were involved in Issue 21679, would you be able 
to comment on fstat-failure.patch, which reverts back to ignoring most fstat() 
errors? The problem here is that fstat() seems to fail if the directory entry 
has been unlinked, and the file is on a Virtual Box shared folder filesystem.

--
nosy: +bkabrda, pitrou
stage:  -> patch review
versions: +Python 3.6

___
Python tracker 

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



[issue24363] httplib fails to handle semivalid HTTP headers

2015-11-28 Thread Martin Panter

Martin Panter added the comment:

Since the Python 2 and Python 3 branches are different, two different patches 
would be needed here. Perhaps they could share common test cases though.

Michael: I presume your proposal is for Python 2. I don’t understand the 
re.findall() expression; is there a clearer way to do whatever it is trying to 
do (or failing that, explain it in a comment)? It looks like you are trying to 
skip over spaces at the start of the first header field name. Also, it seems to 
drop support for lines folded with tabs rather than spaces.

David: The headers-only mode wouldn’t make much difference because it only 
affects parsing the “payload”. As far as the email package is concerned, the 
payload should always be empty when used by HTTP’s parse_headers().

The simplest fix (at least for the Python 3 code) would be to check each line 
against email.feedparser.headerRE before adding it to the list of lines in the 
HTTP package. This would prevent the email parser from bailing from the header 
section early, which is the main problem.

But that does seem like a bad hack and wouldn’t treat the offending line as a 
folded line, which Cory and David want. So I guess we need to make the email 
parser more flexible instead. Maybe a private FeedParser._parse_header_lines() 
method or something, that replaces feed() and close(), and defers most of the 
processing directly to _parse_headers().

--

___
Python tracker 

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



[issue25760] TextWrapper fails to split 'two-and-a-half-hour' correctly

2015-11-28 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Already fixed in issue22687.

--
nosy: +serhiy.storchaka
resolution:  -> out of date
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue25760] TextWrapper fails to split 'two-and-a-half-hour' correctly

2015-11-28 Thread Samwyse

New submission from Samwyse:

Single character words in a hyphenated phrase are not split correctly.  The 
root issue it the wordsep_re class variable.  To reproduce, run the following:

>>> import textwrap
>>> textwrap.TextWrapper.wordsep_re.split('two-and-a-half-hour')
['', 'two-', 'and-a', '-half-', 'hour']

It works if 'a' is replaces with two or more alphabetic characters.

>>> textwrap.TextWrapper.wordsep_re.split('two-and-aa-half-hour')
['', 'two-', '', 'and-', '', 'aa-', '', 'half-', 'hour']

The problem is in this part of the pattern:  (?=\w+[^0-9\W])

I confess that I don't understand the situation that would require that 
complicated of a pattern.  Why wouldn't (?=\w) would work?

--
components: Library (Lib)
messages: 28
nosy: samwyse
priority: normal
severity: normal
status: open
title: TextWrapper fails to split 'two-and-a-half-hour' correctly
type: behavior
versions: Python 2.7, Python 3.2, Python 3.3, Python 3.4

___
Python tracker 

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



[issue25759] Python 2.7.11rc1 not building with Visual Studio 2015

2015-11-28 Thread Kovid Goyal

Kovid Goyal added the comment:

OK, I had hoped to avoid having to maintain my own fork of python 2 for a while 
longer, but, I guess not. 

Could you at least tell me if there are any other issues I should be aware of, 
to avoid me having to search through the python 3 sourcecode/commit history. 

I will be happy to make my work public so others can benefit from it as well.

--

___
Python tracker 

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



[issue5784] raw deflate format and zlib module

2015-11-28 Thread Martin Panter

Martin Panter added the comment:

Here is a patch with the following changes:

* Clarified that wbits affects the container format as well as windows size
* Undid some word wrapping to make the diff simpler
* Added zero and 32 + n for decompression
* Added full list of options under decompressobj(), and link decompress() to 
that. Otherwise we end up saying decompression generates a header, when it 
really parses the header.
* Added tests for various wbits values
* Compressing with window bits = 8 not actually supported (Zlib bumps it to 9: 
.
 The change log says “Force windowBits > 8 to avoid a bug in the encoder for a 
window size of 256 bytes”.)
* Updated doc strings

--
keywords: +patch
versions: +Python 3.5, Python 3.6 -Python 3.2, Python 3.3
Added file: http://bugs.python.org/file41187/zlib-wbits.v3.patch

___
Python tracker 

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



[issue25759] Python 2.7.11rc1 not building with Visual Studio 2015

2015-11-28 Thread Steve Dower

Steve Dower added the comment:

Not off the top of my head, but you only really need to look at my commits, and 
looking for issues assigned to me is an easy way to find those.

Most of the issues are obvious once you start trying to build.

--

___
Python tracker 

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



[issue25759] Python 2.7.11rc1 not building with Visual Studio 2015

2015-11-28 Thread Kovid Goyal

Kovid Goyal added the comment:

I have it building with just two simple patches:

https://github.com/kovidgoyal/cpython/commit/fd1ceca4f21135f12ceb72f37d4ac5ea1576594d

https://github.com/kovidgoyal/cpython/commit/edb740218c04b38aa0f385188103100a972d608c

However, in developing the patches, I discovered what looks like a bug in the 
CRT close() function. If you double close a valid file descriptor it crashes, 
rather than calling the invalid parameter handler.

python -c "import os; os.close(2); os.close(2)"

crashes. This is true for python 2.7.10 built against VS 2008 as well. This 
contrasts with the behavior of double close() on other operating systems, where 
it sets errno to EBADF and does not crash.

I have not tested it with python 3.5, but I assume the bug is present there as 
well.

--
components:  -Build, Windows

___
Python tracker 

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



[issue23200] Deprecate the zlib decompressor’s flush() method

2015-11-28 Thread Martin Panter

Martin Panter added the comment:

And regarding other internal buffers and state, calling flush() or decompress() 
guarantees you get as much data as possible, but there is no error checking. 
You have to check the eof attribute to ensure everything is done, otherwise I 
don’t think there is a way to differentiate a truncated stream from a properly 
ended stream.

--

___
Python tracker 

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