Commit Graph

449 Commits

Author SHA1 Message Date
Jisi Liu
de15e73d58 Merge remote-tracking branch 'origin/3.4.x' into master 2017-10-11 14:44:03 -07:00
Juan Leni
08334f0908 Converting to immutable hashable types 2017-10-11 06:46:25 +02:00
Jisi Liu
dba647a6b2 Bump version for minor release 2017-09-14 11:12:55 -07:00
Adam Cozzette
13fd045dbb Integrated internal changes from Google 2017-09-14 10:03:57 -07:00
Feng Xiao
2ad5c0a864 Merge pull request #2576 from cristicbz/py-strutil
python: do not include internal 'strutil.h' header
2017-09-08 10:23:14 -07:00
Jisi Liu
ba4e54724d Merge pull request #3529 from pherl/merge3.4.x
Merge 3.4.x into master
2017-08-21 10:39:27 -07:00
cclauss
472f700884 remove the parens from the cmp() lambda definition (#3526)
* remove the parens from the cmp() lambda definition

https://github.com/PythonCharmers/python-future/pull/298

* remove the parens from the cmp() lambda definition

https://github.com/PythonCharmers/python-future/pull/298
2017-08-21 10:21:11 -07:00
Jisi Liu
139775ccc0 Merge remote-tracking branch 'origin/3.4.x' into mergemaster 2017-08-18 16:25:35 -07:00
cclauss
a04eb8c191 Define cmp() for Python 3 (#3517)
* Define cmp() for Python 3

http://python-future.org/compatible_idioms.html?highlight=cmp#cmp

* Define cmp() for Python 3

http://python-future.org/compatible_idioms.html?highlight=cmp#cmp
2017-08-18 10:13:10 -07:00
cclauss
dded80f924 define long() for Python 3 2017-08-18 01:41:27 +02:00
Jie Luo
f5817b3056 PY26 tests compatibility
1, Some tests in reflection_test PY26 raise TypeError but other versions raise ValueError for convert negative long to unsigned
2, Change compare exception type to compare exception str for testDuplicateExtensionNumber. Original code raise 'Double registration of Extensions' is not an instance of (<type 'exceptions.AssertionError'>, <type 'exceptions.ValueError'>) for PY26 cpp implementation

t
2017-08-04 15:25:11 -07:00
Jie Luo
9150cd8603 Skip setUpClass which is newly added in python2.7 for python2.6 2017-08-04 10:50:24 -07:00
Jisi Liu
759245a49a Merge from master 2017-07-25 11:52:33 -07:00
Jisi Liu
ce4416705b Merge remote-tracking branch 'origin/3.4.x' into vb 2017-07-24 20:44:59 -07:00
Jie Luo
9c012ed07d Add __bool__ as well as __nonzero__ for python3 2017-07-24 16:42:23 -07:00
Jisi Liu
7bb39bef1a Update version number for 3.4.0 2017-07-24 16:03:49 -07:00
Jie Luo
a484794820 Use keys() instead of iterkeys() to be python3 compatbile. 2017-07-24 15:44:16 -07:00
Feng Xiao
062df3d072 Merge pull request #3179 from bjwatson/fix-duration-typo
Fix typos in comment
2017-07-20 13:01:04 -07:00
Jie Luo
bba4c4ae51 Merge pull request #3262 from snnn/master
Make it compatible with python 3.6.1
2017-07-19 16:25:05 -07:00
Jisi Liu
dd091aad48 Fix code to use values() instead 2017-07-19 15:00:19 -07:00
Jisi Liu
b07cdb6e8e Use itmes() instead of itervalues() to be python3 compatbile. 2017-07-19 13:55:58 -07:00
Jisi Liu
09354db143 Merge from Google internal for 3.4 release 2017-07-18 15:38:30 -07:00
Changming Sun
4987ddac75 Fix a bazel build error on Windows 2017-06-22 22:08:09 +08:00
Brian J. Watson
5555d3b078 Fix typos in comment 2017-06-21 17:31:03 -07:00
Bo Yang
e7bcfc4241 Update version number to 3.3.2 2017-06-21 10:20:34 -07:00
Feng Xiao
58538ea919 Update version number to 3.3.1 2017-05-08 16:02:08 -07:00
Feng Xiao
478119fe77 Fix python3 issue. 2017-04-20 16:30:26 -07:00
Jie Luo
899460c9cb cherrypick descriptor_pool.FindFileContainingSymbol by extensions (#2962)
* Use PyUnicode_AsEncodedString() instead of PyUnicode_AsEncodedObject()

* Cherrypick the fix descriptor_pool.FindFileContainingSymbol by extensions.
2017-04-10 16:37:57 -07:00
Feng Xiao
80f0c0ac40 Update version number and changelog for 3.3.0 2017-04-05 17:32:17 -07:00
Feng Xiao
d36c0c538a Down-integrate from google3. 2017-03-29 14:33:05 -07:00
Jisi Liu
f6d8c83384 Merge pull request #2613 from aausch/fix_memory_leak
optimization and quick workaround to memory leak
2017-03-06 16:48:54 -08:00
Paul Yang
7f3e237071 Merge 3.2.x branch into master (#2648)
* Down-integrate internal changes to github.

* Update conformance test failure list.

* Explicitly import used class in nano test to avoid random test fail.

* Update _GNUC_VER to use the correct implementation of atomic operation
on Mac.

* maps_test.js: check whether Symbol is defined before using it (#2524)

Symbol is not yet available on older versions of Node.js and so this
test fails with them. This change just directly checks whether Symbol is
available before we try to use it.

* Added well_known_types_embed.cc to CLEANFILES so that it gets cleaned up

* Updated Makefile.am to fix out-of-tree builds

* Added Bazel genrule for generating well_known_types_embed.cc

In pull request #2517 I made this change for the CMake and autotools
builds but forgot to do it for the Bazel build.

* Update _GNUC_VER to use the correct implementation of atomic operation on Mac.

* Add new js file in extra dist.

* Bump version number to 3.2.0

* Fixed issue with autoloading - Invalid paths (#2538)

* PHP fix int64 decoding (#2516)

* fix int64 decoding

* fix int64 decoding + tests

* Fix int64 decoding on 32-bit machines.

* Fix warning in compiler/js/embed.cc

embed.cc: In function ‘std::string CEscape(const string&)’:
embed.cc:51:32: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for (int i = 0; i < str.size(); ++i) {
                                ^

* Fix include in auto-generated well_known_types_embed.cc

Restore include style fix (e3da722) that has been trampled by
auto-generation of well_known_types_embed.cc

* Fixed cross compilations with the Autotools build

Pull request #2517 caused cross compilations to start failing, because
the js_embed binary was being built to run on the target platform
instead of on the build machine. This change updates the Autotools build
to use the AX_PROG_CXX_FOR_BUILD macro to find a suitable compiler for
the build machine and always use that when building js_embed.

* Minor fix for autocreated object repeated fields and maps.

- If setting/clearing a repeated field/map that was objects, check the class
  before checking the autocreator.
- Just to be paranoid, don’t mutate within copy/mutableCopy for the autocreated
  classes to ensure there is less chance of issues if someone does something
  really crazy threading wise.
- Some more tests for the internal AutocreatedArray/AutocreatedDictionary
  classes to ensure things are working as expected.
- Add Xcode 8.2 to the full_mac_build.sh supported list.

* Fix generation of extending nested messages in JavaScript (#2439)

* Fix generation of extending nested messages in JavaScript

* Added missing test8.proto to build

* Fix generated code when there is no namespace but there is enum definition.

* Decoding unknown field should succeed.

* Add embed.cc in src/Makefile.am to fix dist check.

* Fixed "make distcheck" for the Autotools build

To make the test pass I needed to fix out-of-tree builds and update
EXTRA_DIST and CLEANFILES.

* Remove redundent embed.cc from src/Makefile.am

* Update version number to 3.2.0-rc.1 (#2578)

* Change protoc-artifacts version to 3.2.0-rc.1

* Update version number to 3.2.0rc2

* Update change logs for 3.2.0 release.

* Update php README

* Update upb, fixes some bugs (including a hash table problem). (#2611)

* Update upb, fixes some bugs (including a hash table problem).

* Ruby: added a test for the previous hash table corruption.

Verified that this triggers the bug in the currently released
version.

* Ruby: bugfix for SEGV.

* Ruby: removed old code for dup'ing defs.

* Reverting deployment target to 7.0 (#2618)

The Protobuf library doesn’t require the 7.1 deployment target so
reverting it back to 7.0

* Fix typo that breaks builds on big-endian (#2632)

* Bump version number to 3.2.0
2017-01-31 09:17:32 -08:00
Alex Ausch
2c36cc30dd cache generated classes, optimization and quick workaround to memory leak 2017-01-30 15:42:01 -05:00
Cristi Cobzarenco
1ee09c81bb python: do not include internal 'strutil.h' header 2017-01-28 12:19:11 +02:00
Joshua Haberman
ffa71f8007 A few more cases for binary conformance tests. (#2500)
* A few more cases for binary conformance tests.

* over-encoded varints (encoded in more bytes than are necessary).
* truncated varints (>32 bits for 32-bit types).

* Fixed Python decoding bug with 32-bit varints.

* Fixed 1L -> 1LL for 32-bit platforms.
2017-01-06 16:58:21 -08:00
Adam Cozzette
259dd7e842 Updated descriptor_pool.py to be compatible with Python 3
In Python 3 the values() method on a dictionary returns a view instead
of a list, so we need to explicitly convert that to a list.
2016-11-22 16:55:43 -08:00
Adam Cozzette
a7f300d6ff Fixed descriptor_pool_test.py for Python 2.6
The curly brace syntax for sets was introduced in Python 2.7, and so for
compatibility with 2.6 we need to avoid using it for now.
2016-11-22 15:14:05 -08:00
Adam Cozzette
5d63097fc2 Merge branch 'master' into down-integrate-with-msvc-fix 2016-11-17 17:04:30 -08:00
Adam Cozzette
5a76e633ea Integrated internal changes from Google 2016-11-17 16:59:59 -08:00
Richard Shin
7c913d821e Use -DPROTOBUF_PYTHON_ALLOW_OVERSIZE_PROTOS 2016-10-19 13:36:23 -07:00
Bo Yang
1c4cf0eeb5 Fix python cpp. 2016-10-10 11:44:21 -07:00
Feng Xiao
f933d10fbe Update version number.
[skip ci]

Change-Id: I1ba6f6372a08b5796570851336e1a548602f60da
2016-10-10 11:44:21 -07:00
Bo Yang
23d4688cce Fix python bugs for internal integration. 2016-10-10 11:43:48 -07:00
Bo Yang
15f4db6cb1 Bump version number to 3.1.0-alpha-1. 2016-10-10 11:24:31 -07:00
Bo Yang
cc8ca5b6a5 Integrate internal changes 2016-10-10 11:23:36 -07:00
Jisi Liu
58860c021f Merge remote-tracking branch 'origin/3.0.x' into merge 2016-09-14 09:37:48 -07:00
Jisi Liu
6e11540b32 Bump version number to 3.0.2 2016-09-02 11:57:49 -07:00
Jonathon Love
64958cdb1d Fix to typo/oversight in python tests
Fix to typo/oversight in python tests, only affecting python 3
2016-09-02 12:36:11 +10:00
Adam Matan
3886860aa4 Typo: beffer -> buffer 2016-08-03 14:59:18 +03:00
Jisi Liu
fb7a7c5f1f Bump version number for GA 2016-07-25 12:07:56 -07:00
Feng Xiao
932f94e16e Update version number to 3.0.0-beta-4 2016-07-13 16:08:47 -07:00
Feng Xiao
9086d96439 Integrate from internal code base. 2016-07-13 13:48:40 -07:00
Otto Kekäläinen
3808d091f8 Fix spelling in strings and comments 2016-07-03 15:26:04 +03:00
Adam Cozzette
b83af525db Fixed string formatting in text_format.py to be Python2.6-compatible
In Python 2.6 the positional argument specifiers are apparently required
to be explicitly specified:
http://stackoverflow.com/questions/10054122/valueerror-zero-length-field-name-in-format-python
2016-06-30 10:13:53 -07:00
Adam Cozzette
d64a2d9941 Integrated internal changes from Google
This includes all internal changes from around May 20 to now.
2016-06-29 15:38:03 -07:00
Josh Haberman
350453f2d5 Make surrogate regex even more lenient. 2016-06-06 17:14:58 -07:00
Josh Haberman
923d2c7ccf JSON surrogates Python: adjust regex for OSX error message.
OS X's version of Python has a slightly different error
message for this error case.
2016-06-06 13:57:59 -07:00
Josh Haberman
6a618949aa Added test for surrogates (valid and invalid). 2016-06-03 10:24:23 -07:00
Josh Haberman
4833b4c003 Surrogate checking is unpredictable, so always manually check. 2016-06-03 09:39:38 -07:00
Josh Haberman
bd98eae1c9 Fixed Python by updating failure lists and fixed a few broken tests.
Python 2.x doesn't detect unpaired surrogates so we have to
do that manually.
2016-06-03 09:39:38 -07:00
Jie Luo
b01b1a8ebe JSON format for Any message must print @type first, use OrderedDict instead of {} 2016-05-17 15:14:53 -07:00
Jisi Liu
dbed8a0154 Update version numbers for beta3 2016-05-10 14:49:42 -07:00
Jisi Liu
f8a5c5f746 Fix using std::shared_ptr 2016-05-05 16:34:42 -07:00
Jisi Liu
75e5898513 Fix the std::string error introduced in integration. 2016-05-05 16:04:30 -07:00
Jisi Liu
cf14183bcd Down integrate from Google internal. 2016-04-28 14:34:59 -07:00
Jisi Liu
cba75ad404 Merge branch 'master' of github.com:google/protobuf 2016-04-01 16:46:49 -07:00
Jisi Liu
7b1cbbd50e Fix signed-compare warning. 2016-03-31 15:38:10 -07:00
Jisi Liu
012ac9a0a6 revert unexpected change for py26 2016-03-31 15:26:22 -07:00
Manjunath Kudlur
1283625b0f Added an API to allow oversize protos when using C++ extension in Python 2016-03-31 14:14:58 -07:00
Jisi Liu
fc7eeda69c Fix json_format.py in py26 2016-03-31 13:36:32 -07:00
Jisi Liu
0de06f54bc Merge branch 'master' of github.com:google/protobuf 2016-03-30 11:43:44 -07:00
Jisi Liu
3b3c8abb96 Integrate google internal changes. 2016-03-30 11:39:59 -07:00
Silviu Calinoiu
4573edba76 Update version to 3.0.0b2.post2 2016-03-07 14:33:57 -08:00
Silviu Calinoiu
786f80fe66 Add a modified patch from craigcitro@ to handle namespace sharing. 2016-02-18 16:12:11 -08:00
Manjunath Kudlur
99a3e30bd7 Added PROTOBUF_PYTHON_ALLOW_OVERSIZE_PROTOS macro and setting it when
--allow_oversize_protos=true is passed to bazel build.
When this macro is set, SetTotalBytesLimit is called to remove
the 64MB limit on binary protos when during ParseFromString.
2016-02-16 15:17:10 -08:00
CH Albach
5477f8cdba Manually down-integrate python JSON struct support from internal code base. 2016-01-29 18:10:50 -08:00
Josh Haberman
06fd6fa850 Fixed Python 3.x C++ build, and updated conformance failure lists. 2016-01-15 17:26:44 -08:00
Josh Haberman
e1abdf2c76 Fixed compile for Python 3. There are still some crashes though. 2015-12-30 16:09:53 -08:00
Feng Xiao
b7610f129d Add missing files to EXTRA_DIST.
Also delete some unused files.
2015-12-28 14:18:49 -08:00
Feng Xiao
a0b8fd52b9 Fix Python 2.6 test failures.
Change-Id: Ia9e2795b1ff1abb30410ffb3ef96ba6f46dd99d0
2015-12-21 13:43:13 -08:00
Feng Xiao
aa7e17a6f6 Update version numbers.
Version number for beta languages is updated to v3.0.0-beta-2.
Version number for alpha languages is updated to v3.0.0-alpha-5.
2015-12-21 11:31:51 -08:00
Feng Xiao
e841bac4fc Down-integrate from internal code base. 2015-12-11 17:10:28 -08:00
Manjunath Kudlur
96537c461a Bringing in internal::shared_ptr into google:protobuf namespace.
Fixes #1029
2015-12-09 07:40:30 -08:00
Manjunath Kudlur
3f9b4f2944 Updated for c++98 compatibility 2015-12-07 14:15:29 -08:00
Manjunath Kudlur
3ff1dca0bd Enable fast cpp protos in the python interface. 2015-12-07 13:08:21 -08:00
Josh Haberman
70ffefa551 Fixed compile errors after rebase. 2015-10-28 17:05:47 -07:00
Josh Haberman
00700b7219 Removed all warnings from the Python/C++ build.
Also made the Travis build ensure that no warnings
are present.

These builds were previously spewing many warnings,
which was hiding warnings for important things like
accidentally using C++11-only features.

Change-Id: I56caeee9db48bc78756a3e8d7c14874630627037
2015-10-28 17:05:47 -07:00
Jie Luo
2850a98275 fix json_format for python2.6:
1, objcect_pair_hook is not supported in python2.6, so duplicated key check is removed in 2.6
2, total_seconds is not suppoted in python2.6, changed to compute seconds directly
2015-10-19 16:25:54 -07:00
Jisi Liu
78d040a18b remove extra collection import 2015-10-06 11:02:24 -07:00
Jisi Liu
dbea00ae88 Revert back changes to import unittest2 for py26 2015-10-05 16:08:22 -07:00
Jisi Liu
a783eaf37f make the python json test less strict on expected errors. 2015-10-05 15:06:06 -07:00
Jisi Liu
8d8177c757 Merge remote-tracking branch 'origin/master' into fix-author 2015-10-05 13:54:05 -07:00
Jisi Liu
46e8ff63cb Down-integrate from google internal. 2015-10-05 11:59:43 -07:00
Dan O'Reilly
d9598ca55d Fix Python 3.4 cpp implementation
Fixes the ScalarMapContainer/MessageMapContainer implementations on
Python 3.4, by dynamically allocating their PyTypeObjects using
PyType_FromSpecWithBases, instead of statically allocating them. This is
necessary because Python 3.4+ disallows statically allocating a class
with a dynamically allocated parent.

Signed-off-by: Dan O'Reilly <oreilldf@gmail.com>
2015-08-31 16:42:31 -04:00
Josh Haberman
4472b4ad15 Fixed assignment syntax error.
Change-Id: Ifef8a300258214aae8f6b8516fbc61b7335b5724
2015-08-28 19:21:49 -07:00
Josh Haberman
fc80fad9d5 Fix for https://github.com/google/protobuf/issues/758
Change-Id: I590b34b96c84a3ba6e094a0bd86f153147ade3d3
2015-08-28 16:34:48 -07:00
Feng Xiao
a3a2605d5c Excludes a failing python cpp test case. 2015-08-26 21:56:26 -07:00
Feng Xiao
e94e062b58 Merge branch 'master' of github.com:google/protobuf into beta-1 2015-08-26 15:47:35 -07:00
Joshua Haberman
c7a1f8ec3b Merge pull request #728 from dano/py3_str_compat
Get all tests passing on Python3 (except Python3.4 cpp implementation)
2015-08-26 15:44:06 -07:00
Feng Xiao
ffe9215140 Update version number.
Protoc, C++ runtime and Java runtime are updated to v3.0.0-beta-1, other
languages are updated to v3.0.0-alpha-4.
2015-08-26 15:11:43 -07:00
Feng Xiao
b192ba87f7 Merge remote-tracking branch 'origin/master' into beta-1 2015-08-25 20:24:43 -07:00
Feng Xiao
b17ec3ca11 Down-integrate from internal code base. 2015-08-23 17:50:38 -07:00
Feng Xiao
eee38b0c01 Down-integrate from google3. 2015-08-22 18:25:48 -07:00
Dan O'Reilly
38eef02aab Fix metaclass issue on Python 3. Get text handling tests passing on Python 3.
Signed-off-by: Dan O'Reilly <oreilldf@gmail.com>
2015-08-22 13:07:12 -04:00
Dan O'Reilly
fc80874adf Start work on getting text handled properly on PY3 2015-08-22 13:07:12 -04:00
Tamir Duberstein
87993d7507 assertEquals is deprecated 2015-08-22 13:06:24 -04:00
Tamir Duberstein
821fcb2ded Use assertIsInstance 2015-08-22 12:56:34 -04:00
Tamir Duberstein
09831c8768 Clean up exception syntax 2015-08-22 12:55:19 -04:00
Tamir Duberstein
322d8939fc Remove Python 2.5 cruft 2015-08-22 12:54:31 -04:00
Jisi Liu
b0f661181d Down-integrate from internal branch.
Change-Id: Ieb7a2c2fbf35bc2a8fa65b915a5ecb68c83863e4
2015-08-21 11:18:45 -07:00
Dan O'Reilly
3bdfb4b695 Add some clarifying comments. Remove ez_setup.py.
Signed-off-by: Dan O'Reilly <oreilldf@gmail.com>
2015-08-20 13:52:19 -04:00
Dan O'Reilly
3083d8cee7 Fix --cpp_implementation test failure. Test both pure Python and cpp implementation in tox.
Signed-off-by: Dan O'Reilly <oreilldf@gmail.com>
2015-08-15 10:07:38 -04:00
Dan O'Reilly
7601551f7c Just always uses BytseIO in text_format for now
Signed-off-by: Dan O'Reilly <oreilldf@gmail.com>
2015-08-14 23:22:47 -04:00
Dan O'Reilly
2621c8aefb Get Python 2.6 working.
Signed-off-by: Dan O'Reilly <oreilldf@gmail.com>
2015-08-14 22:54:53 -04:00
Dan O'Reilly
d06adbd4a4 Fix usage of assertItemsEqual on Py3
Signed-off-by: Dan O'Reilly <oreilldf@gmail.com>
2015-08-14 16:16:00 -04:00
Dan O'Reilly
3d5aa6aef9 Fix some more Python 3 compat issues
Signed-off-by: Dan O'Reilly <oreilldf@gmail.com>
2015-08-14 16:12:34 -04:00
Dan O'Reilly
fe7d9379df Fixing some long/int bugs
Signed-off-by: Dan O'Reilly <oreilldf@gmail.com>
2015-08-14 15:26:33 -04:00
Dan O'Reilly
833c046fb7 Fixing some tests
Signed-off-by: Dan O'Reilly <oreilldf@gmail.com>
2015-08-13 01:17:26 -04:00
Dan O'Reilly
e47cdd5a55 Merge remote-tracking branch 'upstream/master' into py2_py3_straddle
Conflicts:
	python/google/protobuf/descriptor_pool.py
	python/google/protobuf/internal/api_implementation_default_test.py
	python/google/protobuf/internal/cpp_message.py
	python/google/protobuf/internal/descriptor_database_test.py
	python/google/protobuf/internal/descriptor_pool_test.py
	python/google/protobuf/internal/descriptor_python_test.py
	python/google/protobuf/internal/descriptor_test.py
	python/google/protobuf/internal/generator_test.py
	python/google/protobuf/internal/message_factory_python_test.py
	python/google/protobuf/internal/message_factory_test.py
	python/google/protobuf/internal/message_test.py
	python/google/protobuf/internal/proto_builder_test.py
	python/google/protobuf/internal/python_message.py
	python/google/protobuf/internal/reflection_test.py
	python/google/protobuf/internal/service_reflection_test.py
	python/google/protobuf/internal/symbol_database_test.py
	python/google/protobuf/internal/text_encoding_test.py
	python/google/protobuf/internal/text_format_test.py
	python/google/protobuf/internal/unknown_fields_test.py
	python/google/protobuf/internal/wire_format_test.py
	python/google/protobuf/pyext/descriptor_cpp2_test.py
	python/google/protobuf/pyext/message_factory_cpp2_test.py
	python/google/protobuf/pyext/reflection_cpp2_generated_test.py
	python/setup.py
	ruby/lib/google/protobuf/message_exts.rb
2015-08-12 23:57:46 -04:00
Bo Yang
9f563bd0d8 Internal local modifications. 2015-07-09 12:39:52 -07:00
Bo Yang
e107e2d68e Update version number to 3.0.0-alpha-4 2015-05-29 11:00:57 -07:00
teboring
9839c0c2c9 Update version number to 3.0.0-alpha-3 2015-05-23 09:20:23 -07:00
Bo Yang
5db217305f down-integrate internal changes 2015-05-21 19:32:02 -07:00
Tamir Duberstein
4f5cbe6ead Whitespace 2015-05-06 17:02:57 -04:00
Tamir Duberstein
9d9d0b70de Don't hard-code the python path 2015-05-06 17:02:57 -04:00
Tamir Duberstein
9f42f5f4a4 [PYTHON] Drop dependency on 'google.apputils'.
Use stdlib's 'unittest' instead.
2015-04-10 19:43:51 -04:00
Tamir Duberstein
dab96f19ee [PYTHON] Remove awkward duplicate tests
We already run all tests with and without `--cpp_implementation`
2015-04-10 19:43:50 -04:00
Tamir Duberstein
ef1b747a42 [PYTHON] Clarify API version comment 2015-04-10 09:46:21 -04:00
Tamir Duberstein
8ede2817a0 Remove useless file that doesn't load
This file was broken in ada6556.
2015-04-08 18:33:04 -04:00
Joshua Haberman
42809ef8fe Merge pull request #196 from Zex/master
Fix raise and except syntax issues for py3
2015-03-31 12:30:17 -07:00
Jisi Liu
4573e110b8 Fix python versions to comply with pep-0440.
Change-Id: Ifb4958e4f371b36f249faa466473f851697edb5c
2015-03-04 16:45:13 -08:00
Jisi Liu
e4a9ace541 Merge remote-tracking branch 'github/alpha-2-fix'
Change-Id: I4c5186b8451713fda38e60dc3f828da6196c7a5e
2015-03-04 15:37:21 -08:00
Jisi Liu
8e61d323bf Fix python package version to alpha-2.
Change-Id: Iae16dcae833959681a5c8e98764e5d1071e6fdcf
2015-03-04 15:28:35 -08:00
Jisi Liu
885b612f74 Down integrate from Google internal branch for C++ and Java.
- Maps for C++ lite
- C++ Arena optimizations.
- Java Lite runtime code size optimization.

Change-Id: I7537a4357c1cb385d23f9e8aa7ffdfeefe079f13
2015-02-28 17:06:49 -08:00
Josh Haberman
0b70a43736 Fixes for Python/C++ implementation in open-source:
* Rosy hack doesn't apply (that test should be removed
    for the open-source release).

  * Added our own copy of parameterized.py (the open-source
    version of Google Apputils doesn't contain it).

  * The C++ Descriptor object didn't implement extension_ranges.

  * Had to implement a hack around returning EncodeError, to
    work around the module-loading behavior of the test runner.
2015-02-25 20:17:32 -08:00
Jisi Liu
ada6556785 Down integrate from Google internal.
Change-Id: I34d301133eea9c6f3a822c47d1f91e136fd33145
2015-02-25 16:39:11 -08:00
zex
a4f634ce74 fix raise syntax issues for py3,
fix except syntax issue for py3
2015-02-06 13:51:49 +08:00
Feng Xiao
ae11803d77 Delete unused files. 2015-01-27 11:17:18 -08:00
Tres Seaver
a2abc947c0 Straddle Python 2.6, 2.7, 3.3, 3.4. 2015-01-13 15:47:55 -05:00
Tres Seaver
3d5460dd90 Don't check in derived objects. 2015-01-13 15:44:01 -05:00
Tres Seaver
71edc31f23 Compatibility with Python2.6 unittest. 2015-01-13 15:38:10 -05:00
Tres Seaver
47ee4d37c1 Use 'io.BytesIO' rather than 'cStringIO.StringIO'. 2015-01-13 15:04:41 -05:00
Tres Seaver
d25e6686d9 Typo. 2015-01-13 15:04:00 -05:00
Tres Seaver
9821016cfa Merge branch 'drop-apputils-dependency' into straddle_py2_py3
Conflicts:
	python/google/protobuf/internal/message_factory_test.py
	python/google/protobuf/internal/reflection_test.py
	python/google/protobuf/internal/text_format_test.py
2015-01-13 14:56:00 -05:00
Tres Seaver
7ee25830c6 Drop dependency on 'google.apputils'.
Use stdlib's 'unittest' instead.
2015-01-13 14:47:32 -05:00
Tres Seaver
f336d4b7a5 Prepare for Python2-Python3 straddle.
- Remove PY25 cruft.

- Selectively apply cleanups from 'python-modernize':

  - New exception syntax.
  - Use 'six' to handle module renames.
  - Use 'six' to handle text / binary stuff.

This PR covers most of the work from #66 which falls inside `python`
(rather than the Python code generation stuff in 'src').
2015-01-13 14:22:05 -05:00
Feng Xiao
b60a6df9ae Merge pull request #46 from adalq/version
Add __version__
2014-12-20 17:46:35 -08:00
Adal Chiriliuc
4f0170d465 Updated __version__ 2014-12-14 20:42:46 +02:00
Feng Xiao
d1ec493a12 Fix Python C++ implementation build issues:
1. Haven't included the include path for "config.h".
  2. Use of C++11 auto keyword.
2014-11-25 15:21:08 -08:00
Feng Xiao
99aa0f9e8f Down-integrate from internal code base. 2014-11-20 16:18:53 -08:00
Feng Xiao
f157a5651c Down-integrate from internal code base (C++ maps support). 2014-11-14 11:50:31 -08:00
Feng Xiao
643d09ac7d Merge branch 'typofixes-vlajos-20141108' of https://github.com/vlajos/protobuf into typo
Conflicts:
	src/google/protobuf/compiler/java/java_file.cc
2014-11-11 11:01:32 -08:00
Feng Xiao
6ef984af4b Down-integrate from internal code base. 2014-11-10 17:34:54 -08:00
Veres Lajos
c76807211a typo fixes - https://github.com/vlajos/misspell_fixer 2014-11-08 22:59:34 +00:00
Adal Chiriliuc
374b95146e Add __version__
Added __version__ attr to package so that scripts that check local
packages to see if newer versions are available can work.

Almost all Python packages have a version attr, and the vast majority of
them name it "__version__"
2014-10-10 22:00:39 +03:00
Adal Chiriliuc
6f7aa2f678 Revert "Add __version__"
This reverts commit 5337cf564f.
2014-10-10 21:59:22 +03:00
Adal Chiriliuc
5337cf564f Add __version__
Added __version__ attr to package so that scripts that check local
packages to see if newer versions are available can work.

Almost all Python packages have a version attr, and the vast majority of
them name it "__version__"
2014-10-10 21:58:43 +03:00
Feng Xiao
0971bb0d57 Down-integrate from internal branch. 2014-10-07 17:44:48 -07:00
Feng Xiao
e428862450 Replace links to code.google.com/protobuf with developers.google.com/protocol-buffers 2014-10-01 16:26:23 -07:00
jieluo@google.com
1eba9d9c74 merge tags/2.6.0 into trunk 2014-08-25 20:17:53 +00:00
jieluo@google.com
e61b513b1f make dist complains the file name is too long and refuse to put it to tar. Change the file to a shorter name 2014-08-14 21:51:48 +00:00
jieluo@google.com
24095cc7e5 Add deleted tests back for reflection_cpp2_test.py by addtional exception catch 2014-08-14 18:04:22 +00:00
jieluo@google.com
b70e586603 put python cpp tests into pyext/ 2014-08-13 21:05:19 +00:00
jieluo@google.com
bde4a3254a down integrate python opensource to svn 2014-08-12 21:10:30 +00:00
jieluo@google.com
4de8f55113 down integrate to svn 2014-07-18 00:47:59 +00:00
xiaofeng@google.com
7f372559cc Down-integrate from internal branch 2013-02-25 10:39:39 +00:00
xiaofeng@google.com
eaaef0b39b Fix issues: 342, 424, 428, 430, 436 2012-12-04 00:59:40 +00:00
xiaofeng@google.com
b55a20fa2c Down-integrate from internal branch 2012-09-22 02:40:50 +00:00
liujisi@google.com
e8e6eed0be Fixed a memory leak in python CPP implementation. 2011-06-07 03:38:28 +00:00
liujisi@google.com
5c20ca1fcc Escape C++ Trigraphs. 2010-12-21 05:33:13 +00:00
liujisi@google.com
6f2c3b8734 Boost version number to 2.4.0-pre, add more test cases for text_format.py about unicode field. 2010-12-09 08:59:21 +00:00
liujisi@google.com
1fd96c43a0 Add new files for vcprojs, fix issues: 165, 211, 228, 240 2010-12-07 06:23:55 +00:00
liujisi@google.com
2726e7a6eb Fix issues: 166 167 172 175 181 188 192 194 195. 2010-12-03 09:12:33 +00:00
liujisi@google.com
33165fe0d5 Submit recent changes from internal branch. See CHANGES.txt for more details. 2010-11-02 13:14:58 +00:00
kenton@google.com
27028bcb97 Fix issue 208. 2010-07-27 21:19:59 +00:00
kenton@google.com
0c293def6c Fix issue 207 2010-07-27 20:45:09 +00:00
kenton@google.com
7b7a80eae4 Tweak doc comments. 2010-01-08 03:56:03 +00:00
kenton@google.com
535301894e Address comments from various code reviews. 2010-01-07 02:08:03 +00:00
kenton@google.com
46ed74e8d4 Actually, that last revision can be simpler -- we don't need to parse strings at all, as simply entering 1e1000 as a float literal in Python will be evaluated as infinity. 2009-12-23 02:08:05 +00:00
kenton@google.com
d0047c43d9 In Python, avoid relying on float('inf') and float('nan') as these don't work on Windows with Python pre-2.6. 2009-12-23 02:01:01 +00:00
kenton@google.com
eef5f8396d Same as r275 except for Python. 2009-12-23 01:32:45 +00:00
kenton@google.com
fccb146e3f Massive roll-up of changes. See CHANGES.txt. 2009-12-18 02:11:36 +00:00
kenton@google.com
80b1d62bfc Submit recent changes from internal branch, including "lite mode" for
C++ and Java.  See CHANGES.txt for more details.
2009-07-29 01:13:20 +00:00
kenton@google.com
3d694ad2d8 Fix test failure on 64-bit python. 2009-05-01 23:33:31 +00:00
kenton@google.com
d37d46dfbc Integrate recent changes from Google-internal code tree. See CHANGES.txt
for details.
2009-04-25 02:53:47 +00:00
kenton@google.com
a8e8ccf29c Improve performance of Python serialization. Patch from Will Pierce. 2009-04-18 02:01:27 +00:00
kenton@google.com
cfa2d8aa87 Generate field number constants. Patch from Michael Poole. 2009-04-18 00:02:12 +00:00
kenton@google.com
2d6daa72ab Push out changes from internal codebase.
All Languages
* Repeated fields of primitive types (types other that string, group, and
  nested messages) may now use the option [packed = true] to get a more
  efficient encoding.  In the new encoding, the entire list is written
  as a single byte blob using the "length-delimited" wire type.  Within
  this blob, the individual values are encoded the same way they would
  be normally except without a tag before each value (thus, they are
  tightly "packed").

C++
* UnknownFieldSet now supports STL-like iteration.
* Message interface has method ParseFromBoundedZeroCopyStream() which parses
  a limited number of bytes from an input stream rather than parsing until
  EOF.

Java
* Fixed bug where Message.mergeFrom(Message) failed to merge extensions.
* Message interface has new method toBuilder() which is equivalent to
  newBuilderForType().mergeFrom(this).
* All enums now implement the ProtocolMessageEnum interface.
* Setting a field to null now throws NullPointerException.
* Fixed tendency for TextFormat's parsing to overflow the stack when
  parsing large string values.  The underlying problem is with Java's
  regex implementation (which unfortunately uses recursive backtracking
  rather than building an NFA).  Worked around by making use of possesive
  quantifiers.

Python
* Updated RPC interfaces to allow for blocking operation.  A client may
  now pass None for a callback when making an RPC, in which case the
  call will block until the response is received, and the response
  object will be returned directly to the caller.  This interface change
  cannot be used in practice until RPC implementations are updated to
  implement it.
2009-01-22 01:27:00 +00:00
pesho.petrov
87e64e1cee Adding slicing support for repeated scalar fields and get/delete slice for composite fields. 2008-12-24 01:07:22 +00:00
kenton@google.com
eb241fadf2 Fix call to superclass.__init__() to work on newer versions of Python. 2008-12-02 02:33:13 +00:00
kenton@google.com
26bd9eee6e Integrate changes from internal code.
protoc
* Enum values may now have custom options, using syntax similar to field
  options.
* Fixed bug where .proto files which use custom options but don't actually
  define them (i.e. they import another .proto file defining the options)
  had to explicitly import descriptor.proto.
* Adjacent string literals in .proto files will now be concatenated, like in
  C.

C++
* Generated message classes now have a Swap() method which efficiently swaps
  the contents of two objects.
* All message classes now have a SpaceUsed() method which returns an estimate
  of the number of bytes of allocated memory currently owned by the object.
  This is particularly useful when you are reusing a single message object
  to improve performance but want to make sure it doesn't bloat up too large.
* New method Message::SerializeAsString() returns a string containing the
  serialized data.  May be more convenient than calling
  SerializeToString(string*).
* In debug mode, log error messages when string-type fields are found to
  contain bytes that are not valid UTF-8.
* Fixed bug where a message with multiple extension ranges couldn't parse
  extensions.
* Fixed bug where MergeFrom(const Message&) didn't do anything if invoked on
  a message that contained no fields (but possibly contained extensions).
* Fixed ShortDebugString() to not be O(n^2).  Durr.
* Fixed crash in TextFormat parsing if the first token in the input caused a
  tokenization error.

Java
* New overload of mergeFrom() which parses a slice of a byte array instead
  of the whole thing.
* New method ByteString.asReadOnlyByteBuffer() does what it sounds like.
* Improved performance of isInitialized() when optimizing for code size.

Python
* Corrected ListFields() signature in Message base class to match what
  subclasses actually implement.
* Some minor refactoring.
2008-11-21 00:06:27 +00:00
kenton@google.com
a41a9dd532 * Fixed template specialization syntax that MSVC 2005 didn't like. Not sure if
it was valid or not.
* Moved UTF-8 coding directive to the right place in reflection_test.py.
2008-10-03 17:27:48 +00:00
kenton@google.com
24bf56fb3a Integrate changes from internal Google-internal branch.
General
  * License changed from Apache 2.0 to New BSD.
  * It is now possible to define custom "options", which are basically
    annotations which may be placed on definitions in a .proto file.
    For example, you might define a field option called "foo" like so:
      import "google/protobuf/descriptor.proto"
      extend google.protobuf.FieldOptions {
        optional string foo = 12345;
      }
    Then you annotate a field using the "foo" option:
      message MyMessage {
        optional int32 some_field = 1 [(foo) = "bar"]
      }
    The value of this option is then visible via the message's
    Descriptor:
      const FieldDescriptor* field =
        MyMessage::descriptor()->FindFieldByName("some_field");
      assert(field->options().GetExtension(foo) == "bar");
    This feature has been implemented and tested in C++ and Java.
    Other languages may or may not need to do extra work to support
    custom options, depending on how they construct descriptors.

  C++
  * Fixed some GCC warnings that only occur when using -pedantic.
  * Improved static initialization code, making ordering more
    predictable among other things.
  * TextFormat will no longer accept messages which contain multiple
    instances of a singular field.  Previously, the latter instance
    would overwrite the former.
  * Now works on systems that don't have hash_map.

  Python
  * Strings now use the "unicode" type rather than the "str" type.
    String fields may still be assigned ASCII "str" values; they will
    automatically be converted.
  * Adding a property to an object representing a repeated field now
    raises an exception.  For example:
      # No longer works (and never should have).
      message.some_repeated_field.foo = 1
2008-09-24 20:31:01 +00:00
temporal
4e88f89ed5 Add missing file. 2008-08-13 16:40:30 +00:00
temporal
779f61c6a3 Integrate recent changes from google3.
protoc
- New flags --encode and --decode can be used to convert between protobuf text
  format and binary format from the command-line.
- New flag --descriptor_set_out can be used to write FileDescriptorProtos for
  all parsed files directly into a single output file.  This is particularly
  useful if you wish to parse .proto files from programs written in languages
  other than C++: just run protoc as a background process and have it output
  a FileDescriptorList, then parse that natively.

C++
- Reflection objects are now per-class rather than per-instance.  To make this
  possible, the Reflection interface had to be changed such that all methods
  take the Message instance as a parameter.  This change improves performance
  significantly in memory-bandwidth-limited use cases, since it makes the
  message objects smaller.  Note that source-incompatible interface changes
  like this will not be made again after the library leaves beta.

Python
- MergeFrom(message) and CopyFrom(message) are now implemented.
- SerializeToString() raises an exception if the message is missing required
  fields.
- Code organization improvements.
- Fixed doc comments for RpcController and RpcChannel, which had somehow been
  swapped.
2008-08-13 03:15:00 +00:00
temporal
24856db0e9 Applied Ulrich Kunitz's patches to slightly optimize Python serialization code. 2008-07-27 18:38:54 +00:00
temporal
f206351d14 Sync code with Google-internal branch. Changes:
Protoc (parser)
- Improved error message when an enum value's name conflicts with another
  symbol defined in the enum type's scope, e.g. if two enum types declared
  in the same scope have values with the same name.  This is disallowed for
  compatibility with C++, but this wasn't clear from the error.
C++
- Restored the set_foo(const char*) accessor for "bytes" type because some
  code inside Google depends on it.  However, set_foo(const char*, int) is
  still there (and actually is changed to take const void*).
- Fixed TokenizerTest when compiling with -DNDEBUG on Linux.
- Other irrelevant tweaks.
Java
- Fixed UnknownFieldSet's parsing of varints larger than 32 bits.
- Fixed TextFormat's parsing of "inf" and "nan".
- Fixed TextFormat's parsing of comments.
Python
- Fixed text_format_test on Windows where floating-point exponents sometimes
  contain extra zeros.
2008-07-23 01:19:07 +00:00
temporal
e8564291e2 Fix Python service CallMethod() implementation.
Patch from Johan Euphrosine <proppy@aminche.com>
2008-07-18 16:35:38 +00:00
temporal
40ee551715 Initial checkin. 2008-07-10 02:12:20 +00:00