[issue22496] urllib2 fails against IIS (urllib2 can't parse 401 reply www-authenticate headers)

2018-12-01 Thread Mathieu Dupuy


Change by Mathieu Dupuy :


--
resolution:  -> wont fix
stage:  -> resolved
status: open -> closed

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



[issue22496] urllib2 fails against IIS (urllib2 can't parse 401 reply www-authenticate headers)

2018-11-23 Thread Mathieu Dupuy


Mathieu Dupuy  added the comment:

A lot of time has passed and things have changed significantly. We now live in 
a mostly python3-world (which doesn't have the bug) and Python2 has less than 
two years before beeing put to sleep.

If nobody opposes, I offer to close this issue that I opened first.

--

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



[issue35220] delete "how do I emulate os.kill" section in Windows FAQ

2018-11-23 Thread Mathieu Dupuy


Mathieu Dupuy  added the comment:

My PR has been merged, thanks

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

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



[issue35255] delete "How do I extract the downloaded documentation" section in Windows FAQ

2018-11-15 Thread Mathieu Dupuy


Change by Mathieu Dupuy :


--
pull_requests: +9802

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



[issue35255] delete "How do I extract the downloaded documentation" section in Windows FAQ

2018-11-15 Thread Mathieu Dupuy


Change by Mathieu Dupuy :


--
assignee:  -> docs@python
components: +Documentation
nosy: +docs@python
type:  -> enhancement

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



[issue35255] delete "How do I extract the downloaded documentation" section in Windows FAQ

2018-11-15 Thread Mathieu Dupuy


New submission from Mathieu Dupuy :

I think it's been a long time since Windows/IE no longer mess up with file 
extensions, so long I can't recall anymore. I just tried on a Windows 7 + IE 11 
(released in 2013) to download the .tar.bz2 archive from docs.python.org and it 
worked alright.


To me, that entry makes Python looks bad ("the archive format we use does not 
work correctly on the most common, main desktop platform"), the problem seems 
to not exist anymore, and IMHO, is not really Python related.

I think that entry should be removed.

--
messages: 329947
nosy: deronnax
priority: normal
severity: normal
status: open
title: delete "How do I extract the downloaded documentation" section in 
Windows FAQ

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



[issue35220] delete "how do I emulate os.kill" section in Windows FAQ

2018-11-12 Thread Mathieu Dupuy


New submission from Mathieu Dupuy :

That section is a tip on how to kill process on Windows for Python prior to 2.7 
and 3.2.
3.1 end of support was April 2012 and 2.6 was October 2013, so that hasn't been 
needed for supported versions of Python for more than 5 years. Beside not being 
needed anymore for a long time, when I read it with the eyes of a Python 
profane, it makes Python looks bad, like a language from the pasts with warts 
you need to circumvent.
Let's delete that.

--
assignee: docs@python
components: Documentation
messages: 329751
nosy: deronnax, docs@python
priority: normal
pull_requests: 9750
severity: normal
status: open
title: delete "how do I emulate os.kill" section in Windows FAQ
type: enhancement
versions: Python 3.8

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



[issue15873] datetime: add ability to parse RFC 3339 dates and times

2017-12-29 Thread Mathieu Dupuy

Mathieu Dupuy <deron...@gmail.com> added the comment:

maybe it's worth adding an entry in python 3.7 "what's new" ? I think it was a 
very long awaited issue.
The opposite of isoformat() is a very frequent question from python newcomers

--

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



[issue15873] datetime: add ability to parse RFC 3339 dates and times

2017-12-13 Thread Mathieu Dupuy

Mathieu Dupuy <deron...@gmail.com> added the comment:

I finally released my work. It looks like Paul's work is more comprehensive, 
but if you want to pick one thing or two in mine, feel free.

--

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



[issue15873] datetime: add ability to parse RFC 3339 dates and times

2017-12-04 Thread Mathieu Dupuy

Mathieu Dupuy <deron...@gmail.com> added the comment:

I'm right now available again to work on this issue. I'll submit a pull
request within a week with all issues addressed

Le 4 déc. 2017 11:45 PM, "Alexander Belopolsky" <rep...@bugs.python.org> a
écrit :

>
> Alexander Belopolsky <alexander.belopol...@gmail.com> added the comment:
>
> The better is the enemy of the good here.  Given the history of this
> issue, I would rather accept a well documented restrictive parser than wait
> for a more general code to be written.  Note that we can always relax the
> parsing rules in the future.
>
> --
>
> ___
> Python tracker <rep...@bugs.python.org>
> <https://bugs.python.org/issue15873>
> ___
>

--

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



[issue29690] no %z directive for strptime in python2, doc says nothing about it

2017-03-05 Thread Mathieu Dupuy

Mathieu Dupuy added the comment:

Neither documentation is clear on whether each of those flags are available for 
strptime too. A precision should be added on a flag if it's not available for 
strptime. What do you think ?

--

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



[issue29690] no %z directive for strptime in python2, doc says nothing about it

2017-03-01 Thread Mathieu Dupuy

New submission from Mathieu Dupuy:

➜  ~ cat dt.py 
from datetime import *
dt = datetime.strptime('+1720', '%z')
print(dt)
➜  ~ python2 dt.py 
Traceback (most recent call last):
  File "dt.py", line 2, in 
dt = datetime.strptime('+1720', '%z')
  File "/usr/lib/python2.7/_strptime.py", line 324, in _strptime
(bad_directive, format))
ValueError: 'z' is a bad directive in format '%z'
➜  ~ python3 dt.py
1900-01-01 00:00:00+17:20

We should either mention it in doc, either cherry-pick the code from python3

--
components: Library (Lib)
messages: 288782
nosy: deronnax
priority: normal
severity: normal
status: open
title: no %z directive for strptime in python2, doc says nothing about it
type: behavior
versions: Python 2.7

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



[issue20004] csv.DictReader classic class has a property with setter

2016-08-08 Thread Mathieu Dupuy

Mathieu Dupuy added the comment:

Yeah, it turned out I was actually browsing Python 2.7 sources. My bad.

2016-08-08 16:39 GMT+02:00 R. David Murray <rep...@bugs.python.org>:
>
> R. David Murray added the comment:
>
> I don't believe it was ever committed to 3.x, nor do I see it there.
>
> --
>
> ___
> Python tracker <rep...@bugs.python.org>
> <http://bugs.python.org/issue20004>
> ___

--

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



[issue20004] csv.DictReader classic class has a property with setter

2016-08-05 Thread Mathieu Dupuy

Mathieu Dupuy added the comment:

The comment is still present in python 3 sources at the moment. Shouldn't we 
remove it in python 3 ?

--
nosy: +deronnax

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



[issue15873] datetime: add ability to parse RFC 3339 dates and times

2016-08-05 Thread Mathieu Dupuy

Mathieu Dupuy added the comment:

updated version with SilentGhost's concerns addressed.

--
Added file: http://bugs.python.org/file44019/fromisoformat_regexinclasses2.patch

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



[issue15873] datetime: add ability to parse RFC 3339 dates and times

2016-08-05 Thread Mathieu Dupuy

Changes by Mathieu Dupuy <deron...@gmail.com>:


Added file: 
http://bugs.python.org/file44016/fromisoformat_strptimesingledispatch.patch

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



[issue15873] datetime: add ability to parse RFC 3339 dates and times

2016-08-05 Thread Mathieu Dupuy

Changes by Mathieu Dupuy <deron...@gmail.com>:


Added file: http://bugs.python.org/file44015/fromisoformat_regexinclasses.patch

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



[issue15873] datetime: add ability to parse RFC 3339 dates and times

2016-08-05 Thread Mathieu Dupuy

Mathieu Dupuy added the comment:

I'm back on the issue. I'm currently stuck on the design. We need to store the 
regexes somewhere, and that's what causes problem : I can't really find a good 
place to store them. We basically have two possible designs :
* single dispatch kind, class-type dictionary lookup for regexes, stored in 
_strpime.py. It's minimally invasive, allow a very simple C implementation, and 
allows us to avoid to add a 're' import in datetime.py. Problem : it breaks 
when the given class is not of type date, time or datetime. And it currently 
breaks the tests because tests are doing this, testing using subclasses. We 
could rely on "isinstance" but do we want this ?

* regex stored as classes attributes. More robust, more invasive, 're' import 
in datetime.py, allows subclassing, passes test. C implementation not done yet. 
Since it requires a better understanding of the C API, I will do it only we are 
sure that's the way to go.

I post the two versions of the implementation as patches here. These adress all 
the concerns expressed before (Martin). If we can't decide, I will post a mail 
on the mailing list Martin suggested, python-ideas. By the way, are you sure 
it's the right one to ask ? Wouldn't be python-dev more appropriated ?

--

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



[issue15873] datetime: add ability to parse RFC 3339 dates and times

2016-07-19 Thread Mathieu Dupuy

Mathieu Dupuy added the comment:

because it limits itself to only support the RFC 3339 subset, as
explained in the begining of the discussion.

2016-07-19 16:07 GMT+02:00 Anders Hovmöller <rep...@bugs.python.org>:
>
> Anders Hovmöller added the comment:
>
> The tests attached to this ticket seem pretty bare. Issues that I can spot 
> directly:
>
> - only tests for datetimes, not times or dates
> - only tests for zulu and "-8:00” timezones
> - no tests for invalid input (parsing a valid date as a datetime for example)
> - only tests for -MM-DDTHH:MM:SSZ, but ISO8601 supports:
> - Naive times
> - Timezone information (specified as offsets or as Z for 0 offset)
> - Year
> - Year-month
> - Year-month-date
> - Year-week
> - Year-week-weekday
> - Year-ordinal day
> - Hour
> - Hour-minute
> - Hour-minute
> - Hour-minute-second
> - Hour-minute-second-microsecond
> - All combinations of the three "families" above!
> (the above list is a copy paste from my project that implements all ISO8601 
> that fits into native python: https://github.com/boxed/iso8601 
> <https://github.com/boxed/iso8601>)
>
> This is a more reasonable test suite: 
> https://github.com/boxed/iso8601/blob/master/iso8601.py#L166 
> <https://github.com/boxed/iso8601/blob/master/iso8601.py#L166> although it 
> lacks the tests for bogus inputs.
>
>> On 2016-07-16, at 03:41, Alexander Belopolsky <rep...@bugs.python.org> wrote:
>>
>>
>> Alexander Belopolsky added the comment:
>>
>> I would very much like to see this ready before the feature cut-off for 
>> Python 3.6.  Could someone post a summary on python-ideas to get a show of 
>> hands on some of the remaining wrinkles?
>>
>> I would not worry about a C implementation at this point.  We can put python 
>> implementation in _strptime.py and call it from C as we do for the strptime 
>> method.
>>
>> --
>>
>> ___
>> Python tracker <rep...@bugs.python.org>
>> <http://bugs.python.org/issue15873>
>> ___
>
> --
>
> ___
> Python tracker <rep...@bugs.python.org>
> <http://bugs.python.org/issue15873>
> ___

--

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



[issue15873] datetime: add ability to parse RFC 3339 dates and times

2016-07-02 Thread Mathieu Dupuy

Mathieu Dupuy added the comment:

Hi.
I'm back, and willing to move forward on this issue. With the new code layout, 
the compiled regexes  now lay in datetime classes as class attributes. Will it 
be possible to import date, time and datetime from datetime.py in _datetime.c 
without a problem ?

By the way, I just discovered, that the way we treat microseconds differs from 
the strptime one : we are smarter read every digits and smartly round to six, 
strptime doesn't go that far and just *truncate* to this. Should go that way, 
for consistency with what strptime does, maybe ?

--

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



[issue25738] http.server doesn't handle RESET CONTENT status correctly

2016-06-06 Thread Mathieu Dupuy

Changes by Mathieu Dupuy <deron...@gmail.com>:


--
nosy:  -deronnax

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



[issue2202] urllib2 fails against IIS 6.0 (No support for MD5-sess auth)

2016-03-08 Thread Mathieu Dupuy

Mathieu Dupuy added the comment:

Much better indeed. Thanks.

--

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



[issue2202] urllib2 fails against IIS 6.0 (No support for MD5-sess auth)

2016-03-03 Thread Mathieu Dupuy

Mathieu Dupuy added the comment:

I'm waiting for reviews.

--

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



[issue15873] datetime: add ability to parse RFC 3339 dates and times

2016-02-28 Thread Mathieu Dupuy

Mathieu Dupuy added the comment:

I know. Martin was suggesting to defer the processing to an actual Python 
implementation, hence my answer.

--

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



[issue15873] datetime: add ability to parse RFC 3339 dates and times

2016-02-28 Thread Mathieu Dupuy

Mathieu Dupuy added the comment:

What I really want is to use regex in the C part as I did for the python one. 
It's the best approach and by very far.
I need to figure out how to use regex in CPython internals.

If I defer the actual processing to the Python part, what's the point of doing 
a C part ?

--

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



[issue2202] urllib2 fails against IIS 6.0 (No support for MD5-sess auth)

2016-02-28 Thread Mathieu Dupuy

Mathieu Dupuy added the comment:

first draft

--
Added file: http://bugs.python.org/file42045/digest_md5sess_unittest.diff

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



[issue2202] urllib2 fails against IIS 6.0 (No support for MD5-sess auth)

2016-02-28 Thread Mathieu Dupuy

Mathieu Dupuy added the comment:

I can see in the tests (test_urllib2_localnet.py) that Digest auth is tested 
only through "ProxyAuthTests". Is that sufficient ? Isn't it a bug ? If no, 
should I add the test in that class ?

--

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



[issue15873] datetime: add ability to parse RFC 3339 dates and times

2016-02-18 Thread Mathieu Dupuy

Mathieu Dupuy added the comment:

crap, here is the attachment.
Yeah, but I really would like to use regex in the C version (unless you 
strongly disadvise), so we will have the same logic and the same problem. And I 
never made a patch for the C interpreter itself, so the C equivalent is not 
close to be here soon. (btw if you have a starting point to recommend)

I definitely do not like this fix, it destroys the elegance and the simplicity 
of the "single-dispatch" solution. And it introduce a lot of noisy code for a 
very rare case, people subclassing datetime.* classes.

Maybe making the regex dictionary having string keys instead of class and 
passing the correct string from the calling function, like:

def fromisoformat(string):
_parse_isodatetime('time', string)

or maybe functools.singledispatch handle this case ?

--
Added file: http://bugs.python.org/file41951/fromisoformat_singledispatch.patch

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



[issue2202] urllib2 fails against IIS 6.0 (No support for MD5-sess auth)

2016-02-18 Thread Mathieu Dupuy

Mathieu Dupuy added the comment:

python 2.7

--
Added file: http://bugs.python.org/file41949/md5-sess_not_implem_27_v2.diff

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



[issue2202] urllib2 fails against IIS 6.0 (No support for MD5-sess auth)

2016-02-18 Thread Mathieu Dupuy

Mathieu Dupuy added the comment:

python current

--
Added file: http://bugs.python.org/file41950/md5-sess_not_implem_cur_v2.diff

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



[issue15873] datetime: add ability to parse RFC 3339 dates and times

2016-02-17 Thread Mathieu Dupuy

Mathieu Dupuy added the comment:

SilentGhost: the dictionary single dispatch thing attached (apply on top of the 
last, fromisoformat_new3).
I mind the performance penalty for date-only parsing users, but the code is 
definitively shorter and more elegant.

But we have a major problem: tests fails because what is used in tests is a 
subclass of datetime classes (Subclass[Date|Time|DateTime]) and thus, the 
dispatch break with a KeyError: class.SubDate[...]. I have no idea on how 
mitigate that. Do you ?

--

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



[issue15873] datetime: add ability to parse RFC 3339 dates and times

2016-02-17 Thread Mathieu Dupuy

Mathieu Dupuy added the comment:

New patch with all your concerns addressed (martin.panther+ silentghost) EXCEPT 
the single dispatch dictionary thing.

--
Added file: http://bugs.python.org/file41945/fromisoformat_new3.patch

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



[issue2202] urllib2 fails against IIS 6.0 (No support for MD5-sess auth)

2016-02-17 Thread Mathieu Dupuy

Mathieu Dupuy added the comment:

up

--

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



[issue25738] http.server doesn't handle RESET CONTENT status correctly

2016-02-17 Thread Mathieu Dupuy

Mathieu Dupuy added the comment:

Oh, my mistake ; I though send_error was to be used internally only, but it's 
actually a documented public method, that does not enforce to only use "actual" 
HTTP error code (I wonder what's the point of calling send_error with a 
non-error status code but that's beyond the point of this bug).

I will finish the work of SpaceOne : do a clean patch with just the 
modification (no rename of the variable nor comments) and write a test case.

--

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



[issue15873] datetime: add ability to parse RFC 3339 dates and times

2016-02-17 Thread Mathieu Dupuy

Mathieu Dupuy added the comment:

Crap, I just checked spams today and almost all mails of the reviewboard landed 
in spams ! So I made a new patch addressing all concerns:

* regex moved closer to where they're used
* regex globals start with an _
* case insensitive regex + handling(already handled in the previous revision)
* correct rounding + case suggested by Martin added as a test case
* more precise docstrings specifying that only a subset of ISO 8601 is accepted

bonus:
* useless non-capturing groups removed in regex, thus shorter and simpler

I still have a doubt though about the place I moved the regex. Tell me.

--
Added file: http://bugs.python.org/file41940/fromisoformat_new2.patch

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



[issue15873] datetime: add ability to parse RFC 3339 dates and times

2016-02-16 Thread Mathieu Dupuy

Mathieu Dupuy added the comment:

OK, I know I post a lot, but this one should be the good one:
* recoded from scratch. Apart the algorithm, nothing come from Django anymore.
* help me fill the docstring, I'm not inspired
* datetime has few tests since it use the implementation of time._parse_time, 
which is heavily tested in time unittests.
* I now handle lowercase T and Z. (I know I could do "if tzinfo[0] in ('Z', 
'z')", but to me it feel like imposing a micro performance penalty to 
implementation correctly sending an uppercase Z)

I'm impatient to receive your feedback.

--
Added file: http://bugs.python.org/file41935/fromisoformat_new.patch

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



[issue15873] datetime: add ability to parse RFC 3339 dates and times

2016-02-15 Thread Mathieu Dupuy

Mathieu Dupuy added the comment:

(OK, I said a stupidity:  datetime's strptime handle microseconds. But time's 
one doesn't)

--

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



[issue15873] datetime: add ability to parse RFC 3339 dates and times

2016-02-15 Thread Mathieu Dupuy

Mathieu Dupuy added the comment:

simpler version using a simpler, stricter regex

--
Added file: http://bugs.python.org/file41934/simplerfromisoformat.patch

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



[issue15873] datetime: add ability to parse RFC 3339 dates and times

2016-02-15 Thread Mathieu Dupuy

Mathieu Dupuy added the comment:

Oh my god you're right. Thanks there is the re.ASCII flag.

2016-02-16 15:07 GMT+10:30 Martin Panter <rep...@bugs.python.org>:

>
> Martin Panter added the comment:
>
> The regular expression r"\d" matches any digit in Unicode I think, not
> just ASCII digits 0-9. Perhaps we should limit it to ASCII digits. Or is it
> intended to allow non-ASCII digits like in "२०१६-०२-१६ ०१:२१:१४"?
>
> --
>
> ___
> Python tracker <rep...@bugs.python.org>
> <http://bugs.python.org/issue15873>
> ___
>

--

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



[issue15873] datetime: add ability to parse RFC 3339 dates and times

2016-02-15 Thread Mathieu Dupuy

Mathieu Dupuy added the comment:

The real question is : should we accept whatever iso8601 format is common to be 
found on the internet, or just be able to consume back the string issued by 
isoformat. From that results the answers to the questions you're asking: don't 
accept single digits, neither second-less datetime, ...
I don't really mind what the answer is. I'm OK for a stricter acceptance. I 
would like to ask ourselves : does a simpler, stricter implementation fulfill 
people needs ? If it's OK for you, it's OK for me.

By taking the Django version, I deviated the bit from the author's original 
need which was just being able to parse back datetime isoformat. The 
limitations he raises for not using strptime are gone now (strptime understand 
timezone), but it still can't understand microseconds nor optional parts (T or 
space for separator, optional microseconds). Even for a much simpler, stricter 
implementation, I'd like to stick with regex.

I'll do a date & time version, I just wait that we fall agree on the whole 
datetime thing.

Wether we change to a simpler code or keep it this way, I can rewrite tests & 
docstring.

--

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



[issue15873] datetime: add ability to parse RFC 3339 dates and times

2016-02-15 Thread Mathieu Dupuy

Mathieu Dupuy added the comment:

> I suggest to parse directly the string with C code, since the format looks 
> quite simple (numbers and a few separators).

But some of them are optional. And I would really like to mimic the same 
implementation logic in C.

Now I think the python version is fairly ready. What next ?

--

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



[issue25738] http.server doesn't handle RESET CONTENT status correctly

2016-02-15 Thread Mathieu Dupuy

Mathieu Dupuy added the comment:

I was looking at this issue, and actually the problem is on a different level.
The function the patch takes place is "send_errror". As its name suggests, it's 
only used to send error (I checked in the code : it's only used to send 4XX/5XX 
reply). I'm sure none of this reply forbid to carry a body.
So I think the whole "if code >= 200 and code >= 200 and   code 
not in (code not in (HTTPStatus.NO_CONTENT, HTTPStatus.NOT_MODIFIED)):" should 
just be replaced by a assert 400 <= code < 600.

And more seriously : who could be using this code for a modern real world usage 
? Why not delete it ? Isn't it harmful that unwarned might use it ?

--
nosy: +deronnax

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



[issue15873] datetime: add ability to parse RFC 3339 dates and times

2016-02-15 Thread Mathieu Dupuy

Mathieu Dupuy added the comment:

> Hum, you should use the same rounding method than
datetime.datetime.fromtimestamp(): ROUND_HALF_UP, as round().
In practice, you can for example pass a floating point number as
microseconds to datetime.datetime constructor.

Unfortunately, you're mistaking with the timedelta constructor. Datetime's one 
only take int :(
But I figured out an elegant manner to cope with (in my opinion)

> Since datetime is implemented in C, I'm not sure that using the re is
the best choice. Since the regex looks simple enough, we may parse the
string without the re module. Well, maybe only for the C
implementation.

No regex available at all in CPython ? Otherwise, yeah, if I have to, I can do 
it with strptime.

> What is the behaviour is there are spaces before/after the string?
What if there are other characters like letters before/after? You
should add an unit test for that. I expect an error when parsing
"t=2012-04-23T09:15:00" for example.
Your regex ends with $ but doesn't start with ^. Using re.match(), ^
and $ are probably not needed, but I'm not confident when I use regex
:-)

re.match only look at the beginning of the string, so no need for '^'. And 
therefore, the case
you mention is already handled :)

joined to this mail the last revision of the feature, with correct rounding, 
more test and one useless
line removed. Maybe the good one :) ?

--
Added file: http://bugs.python.org/file41927/fromisoformat4.patch

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



[issue15873] datetime: add ability to parse RFC 3339 dates and times

2016-02-14 Thread Mathieu Dupuy

Mathieu Dupuy added the comment:

slightly improved + addresses issues stated here : 
https://bugs.python.org/review/15873/diff/16581/Lib/datetime.py#newcode1418Lib/datetime.py:1418

--
Added file: http://bugs.python.org/file41926/fromisoformat3.patch

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



[issue15873] datetime: add ability to parse RFC 3339 dates and times

2016-02-14 Thread Mathieu Dupuy

Mathieu Dupuy added the comment:

discarding the microseconds digits after the 6th.

2016-02-15 13:30 GMT+10:30 karl <rep...@bugs.python.org>:

>
> karl added the comment:
>
> About
>
> > Actually, I realized that the best implementation of parsing rfc 3339
> > is in django dateparse utils. To me it's the finest, the most
> > elegant, and no other one can claim to be more robust since it's
> > probably the #1 iso parsing functions used in python. Have a look at
> >
> https://docs.djangoproject.com/en/1.9/_modules/django/utils/dateparse/#parse_datetime
>
> How does it parse this date:
>
> 2016-02-15T11:59:46.16588638674+09:00
>
> --
>
> ___
> Python tracker <rep...@bugs.python.org>
> <http://bugs.python.org/issue15873>
> ___
>

--

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



[issue15873] datetime: add ability to parse RFC 3339 dates and times

2016-02-14 Thread Mathieu Dupuy

Mathieu Dupuy added the comment:

I don't know. The taken code is really little, modified, and is nothing much 
that an implementation you had seen a while ago, and recoded by memory not 
remembering where you saw it in the first place. Do you think that's really an 
issue ?

--

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



[issue15873] datetime: add ability to parse RFC 3339 dates and times

2016-02-14 Thread Mathieu Dupuy

Mathieu Dupuy added the comment:

(slightly improved version, better use of timedelta)

--
Added file: http://bugs.python.org/file41923/fromisoformat2.patch

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



[issue15873] datetime: add ability to parse RFC 3339 dates and times

2016-02-14 Thread Mathieu Dupuy

Mathieu Dupuy added the comment:

Here is the PoC with code taken from django.utils.parse_datetime and adapted 
for the datetime module (I didn't ask for their agreement yet). Of course tests 
pass. For me it's the most elegant solution.

(I think date and time also need their "fromisotimestamp" counterpart).

--
Added file: http://bugs.python.org/file41922/fromisoformat.patch

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



[issue15873] datetime: add ability to parse RFC 3339 dates and times

2016-02-14 Thread Mathieu Dupuy

Mathieu Dupuy added the comment:

#12006 will unfortunately of no use for this one.

Actually, I realized that the best implementation of parsing rfc 3339 is in 
django dateparse utils. To me it's the finest, the most elegant, and no other 
one can claim to be more robust since it's probably the #1 iso parsing 
functions used in python. Have a look at 
https://docs.djangoproject.com/en/1.9/_modules/django/utils/dateparse/#parse_datetime

Alexander, I won't start before I have your opinion. What do you think ?

--

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



[issue15873] datetime: add ability to parse RFC 3339 dates and times

2016-02-11 Thread Mathieu Dupuy

Mathieu Dupuy added the comment:

So, shall we include it ? Otherwise, py8601 
(https://bitbucket.org/micktwomey/pyiso8601/) looks pretty popular and well 
maintained (various committers, started in 2012, last commit in 2016).
I think we should hurry, that's a great shame it has been while Python is able 
to generate a 8601 datetime but not parsing it back.

--
nosy: +deronnax

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



[issue2202] urllib2 fails against IIS 6.0 (No support for MD5-sess auth)

2014-09-30 Thread Mathieu Dupuy

Mathieu Dupuy added the comment:

But I think md5-sess should really be integrated. It's a standard mechanism 
described by a RFC (https://www.ietf.org/rfc/rfc2617.txt), and people need it, 
however insecure it may be (aren't other method (md5) insecure too ?).

--

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



[issue2202] urllib2 fails against IIS 6.0 (No support for MD5-sess auth)

2014-09-25 Thread Mathieu Dupuy

Mathieu Dupuy added the comment:

and here for the 2.7 branch

--
Added file: http://bugs.python.org/file36725/md5-sess_not_implem_27.diff

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



[issue2202] urllib2 fails against IIS 6.0 (No support for MD5-sess auth)

2014-09-25 Thread Mathieu Dupuy

Mathieu Dupuy added the comment:

here is the patch, for the trunk

--
versions:  -Python 3.4
Added file: http://bugs.python.org/file36724/md5-sess_not_implem_cur.diff

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



[issue22496] urllib2 fails against IIS (urllib2 can't parse 401 reply www-authenticate headers)

2014-09-25 Thread Mathieu Dupuy

New submission from Mathieu Dupuy:

When connecting to a IIS server, it replies that:

Unauthorized Server: Microsoft-IIS/7.5
WWW-Authenticate: Digest 
qop=auth,algorithm=MD5-sess,nonce=+Upgraded+v1fe2ba746797cfd974e85f9f6dbdd6e514ec45becd2d8cf0112c764c676ad4a00f98517bb166e467dcad4b942254bd9b71d447e3529c509d2,charset=utf-8,realm=Digest
WWW-Authenticate: Negotiate
WWW-Authenticate: NTLM
X-Powered-By: ASP.NET
Date: Thu, 25 Sep 2014 15:11:03 GMT
Connection: close
Content-Length: 0

which blew python 2.7 utllib2 like this:

File tut2.py, line 23, in module
response = opener.open('https://exca010.encara.local.ads/ews/Services.wsdl')
  File /usr/lib64/python2.7/urllib2.py, line 410, in open
response = meth(req, response)
  File /usr/lib64/python2.7/urllib2.py, line 524, in http_response
'http', request, response, code, msg, hdrs)
  File /usr/lib64/python2.7/urllib2.py, line 442, in error
result = self._call_chain(*args)
  File /usr/lib64/python2.7/urllib2.py, line 382, in _call_chain
result = func(*args)
  File /usr/lib64/python2.7/urllib2.py, line 1090, in http_error_401
host, req, headers)
  File /usr/lib64/python2.7/urllib2.py, line 973, in http_error_auth_reqed
return self.retry_http_digest_auth(req, authreq)
  File /usr/lib64/python2.7/urllib2.py, line 977, in retry_http_digest_auth
chal = parse_keqv_list(parse_http_list(challenge))
  File /usr/lib64/python2.7/urllib2.py, line 1259, in parse_keqv_list
k, v = elt.split('=', 1)
ValueError: need more than 1 value to unpack


urllib2 seems to assume that every www-authenticate header value will be a list 
of equal-signe-separated tuple.

On python3, the error is different and trigger this 
http://bugs.python.org/issue2202 (which is soon-to-be-fixed)

--
components: Library (Lib)
messages: 227543
nosy: deronnax
priority: normal
severity: normal
status: open
title: urllib2 fails against IIS (urllib2 can't parse 401 reply 
www-authenticate headers)
type: crash
versions: Python 2.7

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



[issue22496] urllib2 fails against IIS (urllib2 can't parse 401 reply www-authenticate headers)

2014-09-25 Thread Mathieu Dupuy

Mathieu Dupuy added the comment:

I filled the bug in a hurry. You have to read
when connecting to a IIS for a protected resource and replying with 401 for an 
authentication challenge, it replies this [...]

--

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



[issue2202] urllib2 fails against IIS 6.0 (No support for MD5-sess auth)

2014-06-13 Thread Mathieu Dupuy

Mathieu Dupuy added the comment:

Could we at least do something cleaner that let the interpreter raise an 
UnboundLocalError ? Maybe something like NotImplemented ?

--
nosy: +deronnax

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



[issue19583] time.strftime fails to use %:z time formatter of the underlying C library

2013-11-14 Thread Mathieu Dupuy

New submission from Mathieu Dupuy:

function time.strftime fails to use '%:z' time formatter of the underlying 
library. Passing it does not format time accordingly but returns it as if it 
was a non-formatting string.

Simple reproduction, on Linux:
$ date +%:z
+01:00
$ python -c 'import time;print time.strftime(%:z)'
%:z

%z works fine, any of the other middle-colon variant (glibc also have %::z, 
%:::z) have the same problem.

Reproduced with python 2.7 and 3.3

--
components: Library (Lib)
messages: 202845
nosy: mdupuy
priority: normal
severity: normal
status: open
title: time.strftime fails to use %:z time formatter of the underlying C library
type: behavior
versions: Python 3.3

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



[issue19583] time.strftime fails to use %:z time formatter of the underlying C library

2013-11-14 Thread Mathieu Dupuy

Mathieu Dupuy added the comment:

But in fact date was not the right reference to look at, C strftime has 
exactly the same behaviour than python, so I'm marking this bug as invalid and 
closing it.

--
resolution:  - invalid
status: open - closed

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