[issue32958] socket module calls with long host names can fail with idna codec error

2020-07-04 Thread Joseph Hackman


Joseph Hackman  added the comment:

According to the DNS standard, hostnames with more than 63 characters per label 
(the sections between .) are not allowed 
[https://tools.ietf.org/html/rfc1035#section-2.3.1].

That said, enforcing that at the codec level might be the wrong choice. I threw 
together a quick patch moving the limits up to 250, and nothing blew up. It's 
unclear what the general usefulness of such a change would be, since DNS 
servers probably couldn't handle those requests anyway.

As for the original issue, if anybody is still doing something like that, could 
they provide a full example URL? I was unable to reproduce on HTTP (failed in a 
different place), or FTP.

--
nosy: +joseph.hackman

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



[issue29059] Windows: Python not using ANSI compatible console

2016-12-27 Thread Joseph Hackman

Joseph Hackman added the comment:

Thanks for the tip! If you hadn't said that, I probably would have written it 
into the init scripts.

I'll try to write something for python-ideas / PEP tomorrow, but have attached 
a quick patch here so I can link to this issue for an example implementation.

--
keywords: +patch
Added file: http://bugs.python.org/file46060/issue29059.patch

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



[issue29059] Windows: Python not using ANSI compatible console

2016-12-24 Thread Joseph Hackman

Joseph Hackman added the comment:

The flag is application specific. I.e. a python program that writes to console  
using ansi codes, when used on windows, will just display the codes. If the 
Output is redireced to file and then the file is printed to console using a 
console tool, the colors will show instead.

--

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



[issue29059] Windows: Python not using ANSI compatible console

2016-12-23 Thread Joseph Hackman

New submission from Joseph Hackman:

On windows, Python does not request that Windows enable VT100 for console 
output for Python.

That is to say that ANSI codes such as \033[91m will function on Mac and Linux 
Pythons, but not Windows.

As there is no good interface in core Python to the kernel32 console operations 
(and there probably shouldn't be, it would be better to be consistent), I 
suggest just flipping the bit at startup on Windows.

I would be happy to submit a patch, but seek guidance on the best location for 
addition of code to 'at startup iff a tty is attached'.

The following code solves the issue:
import platform
if platform.system().lower() == 'windows':
from ctypes import windll, c_int, byref
stdout_handle = windll.kernel32.GetStdHandle(c_int(-11))
mode = c_int(0)
windll.kernel32.GetConsoleMode(c_int(stdout_handle), byref(mode))
mode = c_int(mode.value | 4)
windll.kernel32.SetConsoleMode(c_int(stdout_handle), mode)

Please see:
https://msdn.microsoft.com/en-us/library/windows/desktop/ms686033(v=vs.85).aspx 
(Search for ENABLE_VIRTUAL_TERMINAL_PROCESSING)
https://msdn.microsoft.com/en-us/library/windows/desktop/ms683231(v=vs.85).aspx 
(As for why stdout is -11 on Windows)

--
components: Windows
messages: 283913
nosy: joseph.hackman, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: Windows: Python not using ANSI compatible console
type: behavior
versions: Python 2.7, Python 3.3, Python 3.4, Python 3.5, Python 3.6

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



[issue25788] fileinput.hook_encoded has no way to pass arguments to codecs

2016-04-27 Thread Joseph Hackman

Joseph Hackman added the comment:

Updated documentation in fileinput.rst, Doc/whatsnew/3.6.rst, Misc/NEWS and 
Misc/ACKS.

Thank you so much Serhiy for taking the time to review!

--
Added file: http://bugs.python.org/file42631/issue25788-3.patch

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



[issue25788] fileinput.hook_encoded has no way to pass arguments to codecs

2016-04-26 Thread Joseph Hackman

Joseph Hackman added the comment:

Uploading a new patch to address the issues in previous patch.

--
Added file: http://bugs.python.org/file42620/issue25788-2.patch

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



[issue25788] fileinput.hook_encoded has no way to pass arguments to codecs

2016-04-25 Thread Joseph Hackman

Joseph Hackman added the comment:

Ping.

Just wondering if anyone on the nosy list would be willing to help review my 
patch. :)

--

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



[issue25300] Enable Intel MPX (Memory protection Extensions) feature

2016-02-02 Thread Joseph Hackman

Changes by Joseph Hackman :


--
nosy: +Joseph.Hackman

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



[issue25788] fileinput.hook_encoded has no way to pass arguments to codecs

2016-02-01 Thread Joseph Hackman

Joseph Hackman added the comment:

I haven't seen OP in over 30 days, so am posting my own patch.

I've added an optional argument that defaults to strict and gets passed along.

I've updated the primary test to verify the argument passing, as well as that 
things get handled as specified in the documentation at 
https://docs.python.org/3.5/library/codecs.html

This is off-topic, but is there any way I can submit a patch that allows a 
similar fix for stdin? Presently there is no way at all to pass malformed 
unicode through fileinput using stdin that I can find.

--
keywords: +patch
nosy: +Joseph Hackman
Added file: http://bugs.python.org/file41777/issue25788.patch

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