[issue34511] I suggest to add documentation about "method" parameter of urllib.request.Request class

2018-08-27 Thread harobed

harobed  added the comment:

 Mariatta Wijaya

Thanks.

Sorry for my bad issue.

--

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



[issue34511] I suggest to add documentation about "method" parameter of urllib.request.Request class

2018-08-26 Thread harobed

New submission from harobed :

Hi,

I see "method=None" parameter in urllib.request.Request constructor 
(https://github.com/python/cpython/blob/master/Lib/urllib/request.py#L327) but 
I don't see "method" parameter in documentation: 
https://docs.python.org/3.2/library/urllib.request.html#urllib.request.Request

I suggest to add documentation about "method".

Best regards,
Stéphane

--
assignee: docs@python
components: Documentation, Library (Lib)
messages: 324134
nosy: docs@python, harobed
priority: normal
severity: normal
status: open
title: I suggest to add documentation about "method" parameter of 
urllib.request.Request class
type: enhancement
versions: Python 3.7

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



[issue12319] [http.client] HTTPConnection.putrequest not support chunked Transfer-Encodings to send data

2011-06-15 Thread harobed

harobed steph...@harobed.org added the comment:

 Now I'm confused. Per the HTTP specification, GET requests don't have
a body, so Transfer-Encoding: chunked doesn't apply to them.

 Are you sure you don't confuse with the response that the server
sends? In responses, Transfer-Encoding: chunked is very common.

Sorry, yes GET requests have Transfer-Encoding: chunked in server response.
PUT requests can send body data in transfer-encoding chunked mode.

--

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



[issue12327] in HTTPConnection the are len(body) and TypeError catch exception to detect if body is file like object, this hack do work with StringIO object

2011-06-15 Thread harobed

harobed steph...@harobed.org added the comment:

 But if the len information is available, why not return it?

I use HTTPConnection to simulate Apple Finder WebDAV client.
When this WebDAV client do PUT request, it transmit data in chunked encoding 
mode and not set Content-Length HTTP field.

Do you understand my context ?

Regards,
Stephane

--

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



[issue12319] [http.client] HTTPConnection.putrequest not support chunked Transfer-Encodings to send data

2011-06-13 Thread harobed

harobed steph...@harobed.org added the comment:

I use http.client in WebDAV client.

Mac OS X Finder WebDAV client perform all his request in chunk mode : PUT and 
GET.

Here, I use http.client to simulate Mac OS X Finder WebDAV client.

Regards,
Stephane

--

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



[issue12327] in HTTPConnection the are len(body) and TypeError catch exception to detect if body is file like object, this hack do work with StringIO object

2011-06-13 Thread harobed

New submission from harobed steph...@harobed.org:

Hi,

in httplib.HTTPConnection._send_request (Python 2.6)
in httplib.HTTPConnection._set_content_length (Python 2.7)
and http.client.HTTPConnection._set_content_length (Python 3.3)

there are something like that :

try:
thelen = str(len(body))
except TypeError as te:
# If this is a file-like object, try to
# fstat its file descriptor
try:
thelen = str(os.fstat(body.fileno()).st_size)
except (AttributeError, OSError):
# Don't send a length if this failed
if self.debuglevel  0: print(Cannot stat!!)


If I put StringIO object in body and I do :

 len(body)
AttributeError: StringIO instance has no attribute '__len__'

I haven't TypeError.

I think we need to replace :

try:
thelen = str(len(body))
except TypeError as te:

by :

if hasattr(body, read):
   ... # it's file-like object
else:
   ... # it's string object

What do you think about ?

--
components: Library (Lib)
messages: 138264
nosy: harobed
priority: normal
severity: normal
status: open
title: in HTTPConnection the are len(body) and TypeError catch exception to 
detect if body is file like object, this hack do work with StringIO object
versions: Python 2.6, Python 2.7, Python 3.3

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



[issue8260] When I use codecs.open(...) and f.readline() follow up by f.read() return bad result

2011-06-13 Thread harobed

harobed steph...@harobed.org added the comment:

Up, I think this patch isn't applied in Python 3.3a0.

--

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



[issue12327] in HTTPConnection the are len(body) and TypeError catch exception to detect if body is file like object, this hack do work with StringIO object

2011-06-13 Thread harobed

harobed steph...@harobed.org added the comment:

 fileno and stat won't work on a StringIO object.  So StringIO would need to 
 be special cased to call getvalue.

Yes, but it isn't important in chunk transfer encoding.

--

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



[issue12319] [http.client] HTTPConnection.putrequest not support chunked Transfer-Encodings to send data

2011-06-12 Thread harobed

New submission from harobed steph...@harobed.org:

Hi,

HTTPConnection.putrequest not support chunked Transfer-Encodings to send data.

Exemple, I can't do PUT request with chunk transfert.

Regards,
Stephane

--
components: Library (Lib)
messages: 138203
nosy: harobed
priority: normal
severity: normal
status: open
title: [http.client] HTTPConnection.putrequest not support chunked 
Transfer-Encodings to send data
versions: Python 2.7, Python 3.3

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



[issue12315] Improve http.client.HTTPResponse.read documentation

2011-06-10 Thread harobed

New submission from harobed steph...@harobed.org:

This is a patch to improve http.client.HTTPResponse.read documentation.

What do you think about ?

--
assignee: docs@python
components: Documentation
files: improve_http.client_documentation.patch
keywords: patch
messages: 138129
nosy: docs@python, harobed
priority: normal
severity: normal
status: open
title: Improve http.client.HTTPResponse.read documentation
versions: Python 3.3
Added file: 
http://bugs.python.org/file22321/improve_http.client_documentation.patch

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



[issue9017] doctest option flag to enable/disable some chunk of doctests?

2010-10-06 Thread harobed

harobed steph...@harobed.org added the comment:

doctest.SKIP is like #doctest: +DISABLE but he don't have #doctest: +ENABLE 
feature.

doctest.SKIP disable all the bottom of test, DISABLE/ENABLE can SKIP only one 
part of test.

Regards,
Stephane

--

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



[issue9017] doctest option flag to enable/disable some chunk of doctests?

2010-10-06 Thread harobed

harobed steph...@harobed.org added the comment:

Ok, option +SKIP and -SKIP work well, look test.py file

I need maybe improve the documentation with an +SKIP and -SKIP example ?

Documentation section about SKIP option is here : 
http://docs.python.org/library/doctest.html?highlight=doctest.skip#doctest.SKIP

Regards,
Stephane

--
Added file: http://bugs.python.org/file19138/test.py

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



[issue9017] What do you think about an Option Flags to enable/disable some chunk of doctest file ?

2010-06-17 Thread harobed

New submission from harobed steph...@harobed.org:

Hi,

in some doctest, I need to stop doctest from a position because the following 
test is a draft, not implemented.

I dream something like this :

test_a()
   True

test_b()
   False

   #doctest: +DISABLE

test_c()
   True

test_d()
   False

   #doctest: +ENABLE

test_e()
   True

test_f()
   False

Here, test_c and test_d aren't executed.

What do you think about this idea ? If it is a good idea, I can implement it.

Thanks for your comments,
Stephane

--
components: Tests
messages: 108008
nosy: harobed
priority: normal
severity: normal
status: open
title: What do you think about an Option Flags to enable/disable some chunk of 
doctest file ?

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



[issue8260] When I use codecs.open(...) and f.readline() follow up by f.read() return bad result

2010-03-29 Thread harobed

New submission from harobed steph...@harobed.org:

This is an example, last assert return an error :

f = open('data.txt', 'w')
f.write(line 1
line 2
line 3
line 4
line 5
line 6
line 7
line 8
line 9
line 10
line 11
)
f.close()


f = open('data.txt', 'r')
assert f.readline() == 'line 1\n'

assert f.read() == line 2
line 3
line 4
line 5
line 6
line 7
line 8
line 9
line 10
line 11


f.close()

import codecs

f = codecs.open('data.txt', 'r', 'utf8')

assert f.read() == line 1
line 2
line 3
line 4
line 5
line 6
line 7
line 8
line 9
line 10
line 11


f.close()

f = codecs.open('data.txt', 'r', 'utf8')

assert f.readline() == 'line 1\n'

# this assert return a ERROR
assert f.read() == line 2
line 3
line 4
line 5
line 6
line 7
line 8
line 9
line 10
line 11


f.close()

Regards,
Stephane

--
components: Library (Lib)
messages: 101892
nosy: harobed
severity: normal
status: open
title: When I use codecs.open(...) and f.readline() follow up by f.read() 
return bad result
type: behavior
versions: Python 2.6

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



[issue5598] paths argument missing in DocFileSuite documentation

2009-03-29 Thread harobed

New submission from harobed steph...@harobed.org:

This is DocFileSuite function source code
(http://svn.python.org/view/python/trunk/Lib/doctest.py) :

::

def DocFileSuite(*paths, **kw):
A unittest suite for one or more doctest files.

The path to each doctest file is given as a string; the
interpretation of that string depends on the keyword argument
module_relative.

A number of options may be provided as keyword arguments:

This is DocFileSuite documentation
(http://svn.python.org/view/python/trunk/Doc/library/doctest.rst) :

::

.. function:: DocFileSuite([module_relative][, package][, setUp][,
tearDown][, globs][, optionflags][, parser][, encoding])

   Convert doctest tests from one or more text files to a
   :class:`unittest.TestSuite`.

   The returned :class:`unittest.TestSuite` is to be run by the
unittest framework
   and runs the interactive examples in each file.  If an example in
any file
   fails, then the synthesized unit test fails, and a
:exc:`failureException`
   exception is raised showing the name of the file containing the
test and a
   (sometimes approximate) line number.

   Pass one or more paths (as strings) to text files to be examined.


I think paths argument missing in this documentation.

Regards,
Stephane

--
assignee: georg.brandl
components: Documentation
messages: 84434
nosy: georg.brandl, harobed
severity: normal
status: open
title: paths argument missing in DocFileSuite documentation
versions: Python 2.6

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